pytorch - 💡(How to fix) Fix DISABLED test_vmap_two_inputs (__main__.FuncTorchHigherOrderOpTestsWithCompiledAutograd) [2 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#180490Fetched 2026-04-17 08:22:05
View on GitHub
Comments
2
Participants
1
Timeline
44
Reactions
0
Participants
Assignees
Timeline (top)
mentioned ×18subscribed ×18labeled ×5commented ×2

Error Message

Traceback (most recent call last): File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 6386, in test_vmap_two_inputs self.assertExpectedInline( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/internal/common_utils.py", line 3387, in assertExpectedInline return super().assertExpectedInline(actual if isinstance(actual, str) else str(actual), expect, skip + 1) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/init.py", line 413, in assertExpectedInline assert_expected_inline( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/init.py", line 378, in assert_expected_inline assert_eq(expect, actual, msg=help_text) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/init.py", line 450, in assertMultiLineEqualMaybeCppStack self.assertMultiLineEqual(expect, actual, *args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 1226, in assertMultiLineEqual self.fail(self.formatMessage(msg, standardMsg)) File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 675, in fail raise self.failureException(msg) AssertionError: 'clas[772 chars]sum_1 + sum_2; sum_1 = sum_2 = None\n [384 chars],)\n' != 'clas[772 chars]sum_1.add(sum_2); sum_1 = sum_2 = None\n [390 chars],)\n' class GraphModule(torch.nn.Module): def forward(self, L_x: "f32[3, 3, 3]", L_y: "f32[3, 3]"): l_x_ = L_x_ l_y_ = L_y_

      lazy_load_decompositions = torch._functorch.predispatch.lazy_load_decompositions();  lazy_load_decompositions = None

      _vmap_increment_nesting = torch._functorch.predispatch._vmap_increment_nesting(3, 'error');  _vmap_increment_nesting = None

      _add_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._add_batch_dim(l_x_, 0, 1);  l_x_ = None
      _add_batch_dim_1: "f32[3]" = torch._functorch.predispatch._add_batch_dim(l_y_, 1, 1);  l_y_ = None

      sum_1: "f32[3]" = _add_batch_dim.sum(0)
      sum_2: "f32[3]" = _add_batch_dim.sum(1);  _add_batch_dim = None
  •     add: "f32[3]" = sum_1 + sum_2;  sum_1 = sum_2 = None

? ^^^

  •     add: "f32[3]" = sum_1.add(sum_2);  sum_1 = sum_2 = None

? ^^^^^ +

  •     batched_outputs: "f32[3]" = add + _add_batch_dim_1;  add = _add_batch_dim_1 = None

? ^^^

  •     batched_outputs: "f32[3]" = add.add(_add_batch_dim_1);  add = _add_batch_dim_1 = None

? ^^^^^ +

      _remove_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._remove_batch_dim(batched_outputs, 1, 3, 0);  batched_outputs = None

      _vmap_decrement_nesting = torch._functorch.predispatch._vmap_decrement_nesting();  _vmap_decrement_nesting = None
      return (_remove_batch_dim,)

: To accept the new output, re-run test with envvar EXPECTTEST_ACCEPT=1 (we recommend staging/committing your changes before doing this)

To execute this test, run the following from the base repo dir: python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_vmap_two_inputs

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

lazy_load_decompositions = torch._functorch.predispatch.lazy_load_decompositions(); lazy_load_decompositions = None

_vmap_increment_nesting = torch._functorch.predispatch._vmap_increment_nesting(3, 'error'); _vmap_increment_nesting = None

_add_batch_dim: "f32[3, 3]" = torch.functorch.predispatch.add_batch_dim(l_x, 0, 1); l_x = None _add_batch_dim_1: "f32[3]" = torch.functorch.predispatch.add_batch_dim(l_y, 1, 1); l_y = None

Code Example

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 6386, in test_vmap_two_inputs
    self.assertExpectedInline(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3387, in assertExpectedInline
    return super().assertExpectedInline(actual if isinstance(actual, str) else str(actual), expect, skip + 1)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 413, in assertExpectedInline
    assert_expected_inline(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 378, in assert_expected_inline
    assert_eq(expect, actual, msg=help_text)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 450, in assertMultiLineEqualMaybeCppStack
    self.assertMultiLineEqual(expect, actual, *args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 1226, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 675, in fail
    raise self.failureException(msg)
AssertionError: 'clas[772 chars]sum_1 + sum_2;  sum_1 = sum_2 = None\n        [384 chars],)\n' != 'clas[772 chars]sum_1.add(sum_2);  sum_1 = sum_2 = None\n     [390 chars],)\n'
  class GraphModule(torch.nn.Module):
      def forward(self, L_x_: "f32[3, 3, 3]", L_y_: "f32[3, 3]"):
          l_x_ = L_x_
          l_y_ = L_y_
  
          lazy_load_decompositions = torch._functorch.predispatch.lazy_load_decompositions();  lazy_load_decompositions = None
  
          _vmap_increment_nesting = torch._functorch.predispatch._vmap_increment_nesting(3, 'error');  _vmap_increment_nesting = None
  
          _add_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._add_batch_dim(l_x_, 0, 1);  l_x_ = None
          _add_batch_dim_1: "f32[3]" = torch._functorch.predispatch._add_batch_dim(l_y_, 1, 1);  l_y_ = None
  
          sum_1: "f32[3]" = _add_batch_dim.sum(0)
          sum_2: "f32[3]" = _add_batch_dim.sum(1);  _add_batch_dim = None
-         add: "f32[3]" = sum_1 + sum_2;  sum_1 = sum_2 = None
?                              ^^^
+         add: "f32[3]" = sum_1.add(sum_2);  sum_1 = sum_2 = None
?                              ^^^^^     +
-         batched_outputs: "f32[3]" = add + _add_batch_dim_1;  add = _add_batch_dim_1 = None
?                                        ^^^
+         batched_outputs: "f32[3]" = add.add(_add_batch_dim_1);  add = _add_batch_dim_1 = None
?                                        ^^^^^                +
  
          _remove_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._remove_batch_dim(batched_outputs, 1, 3, 0);  batched_outputs = None
  
          _vmap_decrement_nesting = torch._functorch.predispatch._vmap_decrement_nesting();  _vmap_decrement_nesting = None
          return (_remove_batch_dim,)
 : To accept the new output, re-run test with envvar EXPECTTEST_ACCEPT=1 (we recommend staging/committing your changes before doing this)

To execute this test, run the following from the base repo dir:
    python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_vmap_two_inputs

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

Platforms: linux, slow

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 21 workflow(s) with 42 failures and 21 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_vmap_two_inputs
  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 "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 6386, in test_vmap_two_inputs
    self.assertExpectedInline(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3387, in assertExpectedInline
    return super().assertExpectedInline(actual if isinstance(actual, str) else str(actual), expect, skip + 1)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 413, in assertExpectedInline
    assert_expected_inline(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 378, in assert_expected_inline
    assert_eq(expect, actual, msg=help_text)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/expecttest/__init__.py", line 450, in assertMultiLineEqualMaybeCppStack
    self.assertMultiLineEqual(expect, actual, *args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 1226, in assertMultiLineEqual
    self.fail(self._formatMessage(msg, standardMsg))
  File "/opt/conda/envs/py_3.10/lib/python3.10/unittest/case.py", line 675, in fail
    raise self.failureException(msg)
AssertionError: 'clas[772 chars]sum_1 + sum_2;  sum_1 = sum_2 = None\n        [384 chars],)\n' != 'clas[772 chars]sum_1.add(sum_2);  sum_1 = sum_2 = None\n     [390 chars],)\n'
  class GraphModule(torch.nn.Module):
      def forward(self, L_x_: "f32[3, 3, 3]", L_y_: "f32[3, 3]"):
          l_x_ = L_x_
          l_y_ = L_y_
  
          lazy_load_decompositions = torch._functorch.predispatch.lazy_load_decompositions();  lazy_load_decompositions = None
  
          _vmap_increment_nesting = torch._functorch.predispatch._vmap_increment_nesting(3, 'error');  _vmap_increment_nesting = None
  
          _add_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._add_batch_dim(l_x_, 0, 1);  l_x_ = None
          _add_batch_dim_1: "f32[3]" = torch._functorch.predispatch._add_batch_dim(l_y_, 1, 1);  l_y_ = None
  
          sum_1: "f32[3]" = _add_batch_dim.sum(0)
          sum_2: "f32[3]" = _add_batch_dim.sum(1);  _add_batch_dim = None
-         add: "f32[3]" = sum_1 + sum_2;  sum_1 = sum_2 = None
?                              ^^^
+         add: "f32[3]" = sum_1.add(sum_2);  sum_1 = sum_2 = None
?                              ^^^^^     +
-         batched_outputs: "f32[3]" = add + _add_batch_dim_1;  add = _add_batch_dim_1 = None
?                                        ^^^
+         batched_outputs: "f32[3]" = add.add(_add_batch_dim_1);  add = _add_batch_dim_1 = None
?                                        ^^^^^                +
  
          _remove_batch_dim: "f32[3, 3]" = torch._functorch.predispatch._remove_batch_dim(batched_outputs, 1, 3, 0);  batched_outputs = None
  
          _vmap_decrement_nesting = torch._functorch.predispatch._vmap_decrement_nesting();  _vmap_decrement_nesting = None
          return (_remove_batch_dim,)
 : To accept the new output, re-run test with envvar EXPECTTEST_ACCEPT=1 (we recommend staging/committing your changes before doing this)

To execute this test, run the following from the base repo dir:
    python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_vmap_two_inputs

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

Test file path: inductor/test_compiled_autograd.py

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

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

extent analysis

TL;DR

The most likely fix for the failing test is to update the test to accept the new output by re-running it with the envvar EXPECTTEST_ACCEPT=1.

Guidance

  • Review the provided sample error message to understand the specific assertion error causing the test failure.
  • Investigate the changes in the expected output, specifically the replacement of + with add() and add() with add.add().
  • Consider re-running the test with EXPECTTEST_ACCEPT=1 to accept the new output, but first stage and commit any changes to ensure a clean test environment.
  • Verify that the test passes after accepting the new output and investigate any further failures.

Example

No code snippet is provided as the issue is related to a specific test failure and the fix involves re-running the test with a specific envvar.

Notes

The provided information suggests that the test failure is due to changes in the expected output, and re-running the test with EXPECTTEST_ACCEPT=1 may resolve the issue. However, it is essential to review the changes and ensure that they are correct before accepting the new output.

Recommendation

Apply workaround: Re-run the test with EXPECTTEST_ACCEPT=1 to accept the new output, as this is the most straightforward way to resolve the test failure. This approach allows for quick verification of the fix without requiring extensive code changes.

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_vmap_two_inputs (__main__.FuncTorchHigherOrderOpTestsWithCompiledAutograd) [2 comments, 1 participants]