trunk/52d08b9519e82b71ababd98473077dff9007f875: [PyTorch][jit] Avoid IValue copies in unpickler (#193250) (#193250)
What happened
Summary: Avoid IValue copies in unpickler.cpp . Move keys/values into the dict in readInstruction 's DICT / SETITEMS / SETITEM arms. Those stack slots are dropped by stack_.erase() on the very next statement, and Dict::insert_or_assign is template (Key_&&, Value_&&) forwarding into Key(std::forward (key)) , so this genuinely moves -- 4 atomic refcount ops saved per dict entry on the state_dict path. Change const aut…
Summary assembled by rule from the sources below
Why it's spreading
Timeline
- First appeared on PyTorch ReleasesPyTorch Releases