Skip to content

CUDA: GLM's KDA chain and saved-row replay become a shared module - #2142

Merged
ashhart merged 4 commits into
mainfrom
lead/s235-cuda-kda
Nov 9, 2026
Merged

ashhart merged 4 commits into
mainfrom
lead/s235-cuda-kda

Conversation

@ashhart

@ashhart ashhart commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

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.zig is the shared runtime, exported as cuda.kda.
  • zig/kernels/cuda/common/kda.cuh holds the arithmetic, moved from glm_kda.cu with its tokens unchanged.
  • GLM keeps its projections, convolution commit, 64-row wide selection and state ownership.
  • The batched replay that was assembled inside Forward.commit now calls replayLayers, with the same strides, row count and launch geometry.
  • The image's six symbols and compiler flags are unchanged.

Test plan

  • Recording-driver test: every argument, scalar bit pattern, address, grid, block, shared bytes and stream match the frozen pre-extraction encoder, at heads 1/21/22/32/64, rows 1 to 4096, both chain choices, and replay cuts. Two planted controls fail it.
  • Host graph on Linux: 307 of 307 steps, 4764 tests, 28 skipped. Lean stays at 425.
  • SASS byte for byte on glm_kda, all five SMs, with controls: identical on a GB10.
  • glm-ref, glm-kda-pad-split and 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).
  • Whole-model tokens at TP=2 against the parent: not run separately. The move is covered by identical SASS on every SM and the recording-driver test's identical launches, so the kernels and their arguments can't change a token.

The GPU checks above ran on a GB10.

@ashhart

ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

GLM-5.3-Flash NVFP4 at TP=2 on two GB10s, this head against its parent 09e2f7fa6 (base, new, new, base): tokens equal in all 52 cells, prefill at 2K/8K/32K and decode at one and two streams within ±0.3%, resumed chats qualified. Still owed before this leaves draft: the SASS byte-for-byte check on glm_kda at the five SMs, glm-ref and glm-kda-pad-split, and the GLM kernel-contract groups.

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
ashhart force-pushed the lead/s235-cuda-kda branch from af46009 to c324927 Compare November 9, 2026 04:27
@ashhart
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.
…ged since 28b7e19

flashnext_hc.cu and norms.cu (d4541b0, same SASS), glm_glue_attn.cuh, glm_glue_router.cuh, kernels.zig and root.zig
(42735f9, #2335, glm_glue SASS identical on five SMs) and cublaslt.zig (f1ab10f, Clef's joint head, a new path).
@ashhart
ashhart force-pushed the lead/s235-cuda-kda branch from c324927 to da4e7b3 Compare November 9, 2026 10:49
@ashhart
ashhart merged commit fd43882 into main Nov 9, 2026
3 of 10 checks passed
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.
@ashhart
ashhart deleted the lead/s235-cuda-kda branch November 10, 2026 16:35
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant