x86_inductor
x86_inductor
¶
X86 Inductor backend for PT2E quantized operator lowering.
X86InductorBackend
¶
Bases: BasePT2EBackend
X86 Inductor backend for PT2E quantization and lowering.
Initialize X86 Inductor backend configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_dynamic
|
bool
|
Use dynamic activation quantization. |
False
|
is_qat
|
bool
|
Use quantization-aware training observers. |
False
|
reduce_range
|
bool
|
Reduce quantization range for older CPUs without VNNI. |
False
|
Source code in src/versatil/quantization/pt2e/backends/x86_inductor.py
create_quantizer
¶
Create an X86InductorQuantizer targeting a specific module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
module_path
|
str
|
Dotted path to the target submodule. Empty string means global (whole model). |
required |
Returns:
| Type | Description |
|---|---|
Quantizer
|
Configured X86InductorQuantizer. |
Source code in src/versatil/quantization/pt2e/backends/x86_inductor.py
environment_context
¶
Context manager that sets and restores X86 Inductor env vars.
Sets CUDA_VISIBLE_DEVICES to empty (CPU-only), enables TORCHINDUCTOR_FREEZING, and enables cpp_wrapper. Restores original values on exit.
Yields:
| Type | Description |
|---|---|
Generator[None]
|
None. |
Source code in src/versatil/quantization/pt2e/backends/x86_inductor.py
activate_environment
¶
Set X86 Inductor env vars permanently.