Skip to content

feat(profile): register GLM's host KV switches and one name lookup for readers - #2177

Merged
ashhart merged 1 commit into
ashhart:mainfrom
devopsfortunato:profile-glm-kv-host-1660
Nov 5, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
devopsfortunato:profile-glm-kv-host-1660

Conversation

@devopsfortunato

@devopsfortunato devopsfortunato commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

  • Issue: Refs RFC: --profile stable | fast-exact | fast, one table for the opt-in switches #1660. This is one increment of the registry: fast-exact/fast stay refused until their gates exist.
  • Stacked on: main (b85fd1f46); this adds 48267472b.
  • atc overlap --json (after the final rebase, base b85fd1f46): no source-file conflict is added. #1423's conflicts in zig/src/families/glm/cuda_ranks.zig, cuda_ranks_test.zig and cuda_forward_pieces.zig are identical with and without this change; #2106 conflicts on CHANGELOG.md on its base alone; #2116 shares only the CHANGELOG.md top-bullet slot, the usual slot every pull request here shares, and the two bullets both survive the merge.

Before: the registry covered eight switches; TF_GLM_KV_HOST and TF_GLM_KV_HOST_SHARED were read only through std.c.getenv, so the table could not describe them, the startup line never named them, and a switch looked up by name had no single reader.

After: GLM's host-KV tier is two identical-class, exact-one rows scoped to glm5_next on CUDA, carrying #1795's identical tokens at TP=2 on two GB10s as evidence. Their readers resolve through the registry: cuda_kv_host.onHost()/shared() call profile.get, and cuda_ranks.environment (the lookup cuda_native passes to Settings.read) calls the new profile.lookup, which serves a registered name from the table and every other name from the environment exactly as before. Settings.read's tests keep injecting their own lookup, so their fixtures are unchanged; the rank fingerprint still carries the resolved value, so ranks that disagree still stop before weights load. stable supplies no value for either row, so unset, set and malformed environments resolve to the same value they do on main, and the startup line reports the two overrides for GLM CUDA only. TF_GLM_KV_HOST_GIB stays outside the registry: it sizes the pages rather than choosing a policy.

Checks on this head

  • Head commit: 48267472b on b85fd1f46.
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: base 425, head 425, 0 new findings.
  • Tests run, with the command and pass, fail and skip counts. Zig 0.17.0 from .zig-version, aarch64 Linux, no GPU:
    • zig build test-profile: 8/8 pass.
    • zig build test-server-cpu: the step's test binary, run directly with its seed, passes 960/960 and exits 0. The zig build wrapper on this 4-core shared host intermittently reports run test failure for it with no failing test named; a re-run or the same binary run directly passes, and the step never names a test.
    • zig build test-glm-prompt-settings-host test-glm-startup-host test-glm-pages-host: 30/30 pass.
    • zig build test --test-timeout 10m: the full host unit suite.
    • zig fmt --check build.zig zig: clean.
  • CI: this pull request's own run; fmt, benchmark-clients (both OSes), release-paths and zig-macos-dev-tools have passed, and the remaining jobs are what this description waits on.
  • Not run, and why: no GPU or checkpoint on this host, so no CUDA, TP=2 or Metal run. Nothing in this change reaches arithmetic: both switches resolve to the same bytes, and the class and startup reporting are asserted by host tests.

Receipt

  • Environment: base b85fd1f46, head 48267472b, Zig 0.17.0 (zig-aarch64-linux), no backend toolchain, aarch64 Linux host, no GPU, no checkpoint.
  • Paths and platforms the change reaches, which I ran and which I could not: the host tests above run on Linux and Windows in CI. A CUDA GLM server's startup line and rank settings are the only runtime paths touched; I could not run them without a device.
  • Exactness: n/a. The change selects the same environment value for the same input and turns nothing on.
  • Decode speed before and after: n/a, no device.
  • Prompt speed before and after: n/a, no device.
  • Licence of any new weights or drafter: n/a.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thanks @devopsfortunato. The two host-KV switches now read through the registry with main's exact-1 rule, and
lookup gives every name what getenv did, since the stable profile can't supply a default. Ready.

…r readers

TF_GLM_KV_HOST and TF_GLM_KV_HOST_SHARED join the --profile registry as
identical-class, exact-one switches scoped to GLM CUDA, with ashhart#1795's
identical tokens at TP=2 as their evidence. Their readers now resolve
through the registry: cuda_kv_host's flags and the GLM rank settings,
whose fingerprint still carries the resolved value.

Readers that look a switch up by name use the new core.profile.lookup,
which serves a registered name from the table and every other name from
the environment as before. stable supplies no value, so nothing is
enabled or changed by default; profile_line reports the two overrides for
GLM CUDA only.

Part of ashhart#1660.
@ashhart
ashhart force-pushed the profile-glm-kv-host-1660 branch from 7b13215 to c84b62a Compare November 5, 2026 03:10
@ashhart
ashhart merged commit 04db985 into ashhart:main Nov 5, 2026
2 of 7 checks passed
@ashhart

ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thank you @devopsfortunato. 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 5, 2026

Copy link
Copy Markdown
Owner

Thanks @devopsfortunato! This is in TensorFold 1.2.3, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.3

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