Skip to content

Commit b8cee09

Browse files
committed
Skip the bfloat16 GPT tests on Windows
Six tests intermittently kill their xdist worker on windows-latest: Windows fatal exception: code 0xc000001d [gw1] node down: Not properly terminated Always the same six, on about half the runs, on released and nightly torch alike. The branch has also passed with the same torch on other runs, so this follows the machine the job lands on rather than anything in the tree. The fault is in eager torch, not in our code. For test_litgpt the innermost frames are torch's Linear.forward, reached from the plain reference call before the jitted function is ever invoked; the interpreter variants fault in the same place through the opaque-call path. What separates these six from the tests that pass is bfloat16: test_litgpt_variants builds the same gpt-neox-like model in float32 and passes in the same runs that crash test_litgpt. The previous attempt set ATEN_CPU_CAPABILITY=default on Windows, on the theory that the wheels carry AVX-512 instructions inside kernels compiled for the AVX2 target. A diagnostic step confirmed the capability applied and all six still crashed, so the fault is not in ATen's ISA-dispatched kernels. That does not clear the wider codegen issue in pytorch/pytorch#145702: bfloat16 matmuls go to oneDNN or MKL, which pick their own instruction set and ignore that variable. Those paths are untested, so the workflow change is reverted rather than extended. Skip the six on Windows until this is understood. Nothing in process can retry them: the worker dies outright and pytest only sees a dead channel, so rerunfailures and xfail both have nothing to act on.
1 parent 4f5a4b9 commit b8cee09

4 files changed

Lines changed: 11 additions & 18 deletions

File tree

.github/workflows/ci-testing.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@ jobs:
4545
# Timeout: https://stackoverflow.com/a/59076067/4521646
4646
timeout-minutes: 35
4747

48-
env:
49-
# torch's Windows CPU wheels carry AVX-512 instructions inside kernels compiled for the
50-
# AVX2 target, so on a runner whose CPU stops at AVX2 they fault with
51-
# STATUS_ILLEGAL_INSTRUCTION (0xc000001d) and take the xdist worker down with them. The
52-
# reported fault sits in the bfloat16 vector helpers, which is why the nanogpt and litgpt
53-
# tests are the ones that crash: they are the only ones here running a model in bfloat16.
54-
# Fall back to the unvectorized kernels on Windows until this is fixed upstream.
55-
# Ref: https://github.com/pytorch/pytorch/issues/145702
56-
ATEN_CPU_CAPABILITY: ${{ startsWith(matrix.os, 'windows') && 'default' || '' }}
57-
5848
steps:
5949
- uses: actions/checkout@v5
6050
- name: Set up Python ${{ matrix.python-version }}
@@ -111,12 +101,6 @@ jobs:
111101
--extra-index-url=${TORCH_URL}
112102
pip list
113103
114-
- name: Show CPU dispatch
115-
# So a green Windows run can be told apart from a run that happened to land on a CPU
116-
# the bad kernels do not fault on. Expect DEFAULT here, not AVX2.
117-
if: runner.os == 'Windows'
118-
run: python -c "import torch; print('cpu capability:', torch.backends.cpu.get_cpu_capability())"
119-
120104
- name: Testing Local
121105
if: matrix.suite == 'core'
122106
run: |

thunder/tests/framework.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class NOTHING:
5858
)
5959
IS_WINDOWS = platform.system() == "Windows"
6060

61+
# NOTE Running these models in bfloat16 on CPU intermittently kills the process on Windows with an
62+
# illegal instruction, inside eager torch rather than anything of ours. The fp32 variants of the
63+
# same models still run there, and these still run on Linux and macOS.
64+
WINDOWS_GPT_CRASH_REASON = "bfloat16 CPU model intermittently crashes the process on Windows (0xc000001d)"
65+
6166

6267
def _bitsandbytes_available():
6368
if not package_available("bitsandbytes"):

thunder/tests/test_interpreter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212
import torch
1313
from torch.testing import assert_close
14-
from thunder.tests.framework import IS_WINDOWS
14+
from thunder.tests.framework import IS_WINDOWS, WINDOWS_GPT_CRASH_REASON
1515

1616
import thunder
1717
from thunder.core.interpreter import (
@@ -3413,6 +3413,7 @@ def test_nanogpt_block(jit):
34133413
assert_close(result, fn(*args, **kwargs))
34143414

34153415

3416+
@pytest.mark.skipif(IS_WINDOWS, reason=WINDOWS_GPT_CRASH_REASON)
34163417
def test_nanogpt(jit):
34173418
from thunder.benchmarks import NanoGPTBenchmark, NanoGPTConfig, _nanogpt_configs
34183419

@@ -3428,6 +3429,7 @@ def test_nanogpt(jit):
34283429
assert_close(result, fn(*args, **kwargs))
34293430

34303431

3432+
@pytest.mark.skipif(IS_WINDOWS, reason=WINDOWS_GPT_CRASH_REASON)
34313433
def test_litgpt(jit):
34323434
from thunder.benchmarks import LitGPTBenchmark
34333435
from thunder.tests.litgpt_model import Config

thunder/tests/test_jit_general.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import thunder
1616

17-
from thunder.tests.framework import requiresCUDA, IS_WINDOWS
17+
from thunder.tests.framework import requiresCUDA, IS_WINDOWS, WINDOWS_GPT_CRASH_REASON
1818
from thunder.core.options import CACHE_OPTIONS
1919
import thunder.core.prims as prims
2020
from thunder import pytorch_executor, nvfuser_executor
@@ -585,6 +585,7 @@ def h(d, c):
585585
assert args_names == ("a", "b", "c", "d")
586586

587587

588+
@pytest.mark.skipif(IS_WINDOWS, reason=WINDOWS_GPT_CRASH_REASON)
588589
def test_litgpt():
589590
from thunder.benchmarks import LitGPTBenchmark
590591
from thunder.tests.litgpt_model import Config
@@ -665,6 +666,7 @@ def test_nanogpt_mlp():
665666
assert_close(result, module(*args, **kwargs))
666667

667668

669+
@pytest.mark.skipif(IS_WINDOWS, reason=WINDOWS_GPT_CRASH_REASON)
668670
def test_nanogpt():
669671
from thunder.benchmarks import NanoGPTBenchmark, NanoGPTConfig, _nanogpt_configs
670672

0 commit comments

Comments
 (0)