[GH-ISSUE #1758] [Feature]: fail the test build when a release-engine CUDA kernel spills registers or uses local memory (per sm_) #700

Closed
opened 2026-11-04 01:45:11 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Avicennasis on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1758

What do you want to do?

A build-time check that fails STRATA_BUILD_TESTS when a CUDA kernel in the release engine spills registers to local memory or uses local memory at all, per architecture in CMAKE_CUDA_ARCHITECTURES.

Why. Strata now carries per-architecture kernel tables and recently found two defects that were compiler-output facts rather than source facts: #1522 (gdn_l2_kernel compiles without the fma the fused kernel spells out on CUDA 13.3 / sm_120) and #1469 (Pascal decode regression). A register spill is the same kind of fact: it shows up in ptxas -v output and nowhere in the source, it varies by toolkit and sm_, and it costs decode throughput silently. Today nothing in the tree reads that output (git grep -i 'ptxas\|spill\|resource-usage' on fb58e0d finds only the SYCL docs and the conversation-cache "spilled" event).

Shape. Build the kernel translation units with -Xptxas -v (or --resource-usage) in the test configuration, capture the per-kernel lines, and fail when spill stores/spill loads is non-zero or lmem is non-zero for a kernel on an allow-list of the hot decode/prefill kernels (tests/cuda/ already names the prefill fused IQ/MoE/MMQ kernels). A kernel that legitimately needs local memory gets an entry in a short exceptions table with the number it is allowed, so a change that adds a spill is a red test with the kernel's name, the sm_, and the two numbers in the message. This is how DeepGEMM gates its kernels (DG_JIT_CHECK_NO_SPILLS / DG_JIT_CHECK_NO_LOCAL_MEMORY, asserted in its sanitizer run), and it needs no GPU at test time: the numbers come from the compiler, so it runs wherever the engine is built.

What I have not measured. I have not run ptxas -v over Strata's kernels, so I am not reporting that any kernel spills today; this asks for the gate, not a fix. If you want it, I can send a PR that adds the capture and the allow-list with the numbers from an sm_86 and an sm_120 build, so the first run documents the current state rather than failing on it. Where in the tree the capture should live (a CMake option next to STRATA_BUILD_TESTS, or a tools/ script over the build log) is your call.

Originally created by @Avicennasis on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1758 ### What do you want to do? A build-time check that fails `STRATA_BUILD_TESTS` when a CUDA kernel in the release engine spills registers to local memory or uses local memory at all, per architecture in `CMAKE_CUDA_ARCHITECTURES`. **Why.** Strata now carries per-architecture kernel tables and recently found two defects that were compiler-output facts rather than source facts: #1522 (`gdn_l2_kernel` compiles without the fma the fused kernel spells out on CUDA 13.3 / sm_120) and #1469 (Pascal decode regression). A register spill is the same kind of fact: it shows up in `ptxas -v` output and nowhere in the source, it varies by toolkit and `sm_`, and it costs decode throughput silently. Today nothing in the tree reads that output (`git grep -i 'ptxas\|spill\|resource-usage'` on `fb58e0d` finds only the SYCL docs and the conversation-cache "spilled" event). **Shape.** Build the kernel translation units with `-Xptxas -v` (or `--resource-usage`) in the test configuration, capture the per-kernel lines, and fail when `spill stores`/`spill loads` is non-zero or `lmem` is non-zero for a kernel on an allow-list of the hot decode/prefill kernels (`tests/cuda/` already names the prefill fused IQ/MoE/MMQ kernels). A kernel that legitimately needs local memory gets an entry in a short exceptions table with the number it is allowed, so a change that adds a spill is a red test with the kernel's name, the `sm_`, and the two numbers in the message. This is how DeepGEMM gates its kernels (`DG_JIT_CHECK_NO_SPILLS` / `DG_JIT_CHECK_NO_LOCAL_MEMORY`, asserted in its sanitizer run), and it needs no GPU at test time: the numbers come from the compiler, so it runs wherever the engine is built. **What I have not measured.** I have not run `ptxas -v` over Strata's kernels, so I am not reporting that any kernel spills today; this asks for the gate, not a fix. If you want it, I can send a PR that adds the capture and the allow-list with the numbers from an sm_86 and an sm_120 build, so the first run documents the current state rather than failing on it. Where in the tree the capture should live (a CMake option next to `STRATA_BUILD_TESTS`, or a `tools/` script over the build log) is your call.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156201961 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#700
No description provided.