pytorch - 💡(How to fix) Fix DISABLED test_custom_function_boxed_grads (__main__.TestAutogradWithCompiledAutograd) [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#180489Fetched 2026-04-17 08:22:07
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/test_autograd.py", line 8716, in test_custom_function_boxed_grads out.sum().backward() ~~~~~~~~~~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_tensor.py", line 631, in backward torch.autograd.backward( ~~~~~~~~~~~~~~~~~~~~~~~^ self, gradient, retain_graph, create_graph, inputs=inputs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/init.py", line 379, in backward _engine_run_backward( ~~~~~~~~~~~~~~~~~~~~^ tensors, ^^^^^^^^ ...<5 lines>... accumulate_grad=True, ^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/graph.py", line 882, in _engine_run_backward return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ t_outputs, *args, **kwargs ^^^^^^^^^^^^^^^^^^^^^^^^^^ ) # Calls into the C++ engine to run the backward pass ^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/compiled_autograd.py", line 685, in proxy_call_backward raise RuntimeError( ...<2 lines>... ) RuntimeError: boxed_grads_call=True on BoxedFunc is not supported with compiled autograd.

To execute this test, run the following from the base repo dir: python test/test_autograd.py TestAutogradWithCompiledAutograd.test_custom_function_boxed_grads

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/test_autograd.py", line 8716, in test_custom_function_boxed_grads
    out.sum().backward()
    ~~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_tensor.py", line 631, in backward
    torch.autograd.backward(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        self, gradient, retain_graph, create_graph, inputs=inputs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/__init__.py", line 379, in backward
    _engine_run_backward(
    ~~~~~~~~~~~~~~~~~~~~^
        tensors,
        ^^^^^^^^
    ...<5 lines>...
        accumulate_grad=True,
        ^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/graph.py", line 882, in _engine_run_backward
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        t_outputs, *args, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )  # Calls into the C++ engine to run the backward pass
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/compiled_autograd.py", line 685, in proxy_call_backward
    raise RuntimeError(
    ...<2 lines>...
    )
RuntimeError: boxed_grads_call=True on BoxedFunc is not supported with compiled autograd. 

To execute this test, run the following from the base repo dir:
    python test/test_autograd.py TestAutogradWithCompiledAutograd.test_custom_function_boxed_grads

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

Platforms: asan, linux

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 31 workflow(s) with 62 failures and 31 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_custom_function_boxed_grads
  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/test_autograd.py", line 8716, in test_custom_function_boxed_grads
    out.sum().backward()
    ~~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_tensor.py", line 631, in backward
    torch.autograd.backward(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        self, gradient, retain_graph, create_graph, inputs=inputs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/__init__.py", line 379, in backward
    _engine_run_backward(
    ~~~~~~~~~~~~~~~~~~~~^
        tensors,
        ^^^^^^^^
    ...<5 lines>...
        accumulate_grad=True,
        ^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/autograd/graph.py", line 882, in _engine_run_backward
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        t_outputs, *args, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )  # Calls into the C++ engine to run the backward pass
    ^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/torch/_dynamo/compiled_autograd.py", line 685, in proxy_call_backward
    raise RuntimeError(
    ...<2 lines>...
    )
RuntimeError: boxed_grads_call=True on BoxedFunc is not supported with compiled autograd. 

To execute this test, run the following from the base repo dir:
    python test/test_autograd.py TestAutogradWithCompiledAutograd.test_custom_function_boxed_grads

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 test test_custom_function_boxed_grads is failing due to an unsupported feature in compiled autograd, and a workaround or fix is needed to address the RuntimeError caused by boxed_grads_call=True on BoxedFunc.

Guidance

  • Review the test file inductor/test_compiled_autograd.py to understand the usage of boxed_grads_call=True and its implications with compiled autograd.
  • Investigate the possibility of disabling compiled autograd for this specific test or modifying the test to avoid using boxed_grads_call=True.
  • Check the PyTorch documentation and issues for any known workarounds or fixes related to this error message.
  • Consider reaching out to the maintainers or experts mentioned in the issue (e.g., @voznesenskym, @penguinwu) for guidance on resolving this issue.

Example

No code snippet is provided as the issue does not contain sufficient information to create a minimal example.

Notes

The issue is specific to the PyTorch framework and its interaction with compiled autograd. The error message suggests that the feature is not supported, and a workaround or fix is needed to address this issue.

Recommendation

Apply a workaround by modifying the test to avoid using boxed_grads_call=True or disabling compiled autograd for this specific test, as the error message indicates that this feature is not supported.

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