fulqrum.gpu.config.GpuConfig

class GpuConfig(settings: Mapping[str, str])[source]

Stores user-supplied GPU settings.

Create with from_environ() to validate values. cfg[name] returns the supplied value as text; cfg.value(name) returns its parsed value or the default if omitted.

Automatic GPU tuning happens when the Hamiltonian is constructed. Its final settings are available in run_record.

Methods

digest()

Return a short hash of the settings explicitly present in this snapshot.

from_environ([environ, overrides])

Build a validated snapshot from runtime environment settings and overrides.

record()

Return the settings explicitly present in this snapshot as a plain dict.

value(name)

Return a typed configured value, or its registry default when unspecified.

digest() → str[source]

Return a short hash of the settings explicitly present in this snapshot.

classmethod from_environ(environ: Mapping[str, str] | None = None, overrides: Mapping[str, Any] | None = None) → GpuConfig[source]

Build a validated snapshot from runtime environment settings and overrides.

environ defaults to os.environ. Only registered runtime settings are captured; build-time environment settings are handled by the build system. Explicit overrides take precedence, and None overrides are ignored. Unknown override names raise KeyError; invalid values raise ValueError.

record() → dict[source]

Return the settings explicitly present in this snapshot as a plain dict.

value(name: str) → Any[source]

Return a typed configured value, or its registry default when unspecified.

Does not apply hardware-dependent automatic tuning; resolved execution choices are available in the Hamiltonian’s run_record.