# tensorplay.cuda.tunable API Source: https://www.tensorplay.cn/docs/api/tensorplay.cuda.tunable.html ## Functions 20 [#](#api-tensorplay.cuda.tunable.disable) ### disable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.disable.html) ```python tensorplay.cuda.tunable.disable() → None ``` Turn GEMM kernel tuning off. See [enable()](/docs/generated/tensorplay.cuda.tunable.enable.html#tensorplay.cuda.tunable.enable). [#](#api-tensorplay.cuda.tunable.enable) ### enable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.enable.html) ```python tensorplay.cuda.tunable.enable(val: bool = True) → None ``` Turn GEMM kernel tuning on or off. While on, every GEMM on the tunable path reuses the algorithm recorded for its signature (or measures one, when tuning is also enabled and no winner is recorded yet). While off, dispatch is exactly the untuned behavior. [#](#api-tensorplay.cuda.tunable.get_filename) ### get_filename function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.get_filename.html) ```python tensorplay.cuda.tunable.get_filename() → str ``` Return the configured results filename (empty until set or first use). [#](#api-tensorplay.cuda.tunable.get_max_tuning_duration) ### get_max_tuning_duration function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.get_max_tuning_duration.html) ```python tensorplay.cuda.tunable.get_max_tuning_duration() → int ``` Return the per-candidate measurement time limit in milliseconds. [#](#api-tensorplay.cuda.tunable.get_max_tuning_samples) ### get_max_tuning_samples function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.get_max_tuning_samples.html) ```python tensorplay.cuda.tunable.get_max_tuning_samples() → int ``` Return the per-candidate sample limit. [#](#api-tensorplay.cuda.tunable.get_results) ### get_results function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.get_results.html) ```python tensorplay.cuda.tunable.get_results() → list[tuple[str, str, str, float]] ``` Return every recorded winner as (op, params, kernel, time_ms). [#](#api-tensorplay.cuda.tunable.is_enabled) ### is_enabled function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.is_enabled.html) ```python tensorplay.cuda.tunable.is_enabled() → bool ``` Return whether GEMM kernel tuning is enabled. [#](#api-tensorplay.cuda.tunable.is_verbose) ### is_verbose function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.is_verbose.html) ```python tensorplay.cuda.tunable.is_verbose() → bool ``` Return whether diagnostic logging is on. [#](#api-tensorplay.cuda.tunable.read_file) ### read_file function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.read_file.html) ```python tensorplay.cuda.tunable.read_file(filename: str | None = None) → bool ``` Merge a tuning results file into the in-memory database. The file’s validator lines must match the current build and device; otherwise the file is rejected and False is returned. Entries already measured in this process win over the file’s. If filename is not given, the configured results file is used. [#](#api-tensorplay.cuda.tunable.record_untuned_disable) ### record_untuned_disable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.record_untuned_disable.html) ```python tensorplay.cuda.tunable.record_untuned_disable() → None ``` Stop logging untuned GEMMs. See [record_untuned_enable()](/docs/generated/tensorplay.cuda.tunable.record_untuned_enable.html#tensorplay.cuda.tunable.record_untuned_enable). [#](#api-tensorplay.cuda.tunable.record_untuned_enable) ### record_untuned_enable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.record_untuned_enable.html) ```python tensorplay.cuda.tunable.record_untuned_enable(val: bool = True) → None ``` Control logging of GEMMs that ran without a tuned choice. When enabled, every unique signature that runs untuned is appended to the untuned file (tunableop_untuned.csv in the working directory), one line per signature. [#](#api-tensorplay.cuda.tunable.record_untuned_is_enabled) ### record_untuned_is_enabled function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.record_untuned_is_enabled.html) ```python tensorplay.cuda.tunable.record_untuned_is_enabled() → bool ``` Return whether untuned GEMMs are being logged. [#](#api-tensorplay.cuda.tunable.set_filename) ### set_filename function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.set_filename.html) ```python tensorplay.cuda.tunable.set_filename(filename: str, insert_device_ordinal: bool = False) → None ``` Set the file used to persist tuning results. If insert_device_ordinal is True, the current device ordinal is embedded in the name (a %d token is replaced in place, otherwise the ordinal lands before the extension). This keeps one-process-per-device runs from sharing a file. An empty filename turns file persistence off. [#](#api-tensorplay.cuda.tunable.set_max_tuning_duration) ### set_max_tuning_duration function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.set_max_tuning_duration.html) ```python tensorplay.cuda.tunable.set_max_tuning_duration(duration_ms: int) → None ``` Bound the time spent measuring one candidate, in milliseconds. Zero disables the limit. When both this and [set_max_tuning_samples()](/docs/generated/tensorplay.cuda.tunable.set_max_tuning_samples.html#tensorplay.cuda.tunable.set_max_tuning_samples) are set, the smaller bound wins; a measurement always runs at least one timed sample. [#](#api-tensorplay.cuda.tunable.set_max_tuning_samples) ### set_max_tuning_samples function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.set_max_tuning_samples.html) ```python tensorplay.cuda.tunable.set_max_tuning_samples(samples: int) → None ``` Bound the timed samples spent measuring one candidate. Zero disables the limit. When both this and [set_max_tuning_duration()](/docs/generated/tensorplay.cuda.tunable.set_max_tuning_duration.html#tensorplay.cuda.tunable.set_max_tuning_duration) are set, the smaller bound wins; a measurement always runs at least one timed sample. [#](#api-tensorplay.cuda.tunable.set_verbose) ### set_verbose function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.set_verbose.html) ```python tensorplay.cuda.tunable.set_verbose(val: bool) → None ``` Turn diagnostic logging of the tuning context on or off. Verbose output goes to stderr and reports state changes, measurement passes and file activity. It is meant for debugging. [#](#api-tensorplay.cuda.tunable.tuning_disable) ### tuning_disable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.tuning_disable.html) ```python tensorplay.cuda.tunable.tuning_disable() → None ``` Stop measuring untuned GEMM shapes. See [tuning_enable()](/docs/generated/tensorplay.cuda.tunable.tuning_enable.html#tensorplay.cuda.tunable.tuning_enable). [#](#api-tensorplay.cuda.tunable.tuning_enable) ### tuning_enable function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.tuning_enable.html) ```python tensorplay.cuda.tunable.tuning_enable(val: bool = True) → None ``` Control whether untuned GEMM shapes are measured. When enabled, a GEMM without a recorded winner times every candidate algorithm and records the fastest; newly found winners are appended to the results file as they are measured. When disabled, such a GEMM runs the library heuristic’s top choice. [#](#api-tensorplay.cuda.tunable.tuning_is_enabled) ### tuning_is_enabled function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.tuning_is_enabled.html) ```python tensorplay.cuda.tunable.tuning_is_enabled() → bool ``` Return whether untuned GEMM shapes are measured. [#](#api-tensorplay.cuda.tunable.write_file) ### write_file function[Full reference ↗](/docs/generated/tensorplay.cuda.tunable.write_file.html) ```python tensorplay.cuda.tunable.write_file() → None ``` Rewrite the results file with every recorded winner. The file is recreated with fresh validator lines followed by all in-memory results (both those read from files and those measured in this process).