pytorch/torch/_dynamo/variables
Animesh Jain a9d5157e25 [dynamo] Use BINARY_SUBSCR for pre-graph bytecode for regular dict accesses (#155727)
vLLM profiler sets with_stack=True that shows the dict_getitem on the profiler, both inflating the numbers and confusing compile users. This PR keeps BINARY_SUBSCR for regular dicts, while using `dict.__getitem__` only for dict subclasses.

Using binary_subscr is little bit faster, but not enough to make any major latency improvements.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/155727
Approved by: https://github.com/zou3519, https://github.com/StrongerXi, https://github.com/jansel
2025-06-12 04:02:29 +00:00
..
__init__.py [dynamo] context manager/decorator for dynamo config patching during tracing (#150586) 2025-04-23 09:12:13 +00:00
base.py [Set] Handle exception in ConstantVariable operation (#152987) 2025-05-16 14:28:32 +00:00
builder.py [dynamo] Use BINARY_SUBSCR for pre-graph bytecode for regular dict accesses (#155727) 2025-06-12 04:02:29 +00:00
builtin.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
constant.py [Set] Handle exception in ConstantVariable operation (#152987) 2025-05-16 14:28:32 +00:00
ctx_manager.py [dynamo] dynamic gb_type -> static gb_type (#154435) 2025-05-28 03:14:26 +00:00
dicts.py [dynamo] Reconstruct defaultdict properly (#154931) 2025-06-03 18:18:40 +00:00
distributed.py [Dyamo] Replace unimplemented with unimplemented_v2 for variables/distributed (#148500) 2025-03-05 20:41:43 +00:00
functions.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
higher_order_ops.py [invoke_subgraph] Add logging (#155284) 2025-06-07 11:31:53 +00:00
iter.py [dynamo] updating gb_type names for uniqueness (#154452) 2025-05-28 16:54:10 +00:00
lazy.py [Dynamo] Use LazyVariableTracker in base VT (#151847) 2025-04-23 18:18:01 +00:00
lists.py [Dynamo] Replace unimplemented with unimplemented_v2 in torch/_dynamo/variables/lists.py (#151873) 2025-04-27 11:59:45 +00:00
misc.py [dynamo] Trace into descriptor with __set__ (#154176) 2025-05-30 16:14:37 +00:00
nn_module.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
optimizer.py [dynamo] Guard serialization for NAME_MATCH (#152332) 2025-04-29 20:16:00 +00:00
script_object.py Document dynamo (#146736) 2025-02-13 00:02:21 +00:00
sdpa.py [Dynamo][Misc] Apply typing hints for codegen (#150289) 2025-04-04 14:26:22 +00:00
tensor.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
torch_function.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
torch.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00
user_defined.py Migrate from lru_cache to cache (#155613) 2025-06-11 19:44:18 +00:00