pytorch - 💡(How to fix) Fix DISABLED test_static_input_indices (__main__.TestAOTJointWithDescriptors) [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#181341Fetched 2026-04-24 10:35:50
View on GitHub
Comments
1
Participants
1
Timeline
12
Reactions
0
Participants
Timeline (top)
mentioned ×4subscribed ×4labeled ×3commented ×1

Error Message

Traceback (most recent call last): File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1073, in test_static_input_indices class SimpleLinear(nn.Module): File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1081, in torch_dynamo_resume_in_test_static_input_indices_at_1073 model = SimpleLinear() File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1081 gm = dynamo_graph_capture_for_export(model)(*inputs) File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1083 gm = dynamo_graph_capture_for_export(model)(*inputs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/functional_export.py", line 809, in inner out = fullgraph_capture( fn, ...<2 lines>... constraints=constraints, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1344, in fullgraph_capture return _fullgraph_capture_frame( frame, constraints=constraints, _is_export_deprecated_do_not_use=_is_export_deprecated_do_not_use, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1413, in _fullgraph_capture_frame dynamo_output.graph_capture_output(frame.argdefs, frame.kwdefaults), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 991, in graph_capture_output return GraphCaptureOutput( OutputGraphCommon( ...<12 lines>... self.tracer_output.f_globals, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2480, in call result = self._torchdynamo_orig_backend( frame, cache_entry, self.hooks, frame_state, skip=1 ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2198, in call result = self._inner_convert( frame, cache_entry, hooks, frame_state, skip=skip + 1 ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 758, in call result = _compile( frame.f_code, ...<16 lines>... convert_frame_box=self._box, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2048, in _compile raise InternalTorchDynamoError( f"{type(e).qualname}: {str(e)}" ).with_traceback(e.traceback) from None File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1983, in _compile guarded_code, tracer_output = compile_inner(code, one_graph, hooks) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_utils_internal.py", line 96, in wrapper_function return function(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1593, in compile_inner result = _compile_inner(code, one_graph, hooks) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1652, in _compile_inner dynamo_output = compile_frame( code, ...<11 lines>... package=package, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1500, in compile_frame bytecode, tracer_output = transform_code_object(code, transform) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/bytecode_transformation.py", line 1626, in transform_code_object tracer_output = transformations(instructions, code_options) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1472, in transform tracer_output = trace_frame( code, ...<14 lines>... package=package, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 365, in _fn return fn(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 933, in trace_frame run_tracer() ~~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 914, in run_tracer tracer.run() ~~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1839, in run while self.step(): ~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1506, in step self.dispatch_table[inst.opcode](self, inst) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1043, in wrapper return inner_fn(self, inst) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 2974, in STORE_ATTR VariableTracker.build(self, setattr).call_function( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ self, # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [obj, VariableTracker.build(self, inst.argval), val], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ {}, ^^^ ) ^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1519, in call_function return handler(tx, args, kwargs) # type: ignore[return-value] File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1078, in <lambda> tx, [v.realize() for v in args], kwargs ~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 107, in realize self._cache.realize() ~~~~~~~~~~~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 44, in realize self.vt = builder.VariableBuilder( ~~~~~~~~~~~~~~~~~~~~~~~~ tx, self.source, allow_lazy_constant=False ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )(self.value) ~^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 488, in call return self._call_impl(value) ~~~~~~~~~~~~~~~^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 525, in _call_impl vt = self._wrap(value) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 878, in _wrap result = dict( build_key_value(i, k, v) for i, k, v in enumerate_items_with_dict_position(value) ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 880, in <genexpr> for i, k, v in enumerate_items_with_dict_position(value) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/utils.py", line 2944, in <genexpr> return ((i, k, v) for i, (k, v) in enumerate(items)) ~~~~~~~~~^^^^^^^ torch._dynamo.exc.InternalTorchDynamoError: RuntimeError: dictionary changed size during iteration

from user code: File "<string>", line 10, in init

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"

To execute this test, run the following from the base repo dir: PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_aot_joint_with_descriptors.py TestAOTJointWithDescriptors.test_static_input_indices

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

Root Cause

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Fix Action

Fix / Workaround

Traceback (most recent call last):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1073, in test_static_input_indices
    class SimpleLinear(nn.Module):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1081, in torch_dynamo_resume_in_test_static_input_indices_at_1073
    model = SimpleLinear()
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1081
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1083
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/functional_export.py", line 809, in inner
    out = fullgraph_capture(
        fn,
    ...<2 lines>...
        constraints=constraints,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1344, in fullgraph_capture
    return _fullgraph_capture_frame(
        frame,
        constraints=constraints,
        _is_export_deprecated_do_not_use=_is_export_deprecated_do_not_use,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1413, in _fullgraph_capture_frame
    dynamo_output.graph_capture_output(frame.argdefs, frame.kwdefaults),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 991, in graph_capture_output
    return GraphCaptureOutput(
        OutputGraphCommon(
    ...<12 lines>...
        self.tracer_output.f_globals,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2480, in __call__
    result = self._torchdynamo_orig_backend(
        frame, cache_entry, self.hooks, frame_state, skip=1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2198, in __call__
    result = self._inner_convert(
        frame, cache_entry, hooks, frame_state, skip=skip + 1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 758, in __call__
    result = _compile(
        frame.f_code,
    ...<16 lines>...
        convert_frame_box=self._box,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2048, in _compile
    raise InternalTorchDynamoError(
        f"{type(e).__qualname__}: {str(e)}"
    ).with_traceback(e.__traceback__) from None
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1983, in _compile
    guarded_code, tracer_output = compile_inner(code, one_graph, hooks)
                                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_utils_internal.py", line 96, in wrapper_function
    return function(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1593, in compile_inner
    result = _compile_inner(code, one_graph, hooks)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1652, in _compile_inner
    dynamo_output = compile_frame(
        code,
    ...<11 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1500, in compile_frame
    bytecode, tracer_output = transform_code_object(code, transform)
                              ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/bytecode_transformation.py", line 1626, in transform_code_object
    tracer_output = transformations(instructions, code_options)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1472, in transform
    tracer_output = trace_frame(
        code,
    ...<14 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 365, in _fn
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 933, in trace_frame
    run_tracer()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 914, in run_tracer
    tracer.run()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1839, in run
    while self.step():
          ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1506, in step
    self.dispatch_table[inst.opcode](self, inst)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1043, in wrapper
    return inner_fn(self, inst)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 2974, in STORE_ATTR
    VariableTracker.build(self, setattr).call_function(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self,  # type: ignore[arg-type]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [obj, VariableTracker.build(self, inst.argval), val],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        {},
        ^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1519, in call_function
    return handler(tx, args, kwargs)  # type: ignore[return-value]
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1078, in <lambda>
    tx, [v.realize() for v in args], kwargs
         ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 107, in realize
    self._cache.realize()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 44, in realize
    self.vt = builder.VariableBuilder(
              ~~~~~~~~~~~~~~~~~~~~~~~~
        tx, self.source, allow_lazy_constant=False
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    )(self.value)
    ~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 488, in __call__
    return self._call_impl(value)
           ~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 525, in _call_impl
    vt = self._wrap(value)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 878, in _wrap
    result = dict(
        build_key_value(i, k, v)
        for i, k, v in enumerate_items_with_dict_position(value)
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 880, in <genexpr>
    for i, k, v in enumerate_items_with_dict_position(value)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/utils.py", line 2944, in <genexpr>
    return ((i, k, v) for i, (k, v) in enumerate(items))
                                       ~~~~~~~~~^^^^^^^
torch._dynamo.exc.InternalTorchDynamoError: RuntimeError: dictionary changed size during iteration

Code Example

Traceback (most recent call last):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1073, in test_static_input_indices
    class SimpleLinear(nn.Module):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1081, in torch_dynamo_resume_in_test_static_input_indices_at_1073
    model = SimpleLinear()
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1081
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1083
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/functional_export.py", line 809, in inner
    out = fullgraph_capture(
        fn,
    ...<2 lines>...
        constraints=constraints,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1344, in fullgraph_capture
    return _fullgraph_capture_frame(
        frame,
        constraints=constraints,
        _is_export_deprecated_do_not_use=_is_export_deprecated_do_not_use,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1413, in _fullgraph_capture_frame
    dynamo_output.graph_capture_output(frame.argdefs, frame.kwdefaults),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 991, in graph_capture_output
    return GraphCaptureOutput(
        OutputGraphCommon(
    ...<12 lines>...
        self.tracer_output.f_globals,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2480, in __call__
    result = self._torchdynamo_orig_backend(
        frame, cache_entry, self.hooks, frame_state, skip=1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2198, in __call__
    result = self._inner_convert(
        frame, cache_entry, hooks, frame_state, skip=skip + 1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 758, in __call__
    result = _compile(
        frame.f_code,
    ...<16 lines>...
        convert_frame_box=self._box,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2048, in _compile
    raise InternalTorchDynamoError(
        f"{type(e).__qualname__}: {str(e)}"
    ).with_traceback(e.__traceback__) from None
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1983, in _compile
    guarded_code, tracer_output = compile_inner(code, one_graph, hooks)
                                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_utils_internal.py", line 96, in wrapper_function
    return function(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1593, in compile_inner
    result = _compile_inner(code, one_graph, hooks)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1652, in _compile_inner
    dynamo_output = compile_frame(
        code,
    ...<11 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1500, in compile_frame
    bytecode, tracer_output = transform_code_object(code, transform)
                              ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/bytecode_transformation.py", line 1626, in transform_code_object
    tracer_output = transformations(instructions, code_options)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1472, in transform
    tracer_output = trace_frame(
        code,
    ...<14 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 365, in _fn
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 933, in trace_frame
    run_tracer()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 914, in run_tracer
    tracer.run()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1839, in run
    while self.step():
          ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1506, in step
    self.dispatch_table[inst.opcode](self, inst)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1043, in wrapper
    return inner_fn(self, inst)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 2974, in STORE_ATTR
    VariableTracker.build(self, setattr).call_function(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self,  # type: ignore[arg-type]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [obj, VariableTracker.build(self, inst.argval), val],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        {},
        ^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1519, in call_function
    return handler(tx, args, kwargs)  # type: ignore[return-value]
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1078, in <lambda>
    tx, [v.realize() for v in args], kwargs
         ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 107, in realize
    self._cache.realize()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 44, in realize
    self.vt = builder.VariableBuilder(
              ~~~~~~~~~~~~~~~~~~~~~~~~
        tx, self.source, allow_lazy_constant=False
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    )(self.value)
    ~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 488, in __call__
    return self._call_impl(value)
           ~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 525, in _call_impl
    vt = self._wrap(value)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 878, in _wrap
    result = dict(
        build_key_value(i, k, v)
        for i, k, v in enumerate_items_with_dict_position(value)
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 880, in <genexpr>
    for i, k, v in enumerate_items_with_dict_position(value)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/utils.py", line 2944, in <genexpr>
    return ((i, k, v) for i, (k, v) in enumerate(items))
                                       ~~~~~~~~~^^^^^^^
torch._dynamo.exc.InternalTorchDynamoError: RuntimeError: dictionary changed size during iteration

from user code:
   File "<string>", line 10, in __init__

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"


To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_aot_joint_with_descriptors.py TestAOTJointWithDescriptors.test_static_input_indices

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
RAW_BUFFERClick to expand / collapse

Platforms: dynamo

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Over the past 6 hours, it has been determined flaky in 8 workflow(s) with 8 failures and 8 successes.

Debugging instructions (after clicking on the recent samples link): DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets:

  1. Click on the workflow logs linked above
  2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
  3. Grep for test_static_input_indices
  4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.
<details><summary>Sample error message</summary>
Traceback (most recent call last):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1073, in test_static_input_indices
    class SimpleLinear(nn.Module):
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1081, in torch_dynamo_resume_in_test_static_input_indices_at_1073
    model = SimpleLinear()
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1081
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/__w/pytorch/pytorch/test/functorch/test_aot_joint_with_descriptors.py", line 1083, in torch_dynamo_resume_in_test_static_input_indices_at_1083
    gm = dynamo_graph_capture_for_export(model)(*inputs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/functional_export.py", line 809, in inner
    out = fullgraph_capture(
        fn,
    ...<2 lines>...
        constraints=constraints,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1344, in fullgraph_capture
    return _fullgraph_capture_frame(
        frame,
        constraints=constraints,
        _is_export_deprecated_do_not_use=_is_export_deprecated_do_not_use,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1413, in _fullgraph_capture_frame
    dynamo_output.graph_capture_output(frame.argdefs, frame.kwdefaults),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 991, in graph_capture_output
    return GraphCaptureOutput(
        OutputGraphCommon(
    ...<12 lines>...
        self.tracer_output.f_globals,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2480, in __call__
    result = self._torchdynamo_orig_backend(
        frame, cache_entry, self.hooks, frame_state, skip=1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2198, in __call__
    result = self._inner_convert(
        frame, cache_entry, hooks, frame_state, skip=skip + 1
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 758, in __call__
    result = _compile(
        frame.f_code,
    ...<16 lines>...
        convert_frame_box=self._box,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 2048, in _compile
    raise InternalTorchDynamoError(
        f"{type(e).__qualname__}: {str(e)}"
    ).with_traceback(e.__traceback__) from None
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1983, in _compile
    guarded_code, tracer_output = compile_inner(code, one_graph, hooks)
                                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_utils_internal.py", line 96, in wrapper_function
    return function(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1593, in compile_inner
    result = _compile_inner(code, one_graph, hooks)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1652, in _compile_inner
    dynamo_output = compile_frame(
        code,
    ...<11 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1500, in compile_frame
    bytecode, tracer_output = transform_code_object(code, transform)
                              ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/bytecode_transformation.py", line 1626, in transform_code_object
    tracer_output = transformations(instructions, code_options)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 1472, in transform
    tracer_output = trace_frame(
        code,
    ...<14 lines>...
        package=package,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 365, in _fn
    return fn(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 933, in trace_frame
    run_tracer()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/convert_frame.py", line 914, in run_tracer
    tracer.run()
    ~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1839, in run
    while self.step():
          ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1506, in step
    self.dispatch_table[inst.opcode](self, inst)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 1043, in wrapper
    return inner_fn(self, inst)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/symbolic_convert.py", line 2974, in STORE_ATTR
    VariableTracker.build(self, setattr).call_function(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self,  # type: ignore[arg-type]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [obj, VariableTracker.build(self, inst.argval), val],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        {},
        ^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1519, in call_function
    return handler(tx, args, kwargs)  # type: ignore[return-value]
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builtin.py", line 1078, in <lambda>
    tx, [v.realize() for v in args], kwargs
         ~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 107, in realize
    self._cache.realize()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/lazy.py", line 44, in realize
    self.vt = builder.VariableBuilder(
              ~~~~~~~~~~~~~~~~~~~~~~~~
        tx, self.source, allow_lazy_constant=False
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    )(self.value)
    ~^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 488, in __call__
    return self._call_impl(value)
           ~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 525, in _call_impl
    vt = self._wrap(value)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 878, in _wrap
    result = dict(
        build_key_value(i, k, v)
        for i, k, v in enumerate_items_with_dict_position(value)
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/variables/builder.py", line 880, in <genexpr>
    for i, k, v in enumerate_items_with_dict_position(value)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/utils.py", line 2944, in <genexpr>
    return ((i, k, v) for i, (k, v) in enumerate(items))
                                       ~~~~~~~~~^^^^^^^
torch._dynamo.exc.InternalTorchDynamoError: RuntimeError: dictionary changed size during iteration

from user code:
   File "<string>", line 10, in __init__

Set TORCHDYNAMO_VERBOSE=1 for the internal stack trace (please do this especially if you're reporting a bug to PyTorch). For even more developer context, set TORCH_LOGS="+dynamo"


To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_aot_joint_with_descriptors.py TestAOTJointWithDescriptors.test_static_input_indices

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
</details>

Test file path: functorch/test_aot_joint_with_descriptors.py

For all disabled tests (by GitHub issue), see https://hud.pytorch.org/disabled.

cc @chauhang @penguinwu

extent analysis

TL;DR

The test test_static_input_indices is failing due to an InternalTorchDynamoError caused by a RuntimeError: dictionary changed size during iteration, and the fix likely involves modifying the test or the dynamo configuration to avoid this error.

Guidance

  • Review the test test_static_input_indices in functorch/test_aot_joint_with_descriptors.py to identify potential issues with dictionary iteration.
  • Set TORCHDYNAMO_VERBOSE=1 and TORCH_LOGS="+dynamo" to obtain more detailed logs and internal stack traces for debugging.
  • Run the test with PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_aot_joint_with_descriptors.py TestAOTJointWithDescriptors.test_static_input_indices to reproduce the error.
  • Investigate the dynamo configuration and the test's usage of dictionaries to determine the cause of the dictionary changed size during iteration error.

Notes

The error message suggests a problem with dictionary iteration, but the root cause is unclear without further investigation. The provided logs and stack traces may help identify the issue.

Recommendation

Apply a workaround by modifying the test or the dynamo configuration to avoid the dictionary changed size during iteration error, as the exact fix is unclear without further debugging.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix DISABLED test_static_input_indices (__main__.TestAOTJointWithDescriptors) [1 comments, 1 participants]