Skip to content

[executorch][ci] Split unittest-cuda into kernel and system shards - #24047

Merged
Gasoonjia merged 1 commit into
mainfrom
gasoonjia/split-unittest-cuda
Oct 22, 2026
Merged

Gasoonjia merged 1 commit into
mainfrom
gasoonjia/split-unittest-cuda

Conversation

@Gasoonjia

Copy link
Copy Markdown
Contributor

unittest-cuda has hit its 90 min timeout on every main run since a04a9f9 (#24004). That commit made the SDPA autotune tests about 6.5 min slower (test_triton_sdpa.py went from 10.4 to 16.9 min). The job already took 83–89 min before it, so the extra time pushed it over the limit. Example run: https://github.com/pytorch/executorch/actions/runs/39464763398/job/118773442760

This PR splits the job into a two-shard matrix:

  • unittest-cuda (kernel): Triton kernel and autotune tests. That covers SDPA, split-K SDPA, SDPA NaN, tq4 SDPA, int4 matmul, int5 large GEMM, quantized GEMM family, fused MoE, fused deltanet decode, chunk gated delta rule, topk, autotune inputs and launch params, and the Triton mutation cache. About 42 min of pytest.
  • unittest-cuda (system): everything else under backends/cuda/tests and backends/cuda/passes/tests. That covers the lowering passes (off-graph KV, DFlash off-graph KV, SDPA split-K replacement), quantized op dispatch, and export, partitioner and runtime tests. This shard also runs the pybindings device tests, the C++ shim tests, and the Qwen 3.5 MoE and Gemma 4 31B model tests. About 28 min of pytest.

Kernel tests are listed explicitly in KERNEL_TESTS. The system shard runs the test directories and passes --ignore for the kernel files and for the quantized GEMM files that unittest-cuda-quantized-gemm already runs, so any new test file goes to the system shard by default. Both shards still do the full install and build, including executor_runner, because both have e2e tests that need it. Both pytest calls now pass --durations=20.

Test plan:

  • Checked that the YAML parses, that every listed test file exists, and that the kernel shard (14 files), system shard (19), and quantized GEMM job (7) together cover all 40 backends/cuda/tests/test_*.py files with no overlap.
  • Ran bash -n on the script for each shard.
  • python -m unittest .ci/scripts/tests/test_muse_glimmer_batching_ci.py passes. That test parses cuda.yml.
  • CI on this PR: both unittest-cuda shards should finish well under 90 min.

@pytorch-bot

pytorch-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24047

Note: Links to docs will display an error until the docs builds have been completed.

⏳ 8 Pending, 1 Unrelated Failure

As of commit f800e4b with merge base 6368414 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Gasoonjia / name: gasoonjia (491e1ca)

@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Gasoonjia
Gasoonjia added this pull request to stack #24077 October 22, 2026 07:28
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results October 22, 2026 12:06 — with GitHub Actions Active
unittest-cuda has timed out at 90 min on every main run since a04a9f9
made the SDPA autotune tests ~6.5 min slower; the job was already at
83-89 min before that.

Split it into a matrix:
- kernel: Triton kernel and autotune tests (SDPA, tq4 SDPA, int4 matmul,
  int5 large GEMM, fused MoE, deltanet, topk, autotune inputs/launch
  params, mutation cache). ~42 min of pytest.
- system: everything else under backends/cuda/tests and passes/tests
  (lowering passes, op dispatch, export/partitioner/runtime), plus the
  pybindings device tests, C++ shim tests, and Qwen 3.5 MoE / Gemma 4 31B
  model tests. ~28 min of pytest.

The system shard runs the test directories with the kernel and quantized
GEMM files ignored, so new tests default to it.

Test plan: CI on this PR; both unittest-cuda shards should finish well
under the 90 min timeout.
@Gasoonjia
Gasoonjia merged commit 82fbe45 into main Oct 22, 2026
254 of 256 checks passed
@Gasoonjia
Gasoonjia deleted the gasoonjia/split-unittest-cuda branch October 22, 2026 21:07
Gasoonjia added a commit that referenced this pull request Oct 22, 2026
Stacked on #24047.

`CudaDFlashNative.FinalWholeBlockFitsExactlyAndPreservesAllPrefillRows`
has failed in `unittest-cuda-muse-glimmer-batching` since #24043. It
failed on that PR's own CI and on `main` at 8d9eec3:

```
cuda_dflash_native_test.cpp:612: Failure
Expected: (drained.draft_forwards - drain.draft_forwards) > (drained.static_draft_forwards - drain.static_draft_forwards), actual: 1 vs 1
```

The test expected the decode at position 78 to drain the 79 hidden rows
through the dynamic draft before running the static draft. But
`run_target` drains every owner it touches right after it appends hidden
rows (added in #24042). So the 78-row prefill already drains down to the
fresh context (32 in this fixture). The decode then holds at most one
block (16) of rows and runs a single static draft. The dynamic forwards
happen during the prefill, before the stats snapshot the test took.

This is a bug in the test's measurement window, not in the executor. The
fix takes the first snapshot before the prefill and checks two things:
- the prefill runs only dynamic draft forwards (at least one);
- the decode runs exactly one draft forward, and it is static.

Test plan:
- `clang-format` is clean on the changed lines.
- No local GPU, so the test relies on CI:
`unittest-cuda-muse-glimmer-batching` on this PR should pass.
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results October 23, 2026 00:30 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
upload-benchmark-results — f800e4be Deployed Oct 23, 2026 by Gasoonjia via upload-benchmark-results #21211
cadence — f800e4be Deployed Oct 22, 2026 by Gasoonjia via hifi5s-op-test / hifi5s #34378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants