Skip to content

feat(profile): register GLM paging and report resolved selection - #1959

Merged
ashhart merged 2 commits into
ashhart:mainfrom
garvrao80:feat/glm-paging-profile
Nov 3, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
garvrao80:feat/glm-paging-profile

Conversation

@garvrao80

Copy link
Copy Markdown
Contributor

What this changes

GLM CUDA's TF_KV_PAGES now appears in the stable profile registry, and each rank reports the resolved paging selection before engine construction. Today, leaving the variable unset selects pages at TP >= 2 with BF16, but windows on one rank or with FP8; the profile summary cannot explain this because the setting is unregistered.

Example with the variable absent, BF16 and two ranks:

glm kv selection: pool pages; TF_KV_PAGES=auto (default); rank 0 of 2; cache bf16
  • The reader uses the existing environment-first resolver. The family parser is unchanged, including empty/arbitrary text meaning on and the Fp8OnPages error for explicit pages with FP8.
  • The registry's auto syntax distinguishes automatic policy from an explicit policy, including off/0. A forced policy can match the automatic storage at a particular rank count; the family report shows the actual resolved boolean, rank/world and precision. It does not guess placement from environment variables.
  • The report stays inside the watched startup boundary, after liveness and page validation, before the constructor. An invalid FP8 policy notifies peers as before and emits no resolved-selection report. A later construction/admission failure is still possible; the line is labelled a selection, not a successful load.
  • Raw overrides remain bounded and escaped in the generic profile summary. The family selection line prints normalized policy text only. The row applies to GLM CUDA; Nemotron's same-named switch is unchanged.
  • Documents the complete existing mode table, including legacy noncanonical input. No profile defaults, cache layout, arithmetic, scheduler, kernels or request processing change; fast-exact/fast remain unavailable.

Refs #1660; follows merged #1944. This covers one additional switch, not the rest of the RFC. Existing BF16 paging evidence is #1322.

Receipt

  • Base: 089a18dff; Zig 0.17.0, Windows x64 and native WSL Ubuntu x64. No GPU or checkpoint required for these configuration/reporting tests.
  • Focused zig build test-profile test-glm-startup-host: 13/13 tests pass on Linux; Windows focused targets pass (the registry also passes all six tests directly). The independent expected-case table checks 13 inputs, every rank count 1..16 and BF16/FP8, with leader/follower startup calls: 806 invocations. Tests retain peer notification and constructor error coverage and verify that reports precede construction and follow liveness.
  • Negative controls compile and fail for the intended assertions: removing the report produces 5 failures; suppressing explicit non-auto overrides produces 1 failure. Restoring the change gives 13/13 passing focused tests.
  • Actual Windows and Linux subprocess environments: 13 cases, checking all eight registered libc lookups each time, including absent, empty, off, noncanonical and control-byte input; raw bytes and pointers preserved.
  • Full Linux zig build test test-kernel-contract test-golden test-server-security test-pull-security fuzz-cortheon -j4 --test-timeout 10m --summary all: exit 0, 521/521 steps; 6,557/6,602 tests passed, 45 skipped, zero failures. Server goldens 55/55 equal; server-security 24/24. Windows zig build test test-kernel-contract test-golden fuzz-cortheon -j4 --test-timeout 10m --summary all: exit 0, 473/473 steps; 5,091/5,186 tests passed, 95 skipped, zero failures. Goldens 55/55 equal on each platform. These are the build summaries; cached steps were reused.
  • Plain Linux production zig build -j4 --summary all: exit 0, 31/31 steps. Windows plain production build: exit 0, 27/27 steps succeeded.
  • zig fmt --check, git diff --check: pass. Lean: 439 findings on base and candidate, zero new.
  • ATC issue check complete, advice yours; anonymous public session. ATC file coverage was incomplete, so all 156 open PR file lists were checked separately. Three overlap these files. Merge-tree comparisons against the same main base show no new conflict blocks; older glm cuda: TF_GLM_KV_HOST keeps the KV pages' latent rows in pinned host memory #1795 and GLM-5.3-Flash on CUDA keeps conversation states on disk, every rank's part (--learn-conversations) #1411 already conflict with main, CUDA: Qwen4 and tensor-parallel loaders drop the checkpoint's pages after every rank is ready #1887 merges cleanly. The overlapping GLM recipe edit was omitted to keep this change narrow.
  • Device/model exactness, decode speed and cold TTFT: not measured. The change runs during configuration/startup and does not alter prompt/decode code. No CUDA/Metal device, Mac or real-checkpoint qualification claimed. Host results do not qualify FP8 or a fast profile.

Checklist

  • Existing lane rounds and precision unchanged; no serial path or drafts-off requirement added.
  • Real-model drafted/plain, resumed/fresh, concurrent/solo gates: not run; no device or weights available.
  • No GPU kernel changes; no new kernel qualification claimed.
  • Release-to-release prompt performance: not measured; no prompt path changed.
  • Platforms run and unavailable device checks stated above.
  • Negative controls fail as intended; focused candidate tests pass.
  • Comments/docstrings remain single lines; lean adds zero findings.
  • Publication tree and history checked for personal data and attribution trailers.

@ashhart

ashhart commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks @garvrao80. We reviewed this independently: GLM's paging choice is unchanged. The variable is read at the same call site, per load, on every rank before rank agreement, and profile.get returns the same bytes getenv did. It lands now: it's gated and queued, and we've written the changelog line.

@ashhart
ashhart force-pushed the feat/glm-paging-profile branch from 2671fad to 52bb7e0 Compare November 3, 2026 03:22
@ashhart
ashhart merged commit 099ca83 into ashhart:main Nov 3, 2026
4 of 7 checks passed
@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thank you @garvrao80. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Landed as 099ca83. Thanks @garvrao80!

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thanks @garvrao80! This is in TensorFold 1.2.2, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.2

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.

2 participants