viable/strict/1789816992: [dynamo] Match CPython semantics in operator.length_hint (#196901)
- PyTorch: 1199 events in the last 90 days
- PyTorch: 1185th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1789811432: [distributed] Resolve checkpoint test futures without sleeping (#197638)
What happened
Summary Fixes silent divergences between eager and torch.compile in operator.length_hint , which is used on the hot path by list.extend , list.__init__ , deque , and _PyList_AppendTakeRef -style preallocation. ( #195901 ) Divergences Dynamo's BuiltinVariable.call_length_hint returned the raw __length_hint__ result and did not implement the post-processing of CPython's PyObject_LengthHint ( Objects/abstract.c ). Four…
Summary assembled by rule from the sources below