fused_fftconv2d_lowering#
- fused_fftconv2d_lowering(allow_reduced_precision=True)#
Context manager that installs
FusedFFTConv2dLoweringglobally.Prefer
fused_fftconv2d_options()when you control thetorch.compilecall — it is scoped to a single callable instead of patching global inductor config. Reach for this context manager when something else compiles the model for you (a trainer, a framework entry point) and you cannot passoptions.torch.compilecaches compiled artifacts, so enter this before the first compiled call on the model you want rewritten; a function already compiled without the pass keeps its cached code.- Parameters:
allow_reduced_precision (bool) – See
FusedFFTConv2dLowering.
Example
>>> import torch >>> from nvsubquadratic.ops.fftconv_lowering import ( ... fused_fftconv2d_lowering, ... lowering_stats, ... ) >>> with fused_fftconv2d_lowering(): ... compiled = torch.compile(model) ... out = compiled(x) >>> lowering_stats().get("rewritten", 0) 1
Note
Inductor exposes a single
pre_grad_custom_passslot. Any pass already registered is saved and restored on exit, but the two do not compose while this one is active.