Repository navigation
Living Weights for GLM-5.3-Flash (glm family) - #574
Closed
chadhurley25075-png wants to merge 3 commits into
Closed
chadhurley25075-png wants to merge 3 commits into
chadhurley25075-png wants to merge 3 commits into
Conversation
…ed-expert down, loaded from append-only shards y += 10 (x a^T) b after the last layer's shared-expert down projection, in decode and prompt chunks, with the train.metal kernels Nemotron uses (rank 0 encodes nothing). Learned rows live beside the model as living-NNNN.safetensors listed in living_weights.index.json, summed in index order; each shard carries the site weight's sha256 and a mismatch is refused. A lone living_weights.safetensors loads as shard 1. Dropping the newest index entry undoes a lesson exactly. LW_TOPICS=a,b loads only those topics. GLM_LOAD_LIMIT_GB and GLM_MLOCK (both opt-in) let Flash load on one 256 GB Mac. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…achinery over the one GLM site The lane host's learn hook (glm_slide.zig) attached in glm_host as Nemotron's is in metal.zig. The learner reuses Sliding Weights' lesson, subspace choice, gate, gated rounds, commit, mining and guard (nemotron/choice.zig and subspace.zig unchanged), generic over its trainer. The Metal trainer caches one GPU capture per example (everything before layer 44's MLP is independent of the change) and runs the tail past the site and its backward to b on the CPU, exact through the last hyper-connection. Saves spawn a new shard holding only the new ranks. A chat template that closes no assistant turn (GLM-5.3) now ends each lesson's answer with the next turn's first token, so learned answers stop. --slide with --speed-up is refused. zig build test-lw: the CPU tail and its gradient against finite differences, the learner's state machine end to end on a host toy model, save rounding and undo; no GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…measured numbers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you, @chadhurley25075-png. Getting a lesson to run end to end on GLM-5.3-Flash on one Mac, with the engine token-exact when no shard is loaded, took real work. The turn-end fix for templates that never close an assistant turn is a good catch too. We can't take this one as it stands:
The turn-end change in |
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.
Living Weights for GLM-5.3-Flash (
glmfamily)For your consideration: not a finished feature, but a working starting point. It brings Living Weights to GLM-5.3-Flash on a single Mac, it runs end to end, and with no learned shard the engine is token-exact with stock. We're excited to see what you and the community do with it.
Branch
glm-living-weights(3 commits on main 297ec2c, which includes 1.0.4).What it adds
tensorfold serve <glm-5.3-flash folder> --slidelearns into GLM-5.3-Flash on one Mac, through the same/v1/slide/learnAPI, lesson, gate, guard and undo as Nemotron. The learner reusesnemotron/choice.zigandsubspace.zigunchanged; the trainer caches one GPU capture per example and runs the step past the site on the CPU.train.metalkernels Nemotron uses. Rank 0 encodes nothing.living-NNNN.safetensorsshards beside the model,listed in
living_weights.index.jsonand summed in order at load. Dropping the newest entry undoes that lessonexactly. Each shard carries the site weight's sha256; a mismatch is refused. A lone
living_weights.safetensorsloads as shard 1.
LW_TOPIClabels a save,LW_TOPICS=a,bloads only those.token, so learned answers stop.
GLM_LOAD_LIMIT_GBandGLM_MLOCKso Flash (180.6 GB) loads on one 256 GB Mac.zig build test-lw(host math, gradient vs finite differences, the learner end to end on a toy model) and sidecartests in
core; a section indocs/living-weights.md.How to use
Measured (one M3 Ultra, 256 GB)
byte-identical 20/20.
and 3. Decode 49.0–49.4 tok/s with it, 48.7–49.2 without. Depth 3 equals depth 0 with the change and with a gated
open block (20/20).
is the model writing and checking its lesson). The model answers "You like blue".
Known limits
taken out because a held-out "which colour do you like best?" also answered "You like blue best": one site at the last
layer did not separate the two.
--slide --speed-upis refused).zig build testpass;zig fmt --checkis clean on the changed files.The full GLM-5.3 version is a separate PR stacked on #557.
Thank you for Sliding Weights. It is your engine and your design; please reshape or decline this as you see fit.
🤖 Generated with Claude Code