pytorch/torch/_dynamo/variables
Laith Sakka c6a8db0b9a Fix issues with generalized_scatter and setitem allocated unbacked symbols. (#164341)
Three fixes:
1. When doing t[u0] +=1  if u0 is unbacked we could allocate a new unbacked symbol during the the indexing of t[u0] (when we fake trace setitem), namely because meta_select does allocate a new unbacked symbol for the storage offset when we do not know if u0>=0 or u0<0.  but the output size/stride of setitem(), does not depend on that new symbol. it's self consumed in setitem so we shall ignore it.

2. Also when we trace through generalized_scatter the applications of the views could allocate unbacked symints
but those do not effect final output, we also shall ignore them.

3.Before accessing strides in lowering we shall materialize.

Address  https://github.com/pytorch/pytorch/issues/114293 and https://github.com/pytorch/pytorch/issues/131911

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164341
Approved by: https://github.com/bobrenjc93
2025-10-18 03:20:30 +00:00
..
__init__.py [user-streams] Move stream code to streams module (#163027) 2025-10-14 05:43:19 +00:00
base.py [dynamo][guards] More small guard optimizations (#159345) 2025-07-29 18:36:49 +00:00
builder.py [Bugfix][Dynamo] Fix Sparse tensors by graph break in Dynamo (#164873) 2025-10-16 15:06:20 +00:00
builtin.py [user-streams] Move stream code to streams module (#163027) 2025-10-14 05:43:19 +00:00
constant.py More ruff SIM fixes (#164695) 2025-10-09 03:24:50 +00:00
ctx_manager.py [user-streams] Move stream code to streams module (#163027) 2025-10-14 05:43:19 +00:00
dicts.py Relax equality check (#165460) 2025-10-15 18:32:01 +00:00
distributed.py Fixing get_local_rank() variable missing when compiled (#165432) 2025-10-16 18:20:34 +00:00
functions.py Patch the flex_attention._get_mod_type to not use inspect.signature when computing num_positional_args (an alternative fix for flex attention graph break on create_block_mask) (#164923) 2025-10-17 17:44:45 +00:00
higher_order_ops.py [dynamo][ac] Config flag to allow eager and compile AC divergence for side-effects (#165775) 2025-10-17 22:04:19 +00:00
iter.py [dynamo, nested graph breaks] move cell codegen before side effects codegen (#160601) 2025-10-08 22:02:52 +00:00
lazy.py [Dynamo][Logging] Add sources/types to LazyVariableTracker logging (#165402) 2025-10-15 23:23:09 +00:00
lists.py [1/N] Use "is" in python type comparison (#165037) 2025-10-10 12:36:50 +00:00
misc.py [dynamo][misc] Replace UserFunctionVariable with VariableTracker build (#165707) 2025-10-17 17:02:18 +00:00
nn_module.py More ruff SIM fixes (#164695) 2025-10-09 03:24:50 +00:00
optimizer.py [Dynamo] Don't guard data ptrs by default with mark_static_address (#162208) 2025-09-12 07:15:10 +00:00
script_object.py [dynamo] Replace unimplemented with unimplemented_v2 in torch/_dynamo/variables/script_object.py (#159343) 2025-08-01 21:30:41 +00:00
sdpa.py More ruff SIM fixes (#164695) 2025-10-09 03:24:50 +00:00
streams.py [RFC] Add pyrefly to lintrunner (#165179) 2025-10-16 20:07:09 +00:00
tensor.py Fix issues with generalized_scatter and setitem allocated unbacked symbols. (#164341) 2025-10-18 03:20:30 +00:00
torch_function.py [dynamo] Be consistent with UserMethodVariable source (#160155) 2025-08-09 04:16:14 +00:00
torch.py [dynamo][easy] Support torch.accelerator.current_accelerator (#165734) 2025-10-17 22:04:19 +00:00
user_defined.py [dynamo][user_defined] Replace UserFunctionVariable with VariableTracker build (#165706) 2025-10-17 17:02:18 +00:00