pytorch - 💡(How to fix) Fix DISABLED test_hessian (__main__.FuncTorchHigherOrderOpTestsWithCompiledAutograd)

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…

Error Message

Traceback (most recent call last): File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3803, in test_hessian wrapped_gm = self._compile_check(wrapper_fn, (x,)) File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3789, in _compile_check expected = torch.compile(fn, backend=backend, fullgraph=fullgraph)(*inputs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 1051, in compile_wrapper raise e.with_traceback(None) from e.cause # User compiler error torch._dynamo.exc.Unsupported: Attempted to call a super() attribute that is not a function or method Explanation: Dynamo does not know how to trace the call super().unflatten() because super().unflatten is not a function or method attribute. Hint: Ensure the attribute accessed via super() is a standard method or function.

Developer debug context: call_method SuperVariable() unflatten

For more details about this graph break, please visit: https://meta-pytorch.github.io/compile-graph-break-site/gb/gb0006.html

from user code: File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3800, in wrapper_fn return torch.func.hessian(torch.sin)(x) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1401, in wrapper_fn jac_outs_ins = tuple( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1402, in <genexpr> tuple( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1403, in <genexpr> safe_unflatten(jac_out_in, -1, primal.shape) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1247, in safe_unflatten return tensor.unflatten(dim, shape) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/utils/_device.py", line 122, in torch_function return func(*args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 1456, in unflatten return super().unflatten(dim, sizes)

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: python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian

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/dynamo/test_higher_order_ops.py", line 3803, in test_hessian
    wrapped_gm = self._compile_check(wrapper_fn, (x,))
  File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3789, in _compile_check
    expected = torch.compile(fn, backend=backend, fullgraph=fullgraph)(*inputs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 1051, in compile_wrapper
    raise e.with_traceback(None) from e.__cause__  # User compiler error
torch._dynamo.exc.Unsupported: Attempted to call a super() attribute that is not a function or method
  Explanation: Dynamo does not know how to trace the call `super().unflatten()` because `super().unflatten` is not a function or method attribute.
  Hint: Ensure the attribute accessed via `super()` is a standard method or function.

  Developer debug context: call_method SuperVariable() unflatten

 For more details about this graph break, please visit: https://meta-pytorch.github.io/compile-graph-break-site/gb/gb0006.html

from user code:
   File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3800, in wrapper_fn
    return torch.func.hessian(torch.sin)(x)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1401, in wrapper_fn
    jac_outs_ins = tuple(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1402, in <genexpr>
    tuple(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1403, in <genexpr>
    safe_unflatten(jac_out_in, -1, primal.shape)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1247, in safe_unflatten
    return tensor.unflatten(dim, shape)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/utils/_device.py", line 122, in __torch_function__
    return func(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 1456, in unflatten
    return super().unflatten(dim, sizes)

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:
    python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian

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 7 workflow(s) with 14 failures and 7 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_hessian
  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 3803, in test_hessian
    wrapped_gm = self._compile_check(wrapper_fn, (x,))
  File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3789, in _compile_check
    expected = torch.compile(fn, backend=backend, fullgraph=fullgraph)(*inputs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/eval_frame.py", line 1051, in compile_wrapper
    raise e.with_traceback(None) from e.__cause__  # User compiler error
torch._dynamo.exc.Unsupported: Attempted to call a super() attribute that is not a function or method
  Explanation: Dynamo does not know how to trace the call `super().unflatten()` because `super().unflatten` is not a function or method attribute.
  Hint: Ensure the attribute accessed via `super()` is a standard method or function.

  Developer debug context: call_method SuperVariable() unflatten

 For more details about this graph break, please visit: https://meta-pytorch.github.io/compile-graph-break-site/gb/gb0006.html

from user code:
   File "/var/lib/jenkins/workspace/test/dynamo/test_higher_order_ops.py", line 3800, in wrapper_fn
    return torch.func.hessian(torch.sin)(x)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1401, in wrapper_fn
    jac_outs_ins = tuple(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1402, in <genexpr>
    tuple(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1403, in <genexpr>
    safe_unflatten(jac_out_in, -1, primal.shape)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_functorch/eager_transforms.py", line 1247, in safe_unflatten
    return tensor.unflatten(dim, shape)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/utils/_device.py", line 122, in __torch_function__
    return func(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 1456, in unflatten
    return super().unflatten(dim, sizes)

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:
    python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian

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 failure is likely due to an issue with PyTorch's Dynamo compiler, specifically with the unflatten method, and can be investigated by setting TORCHDYNAMO_VERBOSE=1 and examining the internal stack trace.

Guidance

  • Set TORCHDYNAMO_VERBOSE=1 to enable verbose logging and obtain the internal stack trace, which may provide more insight into the issue.
  • Examine the logs for the test_hessian test case, following the provided debugging instructions, to identify any patterns or clues that may indicate the root cause of the failure.
  • Investigate the unflatten method in the PyTorch codebase, specifically the torch/_tensor.py file, to understand how it is being used and why it may be causing issues.
  • Consider running the test locally using the provided command python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian to reproduce the issue and gather more information.

Example

No code example is provided, as the issue is related to a specific PyTorch test case and requires a deeper understanding of the PyTorch codebase.

Notes

The issue appears to be related to a flaky test, which may be caused by a variety of factors, including issues with the test itself, the PyTorch codebase, or the testing environment. Further investigation is needed to determine the root cause of the failure.

Recommendation

Apply workaround by setting TORCHDYNAMO_VERBOSE=1 and examining the internal stack trace to gather more information about the issue, as this may provide valuable insights into the root cause of the failure.

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