espnet2.torch_utils.quantization.ensure_quantized_engine
Less than 1 minute
espnet2.torch_utils.quantization.ensure_quantized_engine
espnet2.torch_utils.quantization.ensure_quantized_engine() → str
Select a quantized engine when PyTorch has left it unset.
The macOS wheels of PyTorch ship with qnnpack built in but leave torch.backends.quantized.engine at "none", so quantize_dynamic produces a model whose first quantized::linear_prepack fails with “Didn’t find engine for operation … NoQEngine”. When the engine is unset and at least one engine is available, the first one is selected.
- Returns: The engine in use after the call.
