coreai_opt.quantization.ExecutionMode¶
- class coreai_opt.quantization.ExecutionMode(value, *args, **kwargs)[source]¶
Bases:
StrEnumEnum representing quantization execution modes.
Each member is a string value representing the execution mode used for quantization.
- Parameters:
value (object)
args (Any)
kwargs (Any)
- Return type:
Any
- GRAPH¶
Graph-based quantization using
torch.exportto capture the model as an FX graph, then applying quantization on top. Built ontorchao’s PT2E implementation. Requires the model to be exportable viatorch.export.export. Recommended default.
- EAGER¶
Eager-mode quantization that works directly on
nn.Modulewithout graph capture. Supports dynamic control flow (if/else, loops) and is the fallback when a model is not exportable.
- __init__(*args, **kwds)¶
- PT2E: ExecutionMode = 'graph'¶
Deprecated. Use
ExecutionMode.GRAPHinstead.