Repository navigation
cuda: Module.holds, whether a loaded image defines a device global - #917
Open
plotarmordev wants to merge 1 commit into
Open
plotarmordev wants to merge 1 commit into
plotarmordev wants to merge 1 commit into
Conversation
A marker test: an image can carry a device global that promises something about its kernels, and the host can check for it before relying on the promise. Any driver failure, a missing name included, answers false rather than an error. A test drives it through a fake driver table.
This was referenced Oct 16, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Module.holds(name)reports whether a loaded image defines the device globalname, so the host can check a markerbefore relying on what it promises (part of #914). Any driver failure, a missing name included, answers false
rather than an error.
Drama 3 uses it to launch with programmatic dependent launch only on images that carry its marker.
Receipt
ab7659dae7e6, on mainc7137bb3. No MLX or PyTorch.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: not run. Thechange adds a query that nothing calls yet.
tools/bench_openai.py: n/a. Nothing on the decode path calls it.ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: n/a. Nothing on theprompt path calls it.
CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary allfrom an empty local cache: 27/27 steps, 466 passed, 0 failed, 0 skipped.It drives
holdsthrough a fake driver table for three cases:CUDA_ERROR_NOT_FOUND(false);CUDA_ERROR_INVALID_CONTEXT(false).holdsthat treats only a missing name as false fails the test: 83 passed, 1 failed (that test). Before the change the test doesnot build, because
holdsdoes not exist.zig build native -Dnvcc=/usr/local/cuda/bin/nvcc --summary all: 42/42 steps.python3 tools/zig/lean_check.py: 527 problems, the same as main's 527 (tools/zig/lean_new.py: 0 new).zig fmt --check build.zig zig: clean.tf-cuda-test drama-pdl, arrives with its first caller, Drama 3'sprogrammatic dependent launch.
Checklist
path is touched.)
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Notrun; no output path is touched.)
arithmetic changes.)
The fail-closed case fails on a
holdsthat only treats a missing name as false.)