Repository navigation
test(cuda): opt-in --jobs and --shard for kernel-contract - #3093
BlivionIaG wants to merge 6 commits into
Conversation
|
Thanks for this. It's a careful change, and the default path is untouched. We read it closely and found no way for a sharded run to report green when a serial run wouldn't. A crashed, killed or silent shard, an exit its counts don't explain, and a list run more or less than once all fail the merged run. Per-kernel seeds come from kernel names, so shards test the same inputs as a serial run. On our side A few asks before we run it on hardware:
On overlaps: #2620 adds a standalone suite to Once these are in and your numbers are posted, we'll run serial against
|
9486f3d to
210d696
Compare
|
Thanks. Pushed
The full unfiltered |
|
Full unfiltered
The body is updated; it no longer says this revision is unmeasured. |
|
Thanks, this is careful work and the full run answers the memory questions the plan raised. The child peaks, the straggler shard and the merged counts all read as they should, and the safety shape is right: a shard that crashes, stays silent or runs twice fails the merge, and the children do not outlive their parent. Two things before it leaves draft. The description's speedup still leans on a serial figure from an older head, so one serial run of the unfiltered suite on this head would put the pair of numbers on the same code. And whenever the two overlapping pull requests settle, the one landing second adds its suite to the served list, as you noted. The test runner's main file also lands one line over our 600-line cap; that one is ours, and we will trim it in a commit of our own on top. Once those are in we will run serial against jobs on our own hardware with the same binary and compare the per-gate lines, the merged counts and the wall time.
|
|
Thanks again @BlivionIaG. One update since our last note: main now runs a new standalone suite, the Qwen shared-prefix check (
|
|
Merged current main ( On this head: Not done: the serial unfiltered run on this head. It needs the two-GPU machine, and I have not run it, so no serial figure is posted yet. The |
|
Serial run of the unfiltered suite on this head, same binary as the
That is 2.76 times faster on the same head. Both exit 1 only because of the 577 limit problems. The two logs agree line for line once the time figures, each child's closing lines and one planted control's first differing byte are set aside. Serial spent 9938 s in the gates and 1940 s in the limit checks; with On the 28 GiB plan: the one-process serial run peaked at 34.0 GiB, above it, while the largest of the four children peaked at 17.2 GiB. I did not run |
|
Thanks @BlivionIaG. The same-head serial/ Current main has since added the standalone After the rebase we run the same-binary serial/jobs comparison on a GB10, as agreed. Nothing further is needed from you.
|
08c72fd to
f308d53
Compare
|
Thank you @BlivionIaG. The same-head serial/jobs pair closes the measurement ask. Parent cleanup, the GPU checks and both requested suite entries are retained. The current-main comparison remains, including one-worker memory: the older serial peak was 34 GiB against the 28 GiB planning allowance, and four-worker peaks do not cover that case. The posted resource failures remain failures in both runs. No further code change is requested from this source review.
|
bb556f4 to
eb45906
Compare
|
Current-main comparison on a GB10 (
Serial and one-worker outcomes are identical, including the failures, which remain failures in both runs. The one-worker peak is 48.72 GiB, so it is above the 28 GiB per-process planning allowance (the 34 GiB serial peak from the earlier sm_120 run did not reproduce on this machine). On this unified-memory GB10 four workers at 28 GiB host plus 7 GiB GPU do not fit, so the runner refuses |
Shards split kernels, standalone suites and launch records; the parent merges each child's TALLY line into one SUMMARY.
- Align the Qwen3.5 ModelOpt host gate with the dependency already present on upstream main. - Preserve CUDA kernels, runner behavior and prior source-pinned performance receipts. - Verify test-qwen35-modelopt-admission-host: 172/172 tests pass on native arm64.
- Append the existing entry within Unreleased so new upstream release notes can merge independently. - Documentation only; runtime checks remain pinned to the preceding upstream merge.
--jobs and --parent start or follow child processes, whose pids are integers on POSIX and handles on Windows, so tf-cuda-test stopped compiling for x86_64-windows. Those paths now compile on POSIX targets only; elsewhere --jobs and --parent are refused by name. --shard alone runs in-process on every target, and Linux behaviour is unchanged.
efd6b3b to
a627c2d
Compare
|
The clean trial merge of The posted GB10 results leave a gap between one worker and the four-worker refusal. The current preflight admits three full workers at the reported 114 GiB available, because it plans 105 GiB for them. I checked that directly with Igor Lessio - AIFLOW LABS |
|
Thanks, the fixture is right: the plan admits three full workers at 114 GiB (3 x (28 + 7) = 105 GiB) and refuses four (140 GiB). That is the intended boundary, and |
|
Thanks @BlivionIaG. The new test correctly pins the three-worker admission boundary. The reported serial/one-worker comparison also preserves the failures and limit counts, which is useful evidence. The remaining gap is actual memory and coverage with two and three workers. The 48.72 GiB one-worker peak exceeds the estimate, but multiplying it by three would not measure three disjoint shards. Before landing, please retain simultaneous parent/child memory peaks, available memory, all suite and record results, and exit status for those runs. The four-worker refusal is a separate result.
|
- Retain the format and native-foundation provenance and the original FlashAlign clarification. - Preserve main changelog spacing so the independent ashhart#3093 insertion merges cleanly.
What this changes
tf-cuda-test kernel-contractruns serially, and a full run takes hours. This adds two opt-in ways to run it faster:--jobs Nruns the gates in N child processes and prints one mergedSUMMARY, and--shard K/Nruns one slice of them. The default run and the existing name filter are unchanged; the filter and--jobsare separate switches and compose (filter first, then shard).main; the first revision was on6c5cef8941. The current head mergesmain9fa8863b; its only manual conflict wasCHANGELOG.md, where both entries were kept.atc overlap --json: against main, incomplete (API limits: my pull requests, other pull requests, files, time). Textual conflicts with two open pull requests, neither agreed: qwen3_5 cuda: the GDN kernels read the state, its rollback copy and the log through a stream's state table (#2444 P3) #2620 inzig/tests/cuda/contract_after.zig, and CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 inzig/tests/cuda/contract_limits.zig. Both are registration-sized hunks; the one landing second adds its entry, as the maintainers noted.Current head and qualification boundary
36c7900786fe929f40fe63b24e9743f431183158, one test commit ona627c2da22(which mergesmain9fa8863binto the branch); the change's own diff is the same 17 files as ata737a296, and this head adds main's newer commits plus oneCHANGELOG.mdline. The preceding maintainer rebase (f308d53d) is what putprompt-swigluintoservedright afterfn-lanesand moved the usage edit tomain_usage.zig.python3 tools/pr_check.py --base 3942d6865c --pr 3093reports 0 errors, 0 warnings; lean is 165 on both base and head, 0 new. The former 601-linemain.zigfinding is gone with main's split.zig fmt --check build.zig zigandgit diff --checkare clean, andzig build test-contract-shard-host -Dcpu=apple_m1 -j4exits 0 on this head (that step runs both host test files; the Linux-only parent-death test skips here). The Linux x86_64/aarch64compile-cuda-testscross-compiles were run on08c72fd4c0; this head adds main's newer commits and oneCHANGELOG.mdline.fmt,zig,zig-b,zig-windows,zig-macos-dev-tools,benchmark-clients(Ubuntu and Windows),pytest,release-pathsandcomfyui-moss-installerpassed ona737a296, the previous head with the same runner content; the new head's run was queued behind the shared runner backlog when this description was written, so it is not claimed green until it finishes (checks).08c72fd4c06087cfdeedf60f56fbb3fa64818133below. They were not rerun or relabelled as current-head measurements. The main merges bring upstream changes; old timings do not qualify those new kernels or imply a fully green kernel contract.Earlier checks, source-pinned
08c72fd4c06087cfdeedf60f56fbb3fa64818133, the merge of main with theqwen-shared-prefixsuite added toserved(a one-argument wrapper passes&.{}). The unfiltered serial and--jobs 4runs below were taken on this head; the filtered rows and the earlier--jobs 4receipt come from210d696b7band before, and the merge adds that one suite and no other change to the runner.08c72fd4c0:zig fmt --checkclean;zig build test-contract-shard-hostexit 0;zig build compile-cuda-testsfor Linux x86_64 and aarch64: exit 0.python3 tools/pr_check.py --base 038e4a27872ereported one error then,zig/tests/cuda/main.zigat 601 lines (lean 222 against 221 on main); main's split has since removed that file's overage, and the current head reports 0 errors and 0 warnings.210d696b7b:python3 tools/pr_check.py --base 6c5cef8941b27d86b06a986834e13deb9b515e1eexit 0, 0 errors; lean 345 vs 345 on main, 0 new.zig build test-contract-shard-host, 17 of 17 shard tests pass, plus 2 pass and 1 skip for the process tests, no GPU (the Linux-only parent-death test ran in a Linux VM) (partition covers each index once; filter then shard keeps each named kernel once; merged tallies equal the serial tally; tally lines round-trip and malformed ones are refused; merging refuses a missing, repeated or double-run shard; a crashed or silent shard fails the merge; memory, integrated-GPU, mixed-GPU and argument refusals, each naming the value).Receipt
Main against branch: n/a for inference. The runner change was measured by running the same command serially and with
--jobs 2on one machine.Boxes it reaches: the CUDA kernel-contract runner only.
New switch?
--jobs Nand--shard K/N [--device D]on the runner command line, off by default;--helpprints both with the per-process memory plan. No environment variable.Environment: Zig 0.17.0, nvcc 13.4, two 16 GB sm_120 GPUs, 64 threads, about 125 GiB free host memory. The filtered serial and
--jobs 2rows below come from an earlier revision of this change (same sharding and merge logic; it still printed timing lines, since removed) merged onto a Flash Next EXL3 branch; the unfiltered runs are in the next two bullets.Paths and platforms the change reaches: the Linux CUDA runner. Which I ran: the two commands below. Which I could not: other chips.
Exactness: the merged
SUMMARYcounts equal the serial run's. Same commands, same binary, filtered toexl3 flashnext:--jobs 2The limit problems are pre-existing and equal in both runs. The gates time is the slowest shard's (494 s serial, 276 s with two shards).
Full unfiltered serial and
--jobs 4runs on this exact head (08c72fd4c0, built with nvcc 13.4 for sm_120:zig build compile-cuda-tests -Dfixed-cpu -Dnvcc=... -Dsm=120 -Doptimize=fast -Dstrip=true), the same binary, one run each, one after the other, two 16 GB sm_120 GPUs, 64 threads, about 155 GiB of host memory available at each start, each under/usr/bin/time -vwith a 1 s sampler (/procandnvidia-smi):Current-main comparison on a GB10 (
sm_121), same binary, full unfiltered runs (headefd6b3b4fb's tree plus main):--jobs 4is refused there (HostMemory: 4 x (28 GiB host + 7 GiB GPU) > 114 GiB available). Serial and--jobs 1both exit 1 with identical SUMMARY counts: 831 kernels, 829 pass gates 1-4, 2 fail, 12 known findings; 520 controls, 520 red, 0 missed; 288 limit problems. Wall: 1:36:21 serial, 1:35:15 one worker. Peak host RSS: 48.72 GiB for both, above the 28 GiB per-process planning allowance.nvidia-smireports N/A for GPU memory on the GB10, so host RSS is the memory figure.At 114 GiB available the plan admits three full workers (3 x (28 + 7) = 105 GiB) and refuses four (140); the host suite pins this boundary (three admitted and four refused at 114 GiB; three admitted at 105 GiB, refused at 104). The three-worker peak on the GB10 is not measured, and GPU memory there reads N/A in
nvidia-smi.tf-cuda-test kernel-contract643 kernels: 643 pass gates 1-4, 0 fail, 8 known findings; 418 controls: 418 red as planted, 0 missed; 577 limit problemstf-cuda-test kernel-contract --jobs 4FAIL kernel-contractlines andINFOline each child prints, and one planted control's first differing byte (4 serial, 0--jobs) are set aside. Lowest host MemAvailable: 120.7 GiB serial, 128.5 GiB--jobs 4.--jobs 4: shard 0 is again the straggler, gates 2418 s plus limits 1892 s, ending at about 4309 s; the slowest on gates was shard 3 at 2651 s.--jobs 4child was 17.2 GiB. I did not run--jobs 1or--jobs 2unfiltered.Earlier full unfiltered run with
--jobs 4on210d696b7bbd(the head before the merge of main, whose parent is the earlier main; the change touches no kernel), two 16 GB sm_120 GPUs, 125 GiB or more of free host memory, one run: wall 1:02:36 (/usr/bin/time -v),SUMMARY 625 kernels: 625 pass gates 1-4, 0 fail, 8 known findings; 410 controls: 410 red as planted, 0 missed; 546 limit problems. The runner exits 1 because of the limit problems, as the serial run does. I did not run main separately; the limit problems come from the kernels and limits main registers, not from this change./procandnvidia-smi): shard 0/4 17.2 GiB peak RSS, 1956 MiB peak GPU; 1/4 6.6 GiB, 5650 MiB; 2/4 8.5 GiB, 5648 MiB; 3/4 13.9 GiB, 2164 MiB. All children summed at one instant: peak 24.0 GiB; lowest host MemAvailable 126.2 GiB. Each GPU's device memory peaked at about 5.8 GiB of 16.--jobsfigure is the pair on08c72fd4c0above; the 3.2 h serial run on an older head (632 / 421 / 564there) is superseded by it.Decode speed, prompt speed: n/a, the change cannot reach inference.
Licence of any new weights or drafter: n/a.
Checklist
9486f3d0(14 of 14) and it passes on this branch.