pytorch - 💡(How to fix) Fix DISABLED test_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False (__main__.NoMixOrderReductionTest) [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#176971Fetched 2026-04-08 00:23:29
View on GitHub
Comments
2
Participants
1
Timeline
43
Reactions
0
Participants
Timeline (top)
mentioned ×18subscribed ×18labeled ×5commented ×2

Error Message

Traceback (most recent call last): File "/var/lib/jenkins/workspace/test/inductor/test_mix_order_reduction.py", line 363, in test_rms_norm_bwd ref = fwd_bwd(f) File "/var/lib/jenkins/workspace/test/inductor/test_mix_order_reduction.py", line 332, in fwd_bwd out.backward(dy) File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 631, in backward torch.autograd.backward( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/init.py", line 379, in backward _engine_run_backward( File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/graph.py", line 877, in _engine_run_backward return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 124.00 MiB. GPU 0 has a total capacity of 22.03 GiB of which 13.77 GiB is free. Process 9284 has 186.00 MiB memory in use. Process 9343 has 596.00 MiB memory in use. Process 18017 has 186.00 MiB memory in use. Process 18051 has 528.00 MiB memory in use. Process 18638 has 186.00 MiB memory in use. Including non-PyTorch memory, this process has 6.59 GiB memory in use. 6.39 GiB allowed; Of the allocated memory 6.22 GiB is allocated by PyTorch, and 138.28 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://docs.pytorch.org/docs/stable/notes/cuda.html#optimizing-memory-usage-with-pytorch-cuda-alloc-conf)

To execute this test, run the following from the base repo dir: python test/inductor/test_mix_order_reduction.py NoMixOrderReductionTest.test_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False

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/inductor/test_mix_order_reduction.py", line 363, in test_rms_norm_bwd
    ref = fwd_bwd(f)
  File "/var/lib/jenkins/workspace/test/inductor/test_mix_order_reduction.py", line 332, in fwd_bwd
    out.backward(dy)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 631, in backward
    torch.autograd.backward(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/__init__.py", line 379, in backward
    _engine_run_backward(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/graph.py", line 877, in _engine_run_backward
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 124.00 MiB. GPU 0 has a total capacity of 22.03 GiB of which 13.77 GiB is free. Process 9284 has 186.00 MiB memory in use. Process 9343 has 596.00 MiB memory in use. Process 18017 has 186.00 MiB memory in use. Process 18051 has 528.00 MiB memory in use. Process 18638 has 186.00 MiB memory in use. Including non-PyTorch memory, this process has 6.59 GiB memory in use. 6.39 GiB allowed; Of the allocated memory 6.22 GiB is allocated by PyTorch, and 138.28 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation.  See documentation for Memory Management  (https://docs.pytorch.org/docs/stable/notes/cuda.html#optimizing-memory-usage-with-pytorch-cuda-alloc-conf)

To execute this test, run the following from the base repo dir:
    python test/inductor/test_mix_order_reduction.py NoMixOrderReductionTest.test_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False

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

Platforms: 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 16 workflow(s) with 32 failures and 16 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_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False
  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/inductor/test_mix_order_reduction.py", line 363, in test_rms_norm_bwd
    ref = fwd_bwd(f)
  File "/var/lib/jenkins/workspace/test/inductor/test_mix_order_reduction.py", line 332, in fwd_bwd
    out.backward(dy)
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/_tensor.py", line 631, in backward
    torch.autograd.backward(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/__init__.py", line 379, in backward
    _engine_run_backward(
  File "/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torch/autograd/graph.py", line 877, in _engine_run_backward
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 124.00 MiB. GPU 0 has a total capacity of 22.03 GiB of which 13.77 GiB is free. Process 9284 has 186.00 MiB memory in use. Process 9343 has 596.00 MiB memory in use. Process 18017 has 186.00 MiB memory in use. Process 18051 has 528.00 MiB memory in use. Process 18638 has 186.00 MiB memory in use. Including non-PyTorch memory, this process has 6.59 GiB memory in use. 6.39 GiB allowed; Of the allocated memory 6.22 GiB is allocated by PyTorch, and 138.28 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation.  See documentation for Memory Management  (https://docs.pytorch.org/docs/stable/notes/cuda.html#optimizing-memory-usage-with-pytorch-cuda-alloc-conf)

To execute this test, run the following from the base repo dir:
    python test/inductor/test_mix_order_reduction.py NoMixOrderReductionTest.test_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False

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

Test file path: inductor/test_mix_order_reduction.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

Fix Plan

Increase GPU Memory Allocation

To fix the CUDA out of memory error, we need to increase the GPU memory allocation.

Step 1: Update PYTORCH_CUDA_ALLOC_CONF Environment Variable

Update the PYTORCH_CUDA_ALLOC_CONF environment variable to expandable_segments:True to avoid memory fragmentation.

export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

Step 2: Increase GPU Memory Allocation

Increase the GPU memory allocation by setting the CUDA_VISIBLE_DEVICES environment variable to a specific GPU device with more memory.

export CUDA_VISIBLE_DEVICES=0

Step 3: Update Test Code

Update the test code to use a smaller batch size or reduce the number of iterations to reduce memory usage.

import torch

# Reduce batch size
batch_size = 32
# Reduce number of iterations
num_iterations = 10

Step 4: Run Test with Updated Configuration

Run the test with the updated configuration.

python test/inductor/test_mix_order_reduction.py NoMixOrderReductionTest.test_rms_norm_bwd_bfloat16_split_reductions_False_shape0_max_autotune_False_initial_xblock_1_add_1dim_False

Verification

Verify that the fix worked by checking the test output and GPU memory usage.

  • Check the test output for any errors or warnings.
  • Use nvidia-smi to check the GPU memory usage.
nvidia-smi

Extra Tips

  • Monitor GPU memory usage and adjust the configuration as needed.
  • Consider using a larger GPU device or a distributed training setup to reduce memory usage.
  • Refer to the PyTorch documentation for more information on memory management and optimization.

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