pytorch - 💡(How to fix) Fix DISABLED test_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu (__main__.TestExamplesCorrectnessCPU) [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#180540Fetched 2026-04-17 08:26:36
View on GitHub
Comments
1
Participants
1
Timeline
16
Reactions
0
Participants
Timeline (top)
labeled ×5mentioned ×5subscribed ×5commented ×1

Error Message

Traceback (most recent call last): File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4471, in test_update_batch_norm nn.Conv2d(64, 64, 3), File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4472, in torch_dynamo_resume_in_test_update_batch_norm_at_4471 nn.BatchNorm2d( File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4477, in torch_dynamo_resume_in_test_update_batch_norm_at_4472 nn.Linear(43264, classes), File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4508, in torch_dynamo_resume_in_test_update_batch_norm_at_4477 torch.autograd.grad(compute_loss(x[i], y[i], params, buffers), flat_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ for i in range(num_batches) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ] ^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 220, in wrapped return vmap_impl( # pyrefly: ignore[bad-argument-type] ...<6 lines>... **kwargs, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 316, in vmap_impl return _flat_vmap( func, ...<6 lines>... **kwargs, ) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 507, in _flat_vmap batched_outputs = func(*batched_inputs, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 433, in wrapper return eager_transforms.grad_impl(func, argnums, has_aux, args, kwargs) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1533, in grad_impl results = grad_and_value_impl(func, argnums, has_aux, args, kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 56, in fn return f(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1484, in grad_and_value_impl output = func(*args, **kwargs) File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4491, in compute_loss return criterion(fnet(params, buffers, x), y) ~~~~^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl return forward_call(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/make_functional.py", line 331, in forward return self.stateless_model(*args, **kwargs) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl return forward_call(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/container.py", line 253, in forward input = module(input) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl return forward_call(*args, **kwargs) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 565, in forward return self._conv_forward(input, self.weight, self.bias) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 560, in _conv_forward return F.conv2d( ~~~~~~~~^ input, weight, bias, self.stride, self.padding, self.dilation, self.groups ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ NotImplementedError: Cannot access storage of TensorWrapper

To execute this test, run the following from the base repo dir: PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_eager_transforms.py TestExamplesCorrectnessCPU.test_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu

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.

Code Example

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4471, in test_update_batch_norm
    nn.Conv2d(64, 64, 3),
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4472, in torch_dynamo_resume_in_test_update_batch_norm_at_4471
    nn.BatchNorm2d(
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4477, in torch_dynamo_resume_in_test_update_batch_norm_at_4472
    nn.Linear(43264, classes),
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4508, in torch_dynamo_resume_in_test_update_batch_norm_at_4477
        torch.autograd.grad(compute_loss(x[i], y[i], params, buffers), flat_params)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        for i in range(num_batches)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ]
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 220, in wrapped
    return vmap_impl(
        # pyrefly: ignore[bad-argument-type]
    ...<6 lines>...
        **kwargs,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 316, in vmap_impl
    return _flat_vmap(
        func,
    ...<6 lines>...
        **kwargs,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 507, in _flat_vmap
    batched_outputs = func(*batched_inputs, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 433, in wrapper
    return eager_transforms.grad_impl(func, argnums, has_aux, args, kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1533, in grad_impl
    results = grad_and_value_impl(func, argnums, has_aux, args, kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 56, in fn
    return f(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1484, in grad_and_value_impl
    output = func(*args, **kwargs)
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4491, in compute_loss
    return criterion(fnet(params, buffers, x), y)
                     ~~~~^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/make_functional.py", line 331, in forward
    return self.stateless_model(*args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/container.py", line 253, in forward
    input = module(input)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 565, in forward
    return self._conv_forward(input, self.weight, self.bias)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 560, in _conv_forward
    return F.conv2d(
           ~~~~~~~~^
        input, weight, bias, self.stride, self.padding, self.dilation, self.groups
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
NotImplementedError: Cannot access storage of TensorWrapper

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_eager_transforms.py TestExamplesCorrectnessCPU.test_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu

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 5 workflow(s) with 10 failures and 5 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_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu
  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/functorch/test_eager_transforms.py", line 4471, in test_update_batch_norm
    nn.Conv2d(64, 64, 3),
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4472, in torch_dynamo_resume_in_test_update_batch_norm_at_4471
    nn.BatchNorm2d(
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4477, in torch_dynamo_resume_in_test_update_batch_norm_at_4472
    nn.Linear(43264, classes),
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4508, in torch_dynamo_resume_in_test_update_batch_norm_at_4477
        torch.autograd.grad(compute_loss(x[i], y[i], params, buffers), flat_params)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        for i in range(num_batches)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ]
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 220, in wrapped
    return vmap_impl(
        # pyrefly: ignore[bad-argument-type]
    ...<6 lines>...
        **kwargs,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 316, in vmap_impl
    return _flat_vmap(
        func,
    ...<6 lines>...
        **kwargs,
    )
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 507, in _flat_vmap
    batched_outputs = func(*batched_inputs, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/apis.py", line 433, in wrapper
    return eager_transforms.grad_impl(func, argnums, has_aux, args, kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1533, in grad_impl
    results = grad_and_value_impl(func, argnums, has_aux, args, kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/vmap.py", line 56, in fn
    return f(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/eager_transforms.py", line 1484, in grad_and_value_impl
    output = func(*args, **kwargs)
  File "/var/lib/jenkins/workspace/test/functorch/test_eager_transforms.py", line 4491, in compute_loss
    return criterion(fnet(params, buffers, x), y)
                     ~~~~^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_functorch/make_functional.py", line 331, in forward
    return self.stateless_model(*args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/container.py", line 253, in forward
    input = module(input)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/module.py", line 1789, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 565, in forward
    return self._conv_forward(input, self.weight, self.bias)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/nn/modules/conv.py", line 560, in _conv_forward
    return F.conv2d(
           ~~~~~~~~^
        input, weight, bias, self.stride, self.padding, self.dilation, self.groups
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
NotImplementedError: Cannot access storage of TensorWrapper

To execute this test, run the following from the base repo dir:
    PYTORCH_TEST_WITH_DYNAMO=1 python test/functorch/test_eager_transforms.py TestExamplesCorrectnessCPU.test_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu

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

Test file path: functorch/test_eager_transforms.py

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

cc @chauhang @penguinwu @Chillee @samdow @kshitij12345

extent analysis

TL;DR

The most likely fix for the failing test is to update the torch and functorch libraries to the latest versions and re-run the test.

Guidance

  • Investigate the NotImplementedError: Cannot access storage of TensorWrapper exception in the stacktrace to understand the root cause of the issue.
  • Review the functorch/test_eager_transforms.py test file and the TestExamplesCorrectnessCPU.test_update_batch_norm_mechanism_make_functional_originally_track_running_stats_False_cpu test case to identify potential issues.
  • Run the test with the PYTORCH_TEST_WITH_DYNAMO=1 environment variable set to enable dynamo testing and reproduce the issue.
  • Check the recent examples and workflow logs for more information on the test failures.

Example

No code example is provided as the issue is related to a specific test case and library versions.

Notes

The issue is related to a flaky test, and the provided stacktrace indicates a NotImplementedError exception. The test is disabled, and the CI is green, but the issue is still present. The provided debugging instructions can help identify the root cause of the issue.

Recommendation

Apply a workaround by updating the torch and functorch libraries to the latest versions and re-running the test. This may resolve the issue, but further investigation is required to determine the root cause.

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