trunk/98a4d7b8154b1d2cc496b7a6657068cb1ea9c662: [dynamo] add id check to innermost_fn (#174335)
A subtle PyTorch bug fix prevents potential crashes in thousands of AI models.
Deep Dive
PyTorch developers have patched a critical bug in TorchDynamo, the just-in-time compiler that powers PyTorch 2.0's performance. The issue (#172732) could cause the compiler to ignore the original function wrapper, potentially leading to incorrect model compilation or runtime failures. The fix adds an ID check to ensure proper function matching, preventing subtle errors that could affect production AI systems relying on PyTorch's compilation features for speed optimization.
Why It Matters
This prevents silent failures in deployed AI models that use PyTorch's compilation features for performance.