Repository navigation
CUDA: GLM's KDA chain and saved-row replay become a shared module - #2142
Merged
Merged
Conversation
6 of 13 tasks
ashhart
force-pushed
the
lead/s235-cuda-kda
branch
from
November 5, 2026 20:30
116cd1e to
af46009
Compare
9 tasks done
This was referenced Nov 6, 2026
Owner
Author
|
GLM-5.3-Flash NVFP4 at TP=2 on two GB10s, this head against its parent |
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
…aunch kda.geometry(key_dim, value_dim, conv_taps) returns error.KdaGeometry unless the model's heads are the kernels' 128 keys and 128 values and its conv window has kda.cuh's 4 taps, so a family calls it at load, before any allocation or launch (ashhart#874's review: unsupported head widths and tap counts refused up front). kda.taps names TAPS beside dk and dv. No kernel or launch changes; GLM's bytes are untouched. Part of ashhart#850, stacked on ashhart#2142.
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
force-pushed
the
lead/s235-cuda-kda
branch
from
November 9, 2026 04:27
af46009 to
c324927
Compare
ashhart
marked this pull request as ready for review
November 9, 2026 08:01
Extract the fixed-shape chain and replay into the shared CUDA operator while retaining the GLM image ABI and arithmetic. Compare launch records against the frozen predecessor, including partial and batched replay. Part of #850.
…d to common/kda.cuh (same SASS on five SMs)
ashhart
force-pushed
the
lead/s235-cuda-kda
branch
from
November 9, 2026 10:49
c324927 to
da4e7b3
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
…aunch kda.geometry(key_dim, value_dim, conv_taps) returns error.KdaGeometry unless the model's heads are the kernels' 128 keys and 128 values and its conv window has kda.cuh's 4 taps, so a family calls it at load, before any allocation or launch (ashhart#874's review: unsupported head widths and tap counts refused up front). kda.taps names TAPS beside dk and dv. No kernel or launch changes; GLM's bytes are untouched. Part of ashhart#850, stacked on ashhart#2142.
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
…aunch kda.geometry(key_dim, value_dim, conv_taps) returns error.KdaGeometry unless the model's heads are the kernels' 128 keys and 128 values and its conv window has kda.cuh's 4 taps, so a family calls it at load, before any allocation or launch (ashhart#874's review: unsupported head widths and tap counts refused up front). kda.taps names TAPS beside dk and dv. No kernel or launch changes; GLM's bytes are untouched. Part of ashhart#850, stacked on ashhart#2142.
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 10, 2026
…aunch kda.geometry(key_dim, value_dim, conv_taps) returns error.KdaGeometry unless the model's heads are the kernels' 128 keys and 128 values and its conv window has kda.cuh's 4 taps, so a family calls it at load, before any allocation or launch (ashhart#874's review: unsupported head widths and tap counts refused up front). kda.taps names TAPS beside dk and dv. No kernel or launch changes; GLM's bytes are untouched. Part of ashhart#850, stacked on ashhart#2142.
ashhart
pushed a commit
that referenced
this pull request
Nov 10, 2026
…aunch kda.geometry(key_dim, value_dim, conv_taps) returns error.KdaGeometry unless the model's heads are the kernels' 128 keys and 128 values and its conv window has kda.cuh's 4 taps, so a family calls it at load, before any allocation or launch (#874's review: unsupported head widths and tap counts refused up front). kda.taps names TAPS beside dk and dv. No kernel or launch changes; GLM's bytes are untouched. Part of #850, stacked on #2142.
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 12, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 13, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 19, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 19, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 19, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 21, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 21, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 21, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 21, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 23, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
ashhart
pushed a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 26, 2026
…nks, the native 262,144 window) inclusionAI's Ling-3.1-flash (bailing_moe_v3: 63 KDA and 9 MLA layers, 512 routed experts with group-limited sigmoid routing) on the native CUDA server, built on ashhart#874's TP=1 port and ashhart#1541's host package (config, names, route, oracle, synth, fixtures). ashhart#850 step 5, on the shared pieces: - KDA layers on the shared CUDA KDA (ashhart#2142's cuda.kda: chain, saved-row replay through replayLayers); config.fixed is held to kda.geometry in a test. - Routing on moe_glue's group-limited score form (tf_moe_topk_sigmoid_score_groups). - MLA on the shared mla image (cuda.mla: 576-wide chunk tiles, 128-wide absorb and expand, the plain rope, the head-wise output gate), merged by GLM's latent merge; prompt rows in the expanded form on the family's tf_ling_pattn. - EXL3 packs through main's shared EXL3 operators (cuda.exl3 Dense and tiles, exl3_experts with tf_exl3_plan_finish_after for Ling's clamp order, exl3_grouped). bf16 checkpoints load for the synthetic checks; FP8 and NVFP4 checkpoints are refused by name (LingFormat). - The dense shared expert's SwiGLU in Ling's clamp order: ling_act.cu instantiates glm_swiglu.cuh's rows with the clamp on silu's output. - TP=2 over hosts (TF_LING_RANK, TF_LING_WORLD): heads, expert widths and the head's vocabulary cut on EXL3's 128-wide blocks; rank 1 follows rank 0's steps; RoCE gathers up to GLM's cap. - Lanes: shared windows across streams, copy drafts, CUDA graphs for one sequence's verify windows, prompt states kept in memory for the prompt cache. - Admission: --context up to the native 262,144 positions (LingContext past it); config rope_scaling is refused as main's config does; the MTP layer is not loaded (drafts come from the prompt's text). - Checks in tf-cuda-test (ling-route, ling-mla, ling-clamp, ling-synth, ling-weights, ling-forward-synth, ling-lanes, ling-init-faults, ling-exl3-layers, ling-exl3-clamp, ling-tp, ling-ckpt-check, ling-slots), test-ling on the host, docs/recipes/ling-3.1-flash-cuda.md. Wiring: the ling_glue and ling_act images, the engine in cuda_engines.zig, the native registry entry, test-ling and the runner's ling_cuda import. GLM: glm/cuda_latent.merge is public (Ling's chunks merge through tf_glm_merge). The family's fake driver reports a discrete device, so downloads in its host tests copy directly instead of through main's per-thread pinned bounce. Co-authored-by: Jürgen Schmied <[email protected]>
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.
Summary
Step 1 of #850: GLM's fixed-shape KDA chain and saved-row replay move into a shared CUDA module, so another family can use them. Part of #850; it doesn't close it, and the Ling family isn't here.
zig/src/cuda/kda.zigis the shared runtime, exported ascuda.kda.zig/kernels/cuda/common/kda.cuhholds the arithmetic, moved fromglm_kda.cuwith its tokens unchanged.Forward.commitnow callsreplayLayers, with the same strides, row count and launch geometry.Test plan
glm_kda, all five SMs, with controls: identical on a GB10.glm-ref,glm-kda-pad-splitand the kernel contract on a GB10 (sm_121): both pass, and the contract and the launch limits have no failure that main doesn't also have (246 and 0 on each side).The GPU checks above ran on a GB10.