Repository navigation
Conversation
…tree's low levels in registers and skips the zero padding groups Every output keeps its four MMA steps from zero a group and the same zero-padded pair tree, so prompt rows stay bit-equal to main and to the decode rows. Release layer 2 stage hashes match main at 2048 and 4096 rows.
…there and the rest by decode fmas The simdgroup kernels already ran near the fp32 MMA rate. On M5 GPUs (macOS 27) a routed expert's 32-wide group now goes to the tensor unit, fp4 weights read as stored, when its act_quant codes bound every fp32 partial sum below 2^24 times their lowest set bit: then any summation order gives the decode chain's bits. Other groups (about 0.2% up, 0.3% down on layer 2) run the decode kernels' 32 fmas in k order. The chains, scale fmas and tree are the decode kernels'; one simdgroup runs a chain and the tree joins them in threadgroup memory. Down's input halves and flags come from a small prep pass over act. Other GPUs keep the simdgroup kernels; the contract gates both sets, and both match the decode kernels per row.
…generation 17 runtime_sources/dsv41.zig called the experts' source with the old three arguments; it now lists the simdgroup source and, where the loader would take it, the tensor-unit source, so the runtime compile gate builds experts_units.metal. The tensor-unit kernels now run only on generation 17 (M5), the one checked; the modes test holds the runtime list to that rule. CHANGELOG: 155 ms, #3330.
TF_CTL 6 sends every group to the tensor unit. The down gates' random data now carries one group that decode's fmas round (2^24, 2^23, 2^16, then four terms of half an fp32 ulp, landing on a bf16 tie) and exact sums do not: the kernels match the oracle through the fallback, and the control goes red at the shapes gate.
…nd on an M5 units_test.zig checks xu_exact's rule against exact integer sums: a safe group's fp32 sum is exact in six orders, and past the bound some order rounds. On an M5 it builds rows at and past the bound (tops at the largest code, lows at the lowest bit, columns that swing and cancel), runs the production act_quant and dprep, then the tensor unit as xu_chain does and decode's fmas as the fallback does. Every safe sum matches the exact sum on both paths, past the bound the two paths split, and the kernels' flags equal the rule. TF_DSV41_UNITS_BATCHES sets the batches (2).
…ough bfloat tf_dsv41_attn_pre gives each simdgroup one row and two heads, so both heads' dots use one load of each key. Keys come straight from device memory (no window tiles or barriers), widen through the bfloat type, and a selected run's indices load four at a time. Each key is one step: both dots, the pair-order butterfly, a rescale of any head whose max rose, then each head's weight and sums, the steps of tf_attn_update. Bits equal main's and the decode kernel's.
…ough bfloat tf_dsv41_attn_pre gives each simdgroup one row and two heads, so both heads' dots use one load of each key. Keys come straight from device memory (no window tiles or barriers), widen through the bfloat type, and a selected run's indices load four at a time. Each key is one step: both dots, the pair-order butterfly, a rescale of any head whose max rose, then each head's weight and sums, the steps of tf_attn_update. Bits equal main's and the decode kernel's.
…tched to 64 rows tf_attn_lo and tf_attn_hi widen through the bfloat type (the same values), so the decode kernel's dots and sums spend fewer instructions a key; the prompt kernel's own widening copy goes. With that, loading each step's keys a step ahead wins at every row count measured, so decode launches take the prefetch pipeline up to 64 rows. A 72-row decode shape keeps the plain pipeline under the contract. Bits equal main's.
Owner
Author
|
Stopped at #3330. |
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.
CI for a landing train: #3322 #3330 #3351 #3360 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.