Rate this Page

helion.Settings#

class helion.Settings(**settings)[source]#

Settings can be passed to hl.kernel as kwargs and control the behavior of the compilation process. Unlike a Config, settings are not auto-tuned and set by the user.

Parameters:

settings (object) –

__init__(**settings)[source]#

Initialize the Settings object with the provided dictionary of settings.

Parameters:

settings (object) –

Methods

__init__(**settings)

Initialize the Settings object with the provided dictionary of settings.

check_autotuning_disabled()

rtype:

None

get_rebenchmark_threshold()

Get the effective rebenchmark threshold.

to_dict()

Convert the Settings object to a dictionary.

Attributes

ignore_warnings

Subtypes of exc.BaseWarning to ignore when compiling.

index_dtype

The dtype to use for index variables.

dot_precision

Precision for dot products, see triton.language.dot.

static_shapes

If True, use static shapes for all tensors.

autotune_log_level

Log level for autotuning using Python logging levels.

autotune_compile_timeout

Timeout for Triton compilation in seconds used for autotuning.

autotune_precompile

'fork', 'spawn', or falsy/None to disable.

autotune_precompile_jobs

Maximum concurrent Triton precompile processes, default to cpu count.

autotune_random_seed

Seed used for autotuner random number generation.

autotune_accuracy_check

If True, validate candidate configs against the baseline kernel output before accepting them during autotuning.

autotune_rebenchmark_threshold

If a config is within threshold*best_perf, re-benchmark it to avoid outliers.

autotune_progress_bar

If True, show progress bar during autotuning.

autotune_max_generations

Override the maximum number of generations for Pattern Search and Differential Evolution Search autotuning algorithms with HELION_AUTOTUNE_MAX_GENERATIONS=N or @helion.kernel(autotune_max_generations=N).

autotune_ignore_errors

If True, skip logging and raising autotune errors.

print_output_code

If True, print the output code of the kernel to stderr.

print_repro

If True, print Helion kernel code, config, and caller code to stderr as a standalone repro script.

output_origin_lines

If True, annotate generated Triton code with source-origin comments.

force_autotune

If True, force autotuning even if a config is provided.

autotune_config_overrides

4}'.

allow_warp_specialize

If True, allow warp specialization for tl.range calls on CUDA devices.

debug_dtype_asserts

If True, emit tl.static_assert checks for dtype after each device node.

ref_mode

Reference mode for kernel execution.

autotuner_fn

Function to create an autotuner.

autotune_effort

Autotuning effort preset.

autotune_baseline_fn

Custom baseline function for computing baseline output during autotuning.

__init__(**settings)[source]#

Initialize the Settings object with the provided dictionary of settings.

Parameters:

settings (object) –

to_dict()[source]#

Convert the Settings object to a dictionary.

Returns:

A dictionary representation of the Settings object.

Return type:

dict[str, object]

check_autotuning_disabled()[source]#
Return type:

None

get_rebenchmark_threshold()[source]#

Get the effective rebenchmark threshold. Uses the explicit setting if provided, otherwise falls back to the effort profile default.

Returns:

The rebenchmark threshold value.

Return type:

float

ignore_warnings: list[type[BaseWarning]]#

Subtypes of exc.BaseWarning to ignore when compiling. Set HELION_IGNORE_WARNINGS=WarningA,WarningB (names from helion.exc) to configure via env.

index_dtype: dtype#

The dtype to use for index variables. Default is torch.int32. Override with HELION_INDEX_DTYPE=torch.int64, etc.

dot_precision: Literal['tf32', 'tf32x3', 'ieee']#

Precision for dot products, see triton.language.dot. Can be ‘tf32’, ‘tf32x3’, or ‘ieee’.

static_shapes: bool#

If True, use static shapes for all tensors. This is a performance optimization. Set HELION_STATIC_SHAPES=0 to disable.

autotune_log_level: int#

Log level for autotuning using Python logging levels. Default is logging.INFO. Use HELION_AUTOTUNE_LOG_LEVEL to override or set 0 to disable output.

autotune_compile_timeout: int#

Timeout for Triton compilation in seconds used for autotuning. Default is 60 seconds.

autotune_precompile: Optional[Literal['spawn', 'fork']]#

‘fork’, ‘spawn’, or falsy/None to disable. Defaults to ‘fork’ on non-Windows platforms.

Type:

Autotuner precompile mode

autotune_precompile_jobs: int | None#

Maximum concurrent Triton precompile processes, default to cpu count.

autotune_random_seed: int#

Seed used for autotuner random number generation. Defaults to HELION_AUTOTUNE_RANDOM_SEED or a time-based seed.

autotune_accuracy_check: bool#

If True, validate candidate configs against the baseline kernel output before accepting them during autotuning.

autotune_rebenchmark_threshold: float | None#

If a config is within threshold*best_perf, re-benchmark it to avoid outliers. Defaults to effort profile value. Set HELION_REBENCHMARK_THRESHOLD to override.

autotune_progress_bar: bool#

If True, show progress bar during autotuning. Default is True. Set HELION_AUTOTUNE_PROGRESS_BAR=0 to disable.

autotune_max_generations: int | None#

Override the maximum number of generations for Pattern Search and Differential Evolution Search autotuning algorithms with HELION_AUTOTUNE_MAX_GENERATIONS=N or @helion.kernel(autotune_max_generations=N).

autotune_ignore_errors: bool#

If True, skip logging and raising autotune errors. Set HELION_AUTOTUNE_IGNORE_ERRORS=1 to enable globally.

print_output_code: bool#

If True, print the output code of the kernel to stderr.

print_repro: bool#

If True, print Helion kernel code, config, and caller code to stderr as a standalone repro script.

output_origin_lines: bool#

If True, annotate generated Triton code with source-origin comments. Set HELION_OUTPUT_ORIGIN_LINES=0 to disable.

force_autotune: bool#

If True, force autotuning even if a config is provided.

autotune_config_overrides: dict[str, object]#

4}’.

Type:

Dictionary of config key/value pairs forced during autotuning. Accepts HELION_AUTOTUNE_CONFIG_OVERRIDES=’{“num_warps”

allow_warp_specialize: bool#

If True, allow warp specialization for tl.range calls on CUDA devices.

debug_dtype_asserts: bool#

If True, emit tl.static_assert checks for dtype after each device node.

ref_mode: RefMode#

Reference mode for kernel execution. Can be RefMode.OFF or RefMode.EAGER.

autotuner_fn: AutotunerFunction#

Function to create an autotuner. Override by passing a callable to @helion.kernel(…, autotuner_fn=…).

autotune_effort: Literal['none', 'quick', 'full']#

Autotuning effort preset. One of ‘none’, ‘quick’, ‘full’.

autotune_baseline_fn: Optional[Callable[..., object]]#

Custom baseline function for computing baseline output during autotuning. If provided, this function will be called instead of running the default config. Should have the same signature as the kernel function. Pass as @helion.kernel(…, autotune_baseline_fn=my_baseline_fn).