warp.set_module_options#

warp.set_module_options(options, module=None)[source]#

Set options for the current module.

Options can be used to control runtime compilation and code-generation for the current module individually. Available options are listed below.

  • max_unroll: The maximum fixed-size loop to unroll, defaults to the value of warp.config.max_unroll.

  • enable_backward: Whether to generate the backward pass for kernels, defaults to the value of warp.config.enable_backward.

  • enable_mathdx_gemm: Use libmathdx (cuBLASDx) for tile_matmul on GPU. If None (the default), defers to warp.config.enable_mathdx_gemm at compile time.

  • enable_mathdx_solver: Use libmathdx (cuSolverDx) for tile_cholesky, tile_cholesky_solve, tile_lower_solve, and tile_upper_solve on GPU. If None (the default), defers to warp.config.enable_mathdx_solver at compile time.

  • enable_mathdx_fft: Use libmathdx (cuFFTDx) for tile_fft / tile_ifft on GPU. If None (the default), defers to warp.config.enable_mathdx_fft at compile time.

  • fast_math: Enable fast math for CUDA compilation, defaults to False.

  • fuse_fp: Enable floating-point contraction (FMA fusion) during compilation, defaults to True.

  • lineinfo: Emit line-number debug info for CUDA kernels, defaults to the value of warp.config.lineinfo.

  • cuda_output: CUDA compilation output format: "ptx", "cubin", or None (automatic), defaults to None.

  • mode: The compilation mode to use, can be "debug" or "release", defaults to the value of warp.config.mode.

  • optimization_level: Compiler optimization level (0-3). When None, falls back to warp.config.optimization_level; if that is also None, uses target-specific defaults (-O2 for CPU, -O3 for CUDA).

  • cpu_compiler_flags: CPU compiler flags (see warp.config.cpu_compiler_flags), defaults to the global config value when None.

  • deterministic: Determinism guarantee for supported atomic operations. Accepted values are warp.DeterministicMode.NOT_GUARANTEED, warp.DeterministicMode.RUN_TO_RUN, and warp.DeterministicMode.GPU_TO_GPU. Defaults to the value of warp.config.deterministic when the module is created.

  • deterministic_max_records: Per-target, per-thread upper bound for deterministic scatter records. Defaults to 0, which means use the code-generated lower bound only. This is useful when dynamic loops or repeated visits to the same atomic site can emit more records than static analysis can prove.

  • block_dim: The default number of threads to assign to each block, defaults to 256.

  • compile_time_trace: Enable compile-time tracing, defaults to the value of warp.config.compile_time_trace.

  • strip_hash: Omit the content hash from compiled kernel file names, defaults to False.

  • default_grid_stride: Whether kernels in this module that do not set grid_stride explicitly compile with a grid-stride loop. When None (the default), defers to warp.config.default_grid_stride (which defaults to grid-stride); set False to opt the module’s kernels into the lean launch. A per-kernel @warp.kernel(grid_stride=...) always takes precedence.

Parameters:
  • options (dict[str, Any]) – Set of key-value option pairs

  • module (Any)