pytorch - 💡(How to fix) Fix DISABLED test_hessian_argnums (__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 3929, in test_hessian_argnums wrapped_gm = self._compile_check(wrapper_fn, (x, y)) 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 3925, in wrapper_fn return torch.func.hessian(fn, argnums=(1,))(x, y) 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: PYTORCH_TEST_CUDA_MEM_LEAK_CHECK=1 PYTORCH_TEST_WITH_SLOW_GRADCHECK=1 python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian_argnums

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 3929, in test_hessian_argnums
    wrapped_gm = self._compile_check(wrapper_fn, (x, y))
  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 3925, in wrapper_fn
    return torch.func.hessian(fn, argnums=(1,))(x, y)
  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:
    PYTORCH_TEST_CUDA_MEM_LEAK_CHECK=1 PYTORCH_TEST_WITH_SLOW_GRADCHECK=1 python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian_argnums

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 15 workflow(s) with 30 failures and 15 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_argnums
  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 3929, in test_hessian_argnums
    wrapped_gm = self._compile_check(wrapper_fn, (x, y))
  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 3925, in wrapper_fn
    return torch.func.hessian(fn, argnums=(1,))(x, y)
  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:
    PYTORCH_TEST_CUDA_MEM_LEAK_CHECK=1 PYTORCH_TEST_WITH_SLOW_GRADCHECK=1 python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian_argnums

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_hessian_argnums is failing due to an unsupported operation in Dynamo, and setting TORCHDYNAMO_VERBOSE=1 may provide more insight into the issue.

Guidance

  • The error message indicates that Dynamo does not know how to trace the call super().unflatten() because super().unflatten is not a function or method attribute. This suggests that the issue may be related to the implementation of the unflatten method.
  • To debug the issue, set TORCHDYNAMO_VERBOSE=1 to get the internal stack trace, and consider setting TORCH_LOGS="+dynamo" for more developer context.
  • The test can be executed manually by running PYTORCH_TEST_CUDA_MEM_LEAK_CHECK=1 PYTORCH_TEST_WITH_SLOW_GRADCHECK=1 python test/dynamo/test_higher_order_ops.py FuncTorchHigherOrderOpTestsWithCompiledAutograd.test_hessian_argnums from the base repo dir.
  • Reviewing the logs and the implementation of the unflatten method may provide more insight into the issue.

Example

No code snippet is provided as the issue is related to a specific implementation detail that is not clearly described in the issue.

Notes

The issue may be related to a limitation or bug in Dynamo, and setting the verbose mode may provide more information about the issue. However, without more context or information about the implementation, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Set TORCHDYNAMO_VERBOSE=1 and review the logs to gain more insight into the issue, as this may provide more information about the unsupported operation and help identify a potential solution.

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