Repository navigation
cuda: flashnext_batch, flashnext_gdn and qwen4_gdn take tf_common::warp_sum, SASS unchanged - #1550
Merged
Merged
Conversation
This was referenced Oct 28, 2026
jschmied
added a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 28, 2026
…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.
…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.
ashhart
force-pushed
the
prims-1409-step2
branch
from
October 29, 2026 12:21
aa91845 to
b09f6f5
Compare
ashhart
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 29, 2026
…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
pushed a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 29, 2026
…SS unchanged Step 4 of ashhart#1409. The same-text activation copies move to tf_common in one header: - sigmoidf_: gdn_train, drama3_common.cuh, glm_kda, and the file-local sigm of attn_train, train_attn, flashnext_train, qwen27_train and train_q4 (renamed at their call sites); - softplusf_: gdn_train and drama3_common.cuh; - silu: flashnext_train, qwen27_train, train_q4 and train; - silu_grad: gdn_train, flashnext_train, qwen27_train, train_q4 and train (train's spelled the sigmoid inline). Each file takes them by a using-declaration. glm_kda.cu's gradient-serving pin takes the new bytes. Left out: flashnext_gdn, qwen4_gdn and flashnext_batch (ashhart#1550 edits them and qwen4_gdn's CPU twin), qwen4_gdn's stable sigmoid, act_l2's __fdiv_rn silu, drama3's siluf_ and train's softplus (other names used elsewhere or not at all), and deepseek_v41/pointwise's torch silu.
ashhart
added a commit
to jschmied/TensorFold
that referenced
this pull request
Oct 29, 2026
ashhart
pushed a commit
that referenced
this pull request
Oct 29, 2026
…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 #1550 does for flashnext_batch.cu.
ashhart
pushed a commit
that referenced
this pull request
Oct 29, 2026
…SS unchanged Step 4 of #1409. The same-text activation copies move to tf_common in one header: - sigmoidf_: gdn_train, drama3_common.cuh, glm_kda, and the file-local sigm of attn_train, train_attn, flashnext_train, qwen27_train and train_q4 (renamed at their call sites); - softplusf_: gdn_train and drama3_common.cuh; - silu: flashnext_train, qwen27_train, train_q4 and train; - silu_grad: gdn_train, flashnext_train, qwen27_train, train_q4 and train (train's spelled the sigmoid inline). Each file takes them by a using-declaration. glm_kda.cu's gradient-serving pin takes the new bytes. Left out: flashnext_gdn, qwen4_gdn and flashnext_batch (#1550 edits them and qwen4_gdn's CPU twin), qwen4_gdn's stable sigmoid, act_l2's __fdiv_rn silu, drama3's siluf_ and train's softplus (other names used elsewhere or not at all), and deepseek_v41/pointwise's torch silu.
ashhart
added a commit
that referenced
this pull request
Oct 29, 2026
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
Second step of #1409, on main after #1440. Pure refactor:
cuobjdump -sassis identical for every function of every image that includes a touched file.The last three float
warp_sumcopies (xor butterfly 16 down to 1, the same loop ascommon/reduce.cuh) give way totf_common::warp_sumthrough#include "common/reduce.cuh"and ausingdeclaration, as in #1440:flashnext_batch.cu(insidefn_gdn)flashnext_gdn.cuqwen4_gdn.cu, the checked-in textGdn.cudagenerates fromflashnext_gdn.cu(source_test.zigcompares them), so both change together.qwen4_gdn_cuda_host.zig, which turns that text into the CPU twin, now strips the include and theusingdeclaration instead of the deleted function, the wayqwen4_ple_cuda_host.zighandlesglue_math.cuhin #1440.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.5 files, +9 / −15.
Left alone on purpose
sample.cu'swarp_sum_u: unsigned, a different type.deepseek_v41/sampling.cu: double precision.glm_kda.cu'swarp_sum4: a different signature and reduction.Verification
dd0a9cc5e, headaa9184554, nvcc 13.0: 3 images (flashnext_batch,flashnext_gdn,qwen4_gdn), 65 functions, sm_80/86/89/120/121: 0 changed, 0 added, 0 removed, 0 unstable. Before the rebase the same set was also identical with nvcc 13.2. Theqwen4_gdnimage is built from the checked-in unit, as the tool does for generated units.warp_sumbutterfly changes 35 functions in 3 of 3 images. Thefp4paircontrol cannot be planted because none of these units includescommon/qmm_frag.cuh, so the tool exits 1 on that line alone.zig build test -Dnvcc=/usr/local/cuda/bin/nvcc: passes (RC 0).Part of #1409.