trunk/9a32e12fc5da06217fb6f90d6f3438eb609afd21: [dynamo] Guard autocast objects by value rather than identity (#194754)
- PyTorch: 508 events in the last 90 days
- PyTorch: 503th Release in the last 90 days
- Previous: earlier the same day · trunk/79629b0421e09c28727f3bb8c5363abae4c9a88b: Label tests that should run on CuTeDSL or B200 appropriately (#193606)
What happened
Autocast objects are decomposed into device, dtype, enabled, and cache settings during tracing, but VariableBuilder guarded the object itself with ID_MATCH . Replacing an autocast object with an equivalent instance therefore caused an unnecessary recompile, while mutating the same object could reuse a stale graph. Identity guards also cannot be serialized for precompilation. This installs a type guard plus equality…
Summary assembled by rule from the sources below