Repository navigation
device-tests: a lane-passing convention probe (#27) - #36
Merged
Merged
Conversation
Six codegen probes, three lane conventions at two widths, so `regcount` can price what issue #27 asks about: whether a coordinate-dependent op should take `lane: u32` or read `warp::lane_id()` itself. The probe leans on every lane-taking op in one loop body — a `coordinate`-addressed load, a `RegVec::row` vector into `sub_row`, a `ColVec::column` vector into `add_col`, a second `coordinate` pass for a causal mask, and a `store_fragment` per `[16, 16]` block — which is where hoisting the lane would compound if it compounds anywhere. It does not. `PER_OP` and `PER_QUERY` agree on registers, spills, stack and instruction count at both widths, and the emitted PTX carries exactly one `%laneid` move in all six kernels: the reads CSE. The measured numbers are in the probe's doc comment.
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.
Adds a permanent lane-convention codegen probe to
device-tests, and the measurement issue #27 asked for. Measurement only — this does not do the sweep, so it does not close #27.Six kernels, three conventions at two widths, launched by nothing and checking nothing (same discipline as
softmax_probe). The probe leans on every lane-taking op in one loop body: acoordinate-addressed load of a[32, N]block, aRegVec::rowvector intosub_row, aColVec::columnvector intoadd_col, a secondcoordinatepass for a causal mask, and astore_fragmentper[16, 16]block that fits the staging tile.HOISTED— today's rule: onewarp::lane_id(), threaded throughPER_OP— each op reads%laneiditselfPER_QUERY— each row/column query reads it, the pessimistic boundmodal run modal_app.py::regcount, sm_100a, no spills anywhere:lane_probe_128_hoistedlane_probe_128_per_oplane_probe_128_per_querylane_probe_32_hoistedlane_probe_32_per_oplane_probe_32_per_queryPER_OPandPER_QUERYare identical on every column at both widths, and the emitted PTX holds exactly one%laneidmove in all six kernels. The reads CSE; the count ofwarp::lane_id()calls is free. Full reasoning and the recommendation are in the issue comment.Every pre-existing kernel in the table is byte-identical to
origin/main, so the addition perturbs nothing.Changes are confined to
device-tests/src/main.rsand are strictly additive (one existinguseline gainsColVec) — two other branches are editing that file.Verified:
modal run modal_app.py::build(clippy both crates, 33 host tests, realcargo oxide build --arch sm_100afor harness and examples),cargo fmt --check. No GPU function was run.Refs #27.