Skip to content

UnboundedDynamismExportTest tests broken. #9637

@ysiraichi

Description

@ysiraichi

🐛 Bug

This issue is most likely due to some change upstream in PyTorch.
Tests failing are:

  • test_add
  • test_bmm
  • test_bmm_dynamic_reduction_dim
  • test_cat
  • test_div
  • test_mul
  • test_sub

CI run with the error

Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib/python3.12/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
  File "xla/test/stablehlo/test_unbounded_dynamism.py", line 348, in test_mul
    shlo_module = exported_program_to_stablehlo(ep)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xla/torch_xla/stablehlo.py", line 629, in exported_program_to_stablehlo
    bundle = _exported_program_to_stablehlo_bundle(exported_model, options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xla/torch_xla/stablehlo.py", line 335, in _exported_program_to_stablehlo_bundle
    exported_model = _run_decompositions(exported_model)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "xla/torch_xla/stablehlo.py", line 329, in _run_decompositions
    exported_model = exported_model.run_decompositions(decomp_table)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/export/exported_program.py", line 124, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "torch/export/exported_program.py", line 1484, in run_decompositions
    return _decompose_exported_program(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/export/exported_program.py", line 967, in _decompose_exported_program
    ) = _decompose_and_get_gm_with_new_signature_constants(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/export/exported_program.py", line 476, in _decompose_and_get_gm_with_new_signature_constants
    aten_export_artifact = _export_to_aten_ir(
                           ^^^^^^^^^^^^^^^^^^^
  File "torch/export/_trace.py", line 877, in _export_to_aten_ir
    gm, graph_signature = transform(aot_export_module)(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/_functorch/aot_autograd.py", line 1444, in aot_export_module
    fx_g, metadata, in_spec, out_spec = _aot_export_function(
                                        ^^^^^^^^^^^^^^^^^^^^^
  File "torch/_functorch/aot_autograd.py", line 1694, in _aot_export_function
    aot_state = create_aot_state(
                ^^^^^^^^^^^^^^^^^
  File "torch/_functorch/aot_autograd.py", line 567, in create_aot_state
    fw_metadata = run_functionalized_fw_and_collect_metadata(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/_functorch/_aot_autograd/collect_metadata_analysis.py", line 207, in inner
    flat_f_outs = f(*flat_f_args)
                  ^^^^^^^^^^^^^^^
  File "torch/_functorch/_aot_autograd/utils.py", line 187, in flat_fn
    tree_out = fn(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^
  File "torch/_functorch/_aot_autograd/graph_capture_wrappers.py", line 1350, in functional_call
    out = PropagateUnbackedSymInts(mod).run(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/fx/interpreter.py", line 174, in run
    self.env[node] = self.run_node(node)
                     ^^^^^^^^^^^^^^^^^^^
  File "torch/fx/experimental/symbolic_shapes.py", line 7870, in run_node
    result = super().run_node(n)
             ^^^^^^^^^^^^^^^^^^^
  File "torch/fx/interpreter.py", line 256, in run_node
    return getattr(self, n.op)(n.target, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/fx/interpreter.py", line 385, in call_module
    return submod(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/nn/modules/module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "torch/_dynamo/external_utils.py", line 209, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 8, in _
NameError: name 'L' is not defined

While executing %_guards_fn : [num_users=0] = call_module[target=_guards_fn](args = (%args_0, %args_1), kwargs = {})
Original traceback:
None
Use tlparse to see full graph. (https://github.com/pytorch/tlparse?tab=readme-ov-file#tlparse-parse-structured-pt2-logs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestingTesting and coverage related issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions