pytorch - 💡(How to fix) Fix DISABLED test__local_scalar_dense_with_empty_tensor_cuda (__main__.TestTorchDeviceTypeCUDA) [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#181343Fetched 2026-04-24 10:35:46
View on GitHub
Comments
1
Participants
1
Timeline
11
Reactions
0
Participants
Timeline (top)
labeled ×4mentioned ×3subscribed ×3commented ×1

Error Message

Traceback (most recent call last): File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper method(*args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper method(*args, **kwargs) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3513, in wrapper with policy(): File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 2804, in exit self.testcase.before_cuda_memory_leak_check() File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3414, in before_cuda_memory_leak_check torch._dynamo.reset() File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/init.py", line 180, in reset from torch._inductor.cudagraph_trees import reset_cudagraph_trees File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/cudagraph_trees.py", line 69, in <module> from torch._inductor.compile_fx import ( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 112, in <module> from . import config, distributed_autotune, metrics File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/distributed_autotune.py", line 15, in <module> from . import config, select_algorithm File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/select_algorithm.py", line 5864, in <module> from . import lowering # noqa: F401 File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/lowering.py", line 62, in <module> from .decomposition import decompositions, get_decompositions File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/decomposition.py", line 108, in <module> decompositions = {**core_aten_decompositions(), **inductor_decompositions} TypeError: 'CustomDecompTable' object is not a mapping

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/test_torch.py TestTorchDeviceTypeCUDA.test__local_scalar_dense_with_empty_tensor_cuda

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 "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3513, in wrapper
    with policy():
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 2804, in __exit__
    self.testcase.before_cuda_memory_leak_check()
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3414, in before_cuda_memory_leak_check
    torch._dynamo.reset()
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/__init__.py", line 180, in reset
    from torch._inductor.cudagraph_trees import reset_cudagraph_trees
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/cudagraph_trees.py", line 69, in <module>
    from torch._inductor.compile_fx import (
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 112, in <module>
    from . import config, distributed_autotune, metrics
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/distributed_autotune.py", line 15, in <module>
    from . import config, select_algorithm
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/select_algorithm.py", line 5864, in <module>
    from . import lowering  # noqa: F401
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/lowering.py", line 62, in <module>
    from .decomposition import decompositions, get_decompositions
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/decomposition.py", line 108, in <module>
    decompositions = {**core_aten_decompositions(), **inductor_decompositions}
TypeError: 'CustomDecompTable' object is not a mapping

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/test_torch.py TestTorchDeviceTypeCUDA.test__local_scalar_dense_with_empty_tensor_cuda

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 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__local_scalar_dense_with_empty_tensor_cuda
  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 "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3514, in wrapper
    method(*args, **kwargs)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3513, in wrapper
    with policy():
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 2804, in __exit__
    self.testcase.before_cuda_memory_leak_check()
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/testing/_internal/common_utils.py", line 3414, in before_cuda_memory_leak_check
    torch._dynamo.reset()
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_dynamo/__init__.py", line 180, in reset
    from torch._inductor.cudagraph_trees import reset_cudagraph_trees
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/cudagraph_trees.py", line 69, in <module>
    from torch._inductor.compile_fx import (
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/compile_fx.py", line 112, in <module>
    from . import config, distributed_autotune, metrics
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/distributed_autotune.py", line 15, in <module>
    from . import config, select_algorithm
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/select_algorithm.py", line 5864, in <module>
    from . import lowering  # noqa: F401
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/lowering.py", line 62, in <module>
    from .decomposition import decompositions, get_decompositions
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_inductor/decomposition.py", line 108, in <module>
    decompositions = {**core_aten_decompositions(), **inductor_decompositions}
TypeError: 'CustomDecompTable' object is not a mapping

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/test_torch.py TestTorchDeviceTypeCUDA.test__local_scalar_dense_with_empty_tensor_cuda

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

Test file path: test_torch.py

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

cc @mruberry

extent analysis

TL;DR

The test test__local_scalar_dense_with_empty_tensor_cuda is failing due to a TypeError caused by a CustomDecompTable object not being a mapping, and a potential workaround is to investigate and fix the decomposition table initialization.

Guidance

  • Investigate the decomposition.py file to understand how the decompositions dictionary is initialized and why it's expecting a mapping object.
  • Check the CustomDecompTable class to see if it's supposed to be a mapping object and if it's being used correctly.
  • Run the test with the provided command PYTORCH_TEST_CUDA_MEM_LEAK_CHECK=1 PYTORCH_TEST_WITH_SLOW_GRADCHECK=1 python test/test_torch.py TestTorchDeviceTypeCUDA.test__local_scalar_dense_with_empty_tensor_cuda to reproduce the error and gather more information.
  • Review the recent workflow logs and test results to see if there are any patterns or clues that could help identify the root cause.

Example

No code example is provided as the issue is related to a specific PyTorch test and requires more context to provide a accurate solution.

Notes

The issue seems to be related to a specific test case and a custom decomposition table, which might require knowledge of PyTorch's internal workings to fix. The provided stacktrace and error message suggest that the issue is related to a TypeError, but more investigation is needed to determine the root cause.

Recommendation

Apply workaround: Investigate and fix the decomposition table initialization to ensure that it's correctly creating a mapping object. This might involve modifying the decomposition.py file or the CustomDecompTable class.

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__local_scalar_dense_with_empty_tensor_cuda (__main__.TestTorchDeviceTypeCUDA) [1 comments, 1 participants]