viable/strict/1788468668: [dynamo] Index bytecode constants by identity (#195622)
- PyTorch: 478 events in the last 90 days
- PyTorch: 473th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1788467170: [Docs] Update build and CI persons of interest (#195860)
What happened
Bytecode assembly located every LOAD_CONST by linearly scanning the growing constant tuple. Large generated functions therefore spent quadratic time in constant lookup. Build an identity-to-index table once per assembly and update it when constants are appended. Object identity remains the key because equal constants can have different semantics, and unlike hashing it also supports unhashable constants. Test Plan: p…
Summary assembled by rule from the sources below