Repository navigation
cuda: fp4pair, fp8pair and e4m3f in common/fp_pairs.cuh, SASS unchanged - #1555
Merged
Merged
Conversation
This was referenced Oct 28, 2026
…rp_sum, SASS unchanged The three remaining float warp_sum copies (xor butterfly 16..1) give way to common/reduce.cuh through a using declaration, as in ashhart#1440. qwen4_gdn.cu is the checked-in text Gdn.cuda generates from flashnext_gdn.cu (source_test), so both change together. qwen4_gdn_cuda_host.zig, which builds that text for the CPU, now strips the include and the using declaration instead of the deleted function. flashnext_gdn.cu's gradient-serving pin takes the new bytes; flashnext_batch.cu's two pins already differ on main and are left as they are. cuobjdump -sass is identical for every function of the three images (65 functions, sm_80/86/89/120/121) with nvcc 13.0 and 13.2, base prims-1409.
Step 3 of ashhart#1409. The text-identical copies move to tf_common in one header: - fp4pair (E2M1 pair to bf16x2): qmm_frag.cuh, prompt16, nvfp4_experts and nvfp4_experts_tile; - fp8pair (two adjacent E4M3 bytes to bf16x2): drama3_fp8 and fp8_experts; - e4m3f (E4M3 scale to float): nvfp4_experts and nvfp4_experts_tile. Each file takes them by a using-declaration, so no call site changes. qmm_frag keeps qmm_frag::fp4pair the same way. Left out because their text differs: qmmf's fp8pair (bytes spread first) and e4m3f(uint8_t), and prompt16's fp8pair with a unit argument. cuda_sass_identity.py's fp4pair-constant control now plants in common/fp_pairs.cuh, where the constant lives.
…ytes fp_pairs.cuh leaves Both pins matched main before this branch. fp8_experts.cu's and nvfp4_experts.cu's pins already differ on main and are left as they are, as ashhart#1550 does for flashnext_batch.cu.
ashhart
force-pushed
the
prims-1409-step3
branch
from
October 29, 2026 12:21
22654fd to
693d9a7
Compare
ashhart
added a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 29, 2026
ashhart
added a commit
that referenced
this pull request
Oct 29, 2026
This was referenced Oct 29, 2026
Merged
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
Step 3 of #1409. It is independent of #1550 (no shared files) and is a pure refactor:
cuobjdump -sassis identical for every function of every image that includes a touched file.The text-identical copies of three small decoders move into
tf_commonin a new header,common/fp_pairs.cuh:fp4pair(two E2M1 codes to a bf16x2 pair):common/qmm_frag.cuh,prompt16.cu,nvfp4_experts.cu,nvfp4_experts_tile.cu;fp8pair(two adjacent E4M3 bytes to a bf16x2 pair):drama3_fp8.cu,fp8_experts.cu;e4m3f(one E4M3 scale to float,uint32_targument):nvfp4_experts.cu,nvfp4_experts_tile.cu.Each file takes them through a
usingdeclaration, so no call site changes, andqmm_frag::fp4pairstill resolves the same way.tools/zig/cuda_sass_identity.py's fp4pair-constant control now plants incommon/fp_pairs.cuh, since that is where the constant lives now. Without that change the control would find no pattern and the tool would exit 1.The gradient-serving pins of
prompt16.cuandcommon/qmm_frag.cuhtake the new bytes. Both matched on main. The pins offp8_experts.cuandnvfp4_experts.cualready differ on main and are left as they are, as #1550 does forflashnext_batch.cu.9 files, +48 / −50.
Left alone on purpose
These are not text-identical:
qmmf.cu'sfp8pairspreads the bytes first;qmmf.cu'se4m3ftakes auint8_t;prompt16.cu'sfp8pairtakes a unit argument.They would need their own SASS or float64 check.
Verification
dd0a9cc5e, head8f1ccf336, nvcc 13.0, sm_80/86/89/120/121. 29 images, 1,695 functions: 0 changed, 0 added, 0 removed. The images are affine8, affine_prefill, block_attention, ck_experts, ck_lane, contract_controls, drama3_fp8, flashnext_attn, flashnext_fact, flashnext_hc, flashnext_hcf, fp8_experts, lane_gemv, nvfp4_experts, nvfp4_experts_tile, prefill_attention, prompt16, qmm, qmm_group, qmm_prefill, qmmf, qwen35, qwen35_kv8, route_rows, tree_attention, w4a8_prefill, window_attention, window_pages and window_rows.warp_sumbutterfly: 135 functions in 5 of 7 images.zig build test-gradient-serving: the same set of differing pins as main. That test already fails on main, oncontract_controls.cuamong others.zig build test -Dnvcc=/usr/local/cuda/bin/nvcc: passes (RC 0).Part of #1409.