Repository navigation
metal: Nemotron's, Qwen3.8-27B's and LFM2's prompt pick from one source (#2251) - #4739
Merged
Merged
Conversation
…art#2251) nemotron_prompt_pick and q27_attn_prompt_pick had the same body: the indirect grids for the finite or the masked prompt kernel after the non-finite scan, then the flag cleared. Both now come from TF_PROMPT_PICK in core/prompt_pick.metal; Nemotron keeps its one-thread reservation, names and signatures are unchanged.
lfm2_prompt_pick differed from the other two only in its loop counter's type (uint, not int).
ashhart
force-pushed
the
dedup-2251-prompt-pick
branch
from
November 23, 2026 18:45
7cd71d9 to
45c4598
Compare
Owner
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
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.
Part of #2251 (group: the two prompt picks). Head 7cd71d9, two commits on main b192eaa.
What changes
nemotron_prompt_pick(nemotron/prompt_pick.metal) andq27_attn_prompt_pick(qwen27/attention_prompt.metal) had the same body: after the non-finite scan, write the indirect grids for the finite or the masked prompt kernel, then clear the flag.TF_PROMPT_PICK(NAME)in the newcore/prompt_pick.metal. Nemotron keeps itsmax_total_threads_per_threadgroup(1); the 27B's had none and still has none. Names, buffer indices and signatures are unchanged.nemotron/prompt_masked.zig'spicker(both masked libraries);zig/build/qwen27.zigputs it ahead ofattention_prompt) and the paged twin (qwen27/paged.zig).lfm2_prompt_pickwas the same body with auintloop counter; it uses the macro too (lfm2/prompt_masked.zig). It is a separate commit so it can be dropped on its own; the IR below shows the counter type changes nothing.Core vs backend-only:
core/prompt_pick.metalis the shared Metal piece; the rest is each family's Metal source assembly.Same bits (M3 Pro, no tensor units; run on a3e5359, which differs from this head only in
core/prompt_pick.metal's comment; macOS 27.2, metal 32023.921, Zig 0.17.0; main b192eaa against this head)IR: every runtime library assembled by
zig build emit-metal-runtime-sourceson both arms, with and without tensor units (1040 and 1066 libraries, manifests identical). Exactly the libraries holding a pick changed in text (8 and 11), each compiled with-std=metal4.1 -S -emit-llvmunder its manifest's flags:Kernel contract,
tf-kernel-contract --only, main = head:Family checks:
test-qwen27-paged-contract-host test-qwen27-masks-host test-lfm2-load-host test-kernel-symbols-host: 15/15 steps, 30/32 tests (2 skipped).zig build test-qwen27(which reachesattention_pick_test.zig): 48/48 steps, 205/207 (2 skipped) on head and main.Served hash: not run. Every library that compiles a pick has identical IR, so no served reply can change; for the same reason no seeded, resume, concurrency or refusal checks against main.
x86 CI green on a merge of this head with three sibling metal: unify duplicated kernels (attention partials, norms, gemm_nax wrappers, glue, RoPE) #2251 groups: merge 72b153f490 of b83b26a, a3e5359, 478fcb6 and ebf6db7 on main b192eaa (the groups touch separate files, apart from separate hunks of
sources.zigin the copy and vision groups).zig build -Dfixed-cpu test-host test test-golden test-kernel-contract test-server-security test-pull-security fuzz-cortheon check-release-paths: 2431/2431 steps, 16239/16350 tests (111 skipped);check-native-cuda-host compile-cuda-tests17/17;zig fmt --checkandgit diff --checkclean. pr_check and lean flagged one new multi-line comment in the prompt-pick group'score/prompt_pick.metal; on the merge with that one-line fix (16ea8fe6e4, prompt pick at 7cd71d9): pr_check 0 errors, lean 165 vs 165 on main, 0 new.Proposed CHANGELOG line (for you to place):