← Back to events
ActiveAIRelease

viable/strict/1792517296: [fx] Make _Patcher's already-patched guard actually fire (#201464)

Photo: PyTorch Releases

What happened

Summary: _Patcher.patch and _Patcher.patch_method mark each new wrapper with new_fn.__fx_already_patched = deduplicate . Inside class _Patcher , Python name-mangles that attribute to _Patcher__fx_already_patched , while the guard reads getattr(..., "__fx_already_patched", False) , so the guard never fires. As a result, a re-entrant trace (one that starts while a module global already holds FX's wrapper for a torch.f…

Summary assembled by rule from the sources below

Why it's spreading

Sources