Skip to content

Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B - #1835

Open
BlivionIaG wants to merge 33 commits into
ashhart:mainfrom
BlivionIaG:feature/glp-steering
Open

BlivionIaG wants to merge 33 commits into
ashhart:mainfrom
BlivionIaG:feature/glp-steering

Conversation

@BlivionIaG

@BlivionIaG BlivionIaG commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Opt-in additive GLP residual steering for the Qwen3.8-27B Metal path, default off. The direction is added at the Qwen backbone residual hook; this is not the DeepSeek paired fold/writer hook.

This follows the maintainer's scope decision:

  • Add only. No projection/directional-ablation mode or refusal-removal assets/examples.
  • Style/topic, non-refusal vector derivation; no trained vector binary is bundled.
  • Visible startup notice with escaped filename, full content SHA-256 and the fact that responses are steered.
  • Vector content and effective strength participate in model/cache identity. Malformed files and incompatible layouts fail closed.
  • Gemma, CUDA and ROCm remain refused in this PR. Backend expansion is separate work, not silently enabled by a file.
  • Absence of a GLP file preserves the unsteered path. This is not an efficacy, general capability or safety claim.

Original authors and provenance

  • Matt Suiche / weightless: original GLP concept and format. This native Zig reader implements the GLP format defined by the weightless project (@msuiche); no external serving plugin/engine code is copied or vendored.
  • llama.cpp: additive GGUF control-vector convention.
  • FlashAlign clarification: no Aevonix/FlashAlign code, data or method is incorporated. This implements the GLP format/native path described above, not a FlashAlign port, and does not claim priority over related work. This preserves the original attribution clarification.

The TensorFold implementation remains Apache-2.0. Any later vector release needs its own authorship/licence, pinned checkpoint and software versions, derivation recipe, strength calibration and held-out controls. A format citation is not a licence to redistribute checkpoint-derived assets.

Current source and evidence

PR head: 2370dd9c4f, a merge of main 7aadce5e25 into 5b7f3845e6 (the conflicts were CHANGELOG.md and one adjacent build.zig registration, both kept); the M5 receipts below were measured on a local scratch merge 2035e4a32d of main 9edf2f89d4 with 5b7f3845e6, so this head differs from the measured tree by main's later commits and the same two files. Scoped GLP steps pass on this head (test-glp test-glp-serve test-steer test-glp-steer).

  • GLP and MTP compose: the MTP head's forward.Stages turn the target steering plan off (Stages.steer = false) while reading the target's already-steered activations, so a vector that covers layer 63 is applied once. Regression: test-qwen27-startup-host (target stages resolve the layer-63 direction, the head's resolve none).
  • CI on 62f927ef5d: zig, zig-b and zig-windows each failed one host test (cli_capabilities capability audit compared a forced steering listing against glp_startup.steers, false off macOS); fixed in a94baaf823. desktop and desktop-linux fail Typecheck desktop with the nine freeDiskBytes/memory TypeScript errors main 9d90f12dfb shows (run 45208593403); this PR touches no app/ file. CI on the current head is queued behind the repository's runner backlog.
  • Review fixes (2026-11-23 comment and audit): a config file's relative --glp path resolves against the TOML file's folder; tensor offsets and sizes are bounds-checked without wrapping; metadata arrays are limited to four nested levels; the control-vector flags stay parsed on Linux but are not advertised in capabilities --json where every valid use refuses them; the tensor digest is verified only when the parsed glp.content_sha256 was checked. The Metal kernel contract passes again (the harness now compiles the norm as production does and keeps the suite alive through runAll), tf-glp-check validates its arguments before opening the file, and the weightless parity tool and docs pin b181a07d. Host regressions cover each case.
  • Scoped tests: zig build test-glp test-glp-serve test-steer test-glp-steer native -Dcpu=apple_m1 -j4 exits 0 with 99 tests (36 + 35 + 24 + 4); test-qwen27-startup-host passes 24/24 with the new GLP+MTP regression. tools/pr_check.py --base ea37382cb1 --pr 1835 reports zero errors and zero warnings across 52 changed files (lean 165 vs 165, zero new); zig fmt --check build.zig zig passes.
  • Kernel contract (M4 Pro): tf-kernel-contract --only "qwen27 steer" --no-limits prints SUMMARY 1 kernels: 1 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 0 limit problems, exit 0. The full zig build kernel-contract stops at UnrecordedRotaryCompiler on pristine main 7bd4b6815a as well, so that is inherited.
  • CI: queued on this head when written. On the parent head a32ece2d4f only desktop and desktop-linux failed, at the app's Typecheck desktop step, identical on main 9d90f12dfb (run 45208593403); this PR touches no app/ files.
  • The accepted text-only style-vector recipe pins checkpoint revision 22d8d538154e0e5b6f8dcb1fcc74a60a0798104c, mlx-lm 0.32.2, mlx 0.32.4 and NumPy 2.5.4. It is a derivation recipe, not an embedded base64 asset or a semantic guarantee.
  • AIFlowML's external M5 Max report independently reports a locally rebuilt H=5120 style vector over layers 24–40 and four off/on weather/tea HTTP responses at context 1024, greedy 48-token output, alpha 0.1, thinking/drafts off. These are short style/mechanism observations, not the long-context or concurrency qualification below.

Receipt

  • Main against branch: with no --glp both norm sites call main's norm and the saved-state identity is main's; steering is off by default. With a vector the opt-in add changes tokens by design.
  • Boxes it reaches: Metal, Qwen3.8-27B only. CUDA, ROCm, Gemma and other families refuse by name.
  • New switch: --glp FILE, --glp-alpha (finite and above zero, else the file's glp.alpha_default); off by default.
  • Environment: base 9edf2f89d4 (main), head 5b7f3845e6 (measured as scratch merge 2035e4a32d); Zig 0.17.0; macOS 27.0 on an Apple M5 Ultra, 30 cores, 256 GB; checkpoint TensorFold/Qwen3.8-27B-MLX-4bit @ 70ae7fac63274ff2eac54152031433374cb80f2f; drafter z-lab/Qwen3.8-27B-DFlash2 @ 50307d4c4cde6860d4eee73e2547cd786fe8e8a4; binaries e4883c2e… (main) and 688c53f7… (head). Steering cells use a synthetic 63-layer unit vector (file 4717ec19…, tensor digest 093762d3…), not a trained asset. Earlier scoped tests ran on an M4 Pro.
  • atc overlap --json: complete=false (snapshot limits). Textual overlaps with open qwen27 Metal: plain greedy picks ride the verify's last command buffer (#2930) #2936 (qwen27/model.zig, quant_gpu.zig) and qwen27 Metal: DSpine drafter for Qwen3.8-27B, opt-in #2634 (qwen27_mtp_flags.zig, qwen27_served.zig) are in shared Qwen27 files.
  • Not run: the full zig build test test-golden; the MTP composition cell on hardware (the pinned checkpoint has no mtp-4bit.safetensors and an M5 refuses the head by design; zig build test-qwen27-startup-host covers the layer-63 stages, 27/27).
  • M5 exactness (20 rows, 2,048 to 65,536 tokens, offsets 0/5,000/10,000/0, no --glp): 20/20 token-equal main against head, every row 0 cached with exact prompt tokens; decode -0.5 to -0.1 %. The 1/2/4/8 sweep: every per-stream hash equal in all 16 cells, throughput +0.2 to +1.2 %.
  • Steered parity against the separately ordered reference (M5 Ultra, 4,528-token prompt, DFlash2): the fused steered norm matches it bit for bit (full token ids and text, solo and drafted, greedy and seeded, all 132 stage planes) at alpha 0.1, 0.5, 1, 2 and 4. Before 2370dd9c4f, Metal contracted the steered add into an fma and alpha 0.1 diverged; the kernel now turns contraction off, and a GPU contract cell at 0.1 and 0.3 is red on the old kernel.
  • M5 steered parity (4,528-token prompt, DFlash2), measured before that fix: at 0.1/0.5/1/2/4 and off, greedy and seeded, solo plain = drafted = four concurrent = repeat in every cell. The real restore (chat route, prompt cache on) resumes 4,594 or 4,595 tokens (0.08 s against 3.1 to 4.8 s cold) and equals the flushed cold reply token for token. --glp-alpha 0 is refused at parse; a zero-direction file at alpha 1 is token-identical to off.
  • Steered cost (M5 Ultra, alpha 1, 63 layers, synthetic unit vector, A/B/B/A interleaved, cold prompts, 64 tokens, no drafter): decode 48.00 to 47.91 (2K), 46.16 to 46.06 (8K), 45.35 to 45.29 (16K), 43.39 to 43.34 (32K), 37.73 to 37.76 (64K) tok/s, -0.2% to +0.1%; prefill -1.7% to +0.5%. Solo serving at 4.5K tokens: -0.25% greedy, -0.21% seeded; seeded drafted -0.19%; greedy drafted is not comparable because steering changes the greedy text. An earlier figure here (about -14% decode) came from a non-interleaved block on a contended GPU; the same binary interleaved measures -0.2% to -0.3%.

Remaining landing gates

  1. Main integration: done at 74699cd621; main ea37382cb1 is merged without losing main's Qwen changes or the agreed additive-only policy.
  2. M5 Ultra qualification: measured above on an M5 Ultra: the 20-row off-path matrix, the off-path 1/2/4/8 sweep, the steered parity cells at 0.1/0.5/1/2/4 with a real cache restore, the zero-direction control, the steered 64k rows and the steered sweep. The layer-63 MTP composition check is host-covered (27/27) because the pinned checkpoint has no head file and an M5 refuses the head by design. The maintainer's own M3 Ultra off-path A/B/B/A is a separate receipt.
  3. Checker argument error: fixed on this head (tf-glp-check validates its arguments first and prints the usage), with a regression in test-glp.

Earlier receipts and discussion remain source-bound historical evidence, not a claim that every current-main or long-context gate is green.

Related work

  • #1951: app follow-up to this additive steering policy.
  • #4273: main-based follow-up that ports this additive foundation and adds standalone DeepSeek-V4.1 EXL3 CUDA GLPv3 steering. It retains the original concept/research attribution; its source-pinned device receipts and remaining qualification gates are separate from this PR's Qwen landing gates.

@BlivionIaG BlivionIaG changed the title GLP support: apply a control vector to Qwen3.8-27B on Metal at inference time (the model's effective weights change on the fly; the checkpoint does not) Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B Nov 1, 2026
@BlivionIaG
BlivionIaG force-pushed the feature/glp-steering branch 2 times, most recently from 51cc5e2 to f57cc5d Compare November 1, 2026 14:22
@ashhart

ashhart commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG. We reviewed this independently. We'd take the generic, opt-in --glp control-vector mechanism with its fused Metal norm-and-projection kernel. Three changes:

  1. Split out the app. The 34 files under app/ (the settings panel, IPC, preload and 13 locale packs) go in their own PR. App changes go through the app's own review.
  2. Refuse repeated layer ids. direction.5 and direction.05 both parse to 5, read() sorts but doesn't refuse, and steer.init keeps the later one. Please refuse a repeat in glp.read, with a test. A layer id past the model's depth is refused only after the 27B loads, though num_hidden_layers is readable at startup, so refuse it there.
  3. One GGUF reader. A second zig/src/core/gguf.zig collides with the GGUF reader now on main (core: a GGUF reader and an exact repack of GGUF's quantized blocks (#1920, steps 1-2) #1926). Please build on that one, or rename yours.

On scope, our decision: the engine ships the mechanism only. Please leave out the matched harmful and harmless prompt sets, the deriver, and the receipts measuring refusal removal on the 27B. Deriving vectors that remove a model's safety refusals isn't something we'll ship or document in TensorFold. A user can supply their own direction files.

BlivionIaG added a commit to BlivionIaG/TensorFold that referenced this pull request Nov 2, 2026
Review changes from ashhart#1835:
- the app's settings panel, IPC, preload and locale packs move to
  feature/glp-steering-app, so app changes go through the app's review
- glp.read refuses a file that names one layer twice (direction.5 and
  direction.05 both parse as 5), with a test
- the serve refuses a layer id past the checkpoint's num_hidden_layers at
  startup, before the model loads
- the GLP container is read by the engine's own GGUF reader; its writer stays
  in glp.zig, so there is one GGUF reader
- the deriver, the matched prompt sets, the refusal-measurement gate and their
  receipt are removed; a vector file is supplied by the operator
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

All three changes are in, plus the scope cut.

  • App: the 32 app files moved to app: control vector picker and strength in Engine advanced #1951; app/ no longer appears in this PR's diff.
  • Repeated layer ids: glp.read now refuses a file that names one layer twice, with a test. A layer id past the checkpoint's num_hidden_layers is refused in glp_startup.refusal, at startup, before the model loads — two tests cover the boundary.
  • GGUF reader: the branch's zig/src/core/gguf.zig is gone; the GLP reader now parses with main's gguf.Document. Only the writer stays local to glp.zig.
  • Scope: the deriver, both prompt sets, the refusal-measurement gate and the receipt are removed; the guide and README describe the mechanism only.

The branch is merged with upstream/main at 16d95ccec and pushed as feature/glp-steering (head 7f83ebb0). zig build test-glp passes 57 tests and zig build test-glp-serve 25.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

CI caught one thing the local suites did not: after merging main, glp.zig importing the engine's gguf.zig put that file in two modules (engine_api and core), and every target linking both failed to compile.

Fixed in b81f6002: the GLP container reader is zig/src/core/glp_container.zig, named for its scope — the review's stated alternative — so the engine's gguf.zig stays the engine's reader. Repeated-layer and depth refusals are unchanged. zig build tf-qwen27-served-check compiles the server path, and the GLP suites still pass.

@ashhart

ashhart commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG. The 18:50 push answers every 17:58 ask:

Off by default is main (Model.steer null, both norm sites call main's norm), and the file is validated before use. Four small things left:

  1. The startup depth check reads num_hidden_layers from the config root only, while hidden_size and the engine read text_config. So a nested config skips the check until after load. Please read it from text_config too, with a nested-config test.
  2. Add-mode directions aren't checked for NaN or infinity. Please refuse non-finite values in both modes.
  3. Lean is 426 against main's 424 (core/glp.zig:161, core/glp_container.zig:1).
  4. The changelog and docs still say the engine's own GGUF reader is used, but it's the new container reader now.

It's 38 commits behind main, so a rebase with these would be ideal.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

CI is green on 2f90635ad (all 11 checks pass).

Two things came out of the first full run:

  • The lean gate counted three new problems: two comment lines and qwen27_served.zig past 600 lines. The serve-side steering helpers moved to qwen27_steer_served.zig (90 lines), qwen27_served.zig is back to 521, and the comments are one line each. lean_check now reports 424 problems, 424 on the base, 0 new.
  • zig and zig-windows failed on a regression already on main (linear_time.Fastest indexed as an array in cortheon/program.zig). Main's 5fe74ebb9 fixes it; this branch merges that tip.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG: the rebase applies on main and lean is back to 424 (the served helpers moved verbatim). Three asks are still open: (1) modelOf reads num_hidden_layers from the config root, not text_config; (2) glp.zig:read checks finiteness only in project mode, so add-mode directions aren't checked; (3) the changelog and docs still say the engine's own GGUF reader is used. Nothing cleared earlier changed.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

All three are in, fd0388546.

  • Depth from text_config. modelOf now reads num_hidden_layers from text_config, falling back to the config root. A nested-config test writes a config whose depth lives only in text_config and holds the depth refusal before load.
  • Non-finite directions refused in both modes. glp.read scans every direction component before the mode-specific rule and refuses NaN and ±infinity in project and add, with a test that writes each through both modes. The project-mode unit-norm check no longer carries its own isFinite guard, since the scan precedes it.
  • Reader named. The changelog and the guide now say core/glp_container.zig reads the GGUF v3 subset a vector needs, not the engine's gguf.zig. The guide's refusal table also lists non-finite directions.

zig build test-glp, zig build test-glp-serve and zig build tf-qwen27-served-check pass. lean_check reports 424 problems, 424 on the base, so nothing new.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

End-to-end run on an M4 Pro, macOS, native Metal server built from fd0388546 (zig build native, Zig 0.17.0).

The served checkpoint's config.json carries its depth only in text_config (text_config.num_hidden_layers = 64, text_config.hidden_size = 5120; no root num_hidden_layers/hidden_size), so this run exercises the nested-config path:

  • A vector naming layer 64 (direction.64, 5120 wide, project) is refused in 0.21 s, before the model loads: --glp: the vector steers layer 64 of a model with 64 layers: its deepest layer is 63.
  • An add-mode vector with one NaN component is refused in 0.02 s: argument --glp: layer 10's direction holds a value that is not finite.
  • A 63-layer vector naming layers 1-63 is accepted at the boundary and serves: glp on: ... (mode: project; alpha: 1.00; layers: 63 (1-63); base: Qwen/Qwen3.8-27B @ 1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0; digest: d92fddd15d08 (verified)), then control vector in force: project mode, alpha 1.000, 63 layers (1-63).

Serving with the published 49-layer vector from msuiche/Qwen3.8-27B-abliterated-cyber-GLP-49 (mode: project, layers 10-58, digest verified) and the prompt "Write a haiku about the sea." at temperature 0.2, enable_thinking: false:

  • steered: "Waves crash on the shore, / White foam dissolves in the blue, / Silence takes the tide." (24 completion tokens)
  • the same build without --glp: "Salt spray on the wind, / Waves crash against the dark shore, / Moonlight on the foam." (23 completion tokens)

So the projection changes the served tokens on a benign prompt, and the fused path runs. Both servers were stopped after the requests; the throwaway generator used for the refusal files and the files themselves are not in the tree.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG. An independent re-review of fd0388546 finds all three open asks met. Without --glp, Qwen3.8-27B on Metal runs main's path: no steer, no new pipeline compiled, no extra report line. Every refusal names its cause.

One rebase is needed. On current main, 42 of the 43 files apply. The only conflict is the all_metal line in core/contract/registry.zig: main has since appended ling_route_records.zig and this PR appends steer_records.zig, so keep both. The other shared lists (core/contract.zig, build.zig, zig/build/qwen27.zig's parts) may need the same keep-both.

Once it's rebased, we'll run the Mac cells on an M5 Ultra and land it on a clean result:

  • off against main: token_sha256 equal, default and --no-drafts, at 1 and 2 streams;
  • on, with a project-mode vector at --glp-alpha 1.0: decode within 1% of off;
  • the four refusals by name;
  • norm_steer through the Metal kernel contract.

@BlivionIaG
BlivionIaG force-pushed the feature/glp-steering branch from fd03885 to b61f6fe Compare November 3, 2026 07:33
BlivionIaG added a commit to BlivionIaG/TensorFold that referenced this pull request Nov 3, 2026
Review changes from ashhart#1835:
- the app's settings panel, IPC, preload and locale packs move to
  feature/glp-steering-app, so app changes go through the app's review
- glp.read refuses a file that names one layer twice (direction.5 and
  direction.05 both parse as 5), with a test
- the serve refuses a layer id past the checkpoint's num_hidden_layers at
  startup, before the model loads
- the GLP container is read by the engine's own GGUF reader; its writer stays
  in glp.zig, so there is one GGUF reader
- the deriver, the matched prompt sets, the refusal-measurement gate and their
  receipt are removed; a vector file is supplied by the operator
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main at ef9fa700a; head is efd421d96, and the diff is 43 files.

The conflict was all_metal in core/contract/registry.zig: both sides kept, so the list now ends ... @import("ling_route_records.zig").records ++ @import("steer_records.zig").metal;. The only other conflicts were the branch's own core/gguf.zig add against main's GGUF reader, in two intermediate commits; resolved to main's reader, and the final tree has no branch copy — glp.zig reads glp_container.zig. The shared lists in core/contract.zig, build.zig and zig/build/qwen27.zig auto-merged, with both additions kept.

zig build test-glp and zig build test-glp-serve (26/26) pass, zig build tf-qwen27-served-check compiles, and lean_check reports 424 problems, 424 on the base. The one added commit is the guide naming the GLP release the tap now ships (v1.2.1-glp.1, upstream 1.2.1 plus this branch).

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

All 11 checks pass on efd421d96: zig, zig-windows, zig-macos-dev-tools, fmt, desktop, desktop-linux, mobile, appimage-linux, release-paths and both benchmark-clients jobs.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG. Two of the four Mac checks are in, on an M5 Ultra at your rebased head:

  • Off against main (no --glp, Qwen3.8-27B-MLX-4bit, fresh servers, base-new-new-base): GREEN. Tokens are equal and every cell is level.
  • Metal kernel contract (--only qwen27): norm_steer passes gates 1-4 with its control red, and there are 0 limit problems.

Still owed, and these need your vector files:

  1. on, with a project-mode vector at --glp-alpha 1.0: the startup line, and decode within 1% of off;
  2. the four refusals by name before load (a nested config past depth, an add-mode NaN vector, --glp with no file, a CUDA build given --glp).

If you post those two receipts from your Mac, this lands on them.

@BlivionIaG

BlivionIaG commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Mac receipts on efd421d96

Apple M4 Pro, 48 GiB, macOS 26.5.1, Zig 0.17.0. Native Metal server built with zig build native (110 s), tensorfold-native 1.2.1.

On at --glp-alpha 1.0

Vector: msuiche/Qwen3.8-27B-abliterated-cyber-GLP-49, Qwen3.8-27B-abliterated-cyber-GLP-49-L10-58-a1.gguf — project, alpha 1.0, layers 10-58, digest da81a8b364de (verified).

[tensorfold] glp on: $V49 (mode: project; alpha: 1.00; layers: 49 (10-58); base: Qwen/Qwen3.8-27B @ 1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0; digest: da81a8b364de (verified))
info: Qwen3.8-27B: control vector in force: project mode, alpha 1.000, 49 layers (10-58), base Qwen/Qwen3.8-27B @ 1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0, digest da81a8b364de

The startup line is verbatim; $V49 is the resolved cache path, set in the recipe below.

Decode: same binary, fresh server per run, --context 2048, default drafts, tools/bench_openai.py --tokens 64 --reps 5 --temperatures 0, interleaved off / on / off / on so thermal drift cancels. (A single off run immediately after the build read 14.84 tok/s; the machine had drifted by the time of the paired runs, so only the four-run A/B is comparable.)

prompt off 1 on 1 off 2 on 2 off mean on mean delta
fibonacci-raw 13.9855 13.9951 13.8591 14.0267 13.9223 14.0109 +0.64%
gpu-chat-no-think 13.9507 13.8885 13.9249 13.9714 13.9378 13.9300 -0.06%

Both prompts are inside 1% of off; the spread is the run-to-run noise, not a steering cost.

Four refusals by name

1. Nested config past depth. /tmp/tf-glp-nested/config.json carries depth and width only under text_config (num_hidden_layers = 32, hidden_size = 5120), with no root num_hidden_layers/hidden_size. A 63-layer vector:

$ tensorfold-native serve /tmp/tf-glp-nested --glp .../Qwen3.8-27B-abliterated-cyber-GLP-63-L1-63-a1.gguf --context 1024
tensorfold: --glp: the vector steers layer 32 of a model with 32 layers: its deepest layer is 31
error: GlpRefused

Exit 1 in 0.19 s, before the model is touched.

2. Add-mode NaN. A one-layer add file with direction.10[0] = NaN:

$ tensorfold-native serve TensorFold/Qwen3.8-27B-MLX-4bit --glp /tmp/glp-nan-add.gguf --context 1024
tensorfold serve: error: argument --glp: layer 10's direction holds a value that is not finite

Exit 2 in 0.012 s, at argument parsing.

3. --glp with no file.

$ tensorfold-native serve TensorFold/Qwen3.8-27B-MLX-4bit --glp
tensorfold serve: error: argument --glp: expected one argument

Exit 2 in 0.010 s.

4. CUDA build given --glp. Cross-compiled from the same tree for aarch64-linux-gnu (zig build native -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseSafe) and run in a Debian bookworm container; the Mac has no NVIDIA GPU. The model directory held the checkpoint's config.json and tokenizer files (no weights), and the vector was the same 49-layer file:

$ /tf serve /run/model --glp /run/vec/vector.gguf --context 1024
tensorfold: --glp: only the Metal engine steers: this server runs the CUDA engine
error: GlpRefused

Exit 1. The engine-open path refuses before any weights load; the text/tokenizer load runs alongside it, as startup.both always does. A refusal on a real CUDA host is still the one thing not exercised here.

Recipe: exact commands
git clone https://github.com/BlivionIaG/TensorFold.git
cd TensorFold
git checkout efd421d9615956bd3b414ab87e1305c59270c39f
# Zig 0.17.0 must be on PATH.
zig build native        # Metal server
zig build tf-glp-check  # tf-glp-check

Off/on decode (fresh server per run; only --glp/--glp-alpha differ):

V49=$(ls ~/.cache/huggingface/hub/models--msuiche--Qwen3.8-27B-abliterated-cyber-GLP-49/snapshots/*/Qwen3.8-27B-abliterated-cyber-GLP-49-L10-58-a1.gguf)

# off
./zig-out/native/bin/tensorfold-native serve TensorFold/Qwen3.8-27B-MLX-4bit \
  --context 2048 --port 8123 --host 127.0.0.1 --name bench --no-update-check

# on
./zig-out/native/bin/tensorfold-native serve TensorFold/Qwen3.8-27B-MLX-4bit \
  --glp "$V49" --glp-alpha 1.0 \
  --context 2048 --port 8123 --host 127.0.0.1 --name bench --no-update-check

# for each server, once it is listening:
python3 tools/bench_openai.py http://127.0.0.1:8123 Qwen3.8-27B-MLX-4bit \
  --tokens 64 --reps 5 --temperatures 0 --output /tmp/bench.json

Nested-config fixture:

import glob, json, os, shutil
snap = glob.glob(os.path.expanduser(
    "~/.cache/huggingface/hub/models--TensorFold--Qwen3.8-27B-MLX-4bit/snapshots/*/"))[0]
out = "/tmp/tf-glp-nested"
shutil.rmtree(out, ignore_errors=True)
os.makedirs(out)
for name in os.listdir(snap):
    os.symlink(os.path.realpath(os.path.join(snap, name)), os.path.join(out, name))
d = json.load(open(os.path.join(snap, "config.json")))
d.pop("num_hidden_layers", None)
d.pop("hidden_size", None)
tc = d.setdefault("text_config", {})
tc["num_hidden_layers"] = 32
tc["hidden_size"] = 5120
json.dump(d, open(os.path.join(out, "config.json"), "w"), indent=2)

Throwaway NaN-vector generator (zig/src/core/tmp_glp_bad.zig, deleted after the run):

const std = @import("std");
const glp = @import("glp.zig");
const gguf = @import("glp_container.zig");

const width = 5120;

pub fn main(init: std.process.Init) !void {
    const a = init.arena.allocator();
    const args = try init.minimal.args.toSlice(a);
    if (args.len != 3) return error.Usage;
    const kind = args[1];
    const out_path = args[2];

    var dir = try a.alloc(f32, width);
    for (dir) |*v| v.* = 0;
    dir[0] = 1;

    if (std.mem.eql(u8, kind, "deep")) {
        const layers = [_]glp.Layer{.{ .id = 64, .dir = dir }};
        const bytes = try glp.write(a, .{
            .mode = .project,
            .alpha = 1,
            .hook_point = glp.residual_site,
            .derived_at = null,
            .base_model = "TensorFold/Qwen3.8-27B-MLX-4bit",
            .base_revision = "",
            .method = "test",
            .contrast = "",
            .layers = &layers,
        });
        try std.Io.Dir.cwd().writeFile(init.io, .{ .sub_path = out_path, .data = bytes });
        return;
    }
    if (std.mem.eql(u8, kind, "nan-add")) {
        var raw = try a.alloc(u8, width * 4);
        std.mem.writeInt(u32, raw[0..4], @bitCast(std.math.nan(f32)), .little);
        @memset(raw[4..], 0);
        const entries = [_]gguf.Entry{
            .{ .key = "general.architecture", .value = .{ .string = "controlvector" } },
            .{ .key = "glp.spec_version", .value = .{ .u32v = 1 } },
            .{ .key = "glp.mode", .value = .{ .string = "add" } },
            .{ .key = "glp.rank", .value = .{ .u32v = 1 } },
            .{ .key = "glp.hook_point", .value = .{ .string = glp.residual_site } },
            .{ .key = "glp.alpha_default", .value = .{ .f32v = 1 } },
            .{ .key = "glp.base_model", .value = .{ .string = "TensorFold/Qwen3.8-27B-MLX-4bit" } },
        };
        const dims = [_]u64{width};
        const tensors = [_]gguf.OutTensor{.{ .name = "direction.10", .dims = &dims, .kind = gguf.f32_type, .data = raw }};
        const bytes = try gguf.write(a, &entries, &tensors);
        try std.Io.Dir.cwd().writeFile(init.io, .{ .sub_path = out_path, .data = bytes });
        return;
    }
    return error.UnknownKind;
}
zig run zig/src/core/tmp_glp_bad.zig -- nan-add /tmp/glp-nan-add.gguf
rm -f zig/src/core/tmp_glp_bad.zig

CUDA build and container run:

zig build native -Dtarget=aarch64-linux-gnu -Doptimize=ReleaseSafe
mkdir -p "$HOME/tf-glp-cuda/run/model" "$HOME/tf-glp-cuda/run/vec"
cp zig-out/native/bin/tensorfold-native "$HOME/tf-glp-cuda/tensorfold-native-cuda-aarch64"
# rebuild the Metal binary afterwards, since the cross-build writes the same path:
zig build native

# populate run/model with the checkpoint's config.json and tokenizer files (no weights),
# and run/vec with the 49-layer vector above.
python3 - <<'PY'
import glob, os, shutil
home = os.path.expanduser("~")
snap = glob.glob(home + "/.cache/huggingface/hub/models--TensorFold--Qwen3.8-27B-MLX-4bit/snapshots/*/")[0]
model = home + "/tf-glp-cuda/run/model"
for name in ("config.json", "generation_config.json", "tokenizer.json", "tokenizer_config.json",
             "vocab.json", "chat_template.jinja", "preprocessor_config.json",
             "processor_config.json", "model.safetensors.index.json"):
    src = os.path.join(snap, name)
    if os.path.exists(src):
        shutil.copy(os.path.realpath(src), os.path.join(model, name))
vec = glob.glob(home + "/.cache/huggingface/hub/models--msuiche--Qwen3.8-27B-abliterated-cyber-GLP-49/snapshots/*/Qwen3.8-27B-abliterated-cyber-GLP-49-L10-58-a1.gguf")[0]
shutil.copy(os.path.realpath(vec), home + "/tf-glp-cuda/run/vec/vector.gguf")
PY

podman run --rm --platform linux/arm64 \
  -v "$HOME/tf-glp-cuda/tensorfold-native-cuda-aarch64:/tf:ro" \
  -v "$HOME/tf-glp-cuda/run:/run:ro" \
  docker.io/library/debian:bookworm-slim \
  /tf serve /run/model --glp /run/vec/vector.gguf --context 1024 --port 8193

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG for both receipts. On-mode decode is within 1% of off, and all four refusals stop by name before load. A few things before it lands:

  1. It conflicts with main again, so please rebase.
  2. Please remove the "The engine that steers" section from docs/control-vectors.md. Once this is merged, --glp ships in TensorFold itself, so the docs shouldn't point to another tap or release.
  3. In glp_publication_test.zig, please use a neutral contrast string in the sample metadata, in line with the scope we agreed.

We'll check the CUDA refusal ourselves on a GB10.

@BlivionIaG
BlivionIaG force-pushed the feature/glp-steering branch from efd421d to b721c88 Compare November 4, 2026 07:15
BlivionIaG added a commit to BlivionIaG/TensorFold that referenced this pull request Nov 4, 2026
Review changes from ashhart#1835:
- the app's settings panel, IPC, preload and locale packs move to
  feature/glp-steering-app, so app changes go through the app's review
- glp.read refuses a file that names one layer twice (direction.5 and
  direction.05 both parse as 5), with a test
- the serve refuses a layer id past the checkpoint's num_hidden_layers at
  startup, before the model loads
- the GLP container is read by the engine's own GGUF reader; its writer stays
  in glp.zig, so there is one GGUF reader
- the deriver, the matched prompt sets, the refusal-measurement gate and their
  receipt are removed; a vector file is supplied by the operator
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Rebased onto 8db1ee1a3; head is b721c88ae.

  • Removed the external-build section from docs/control-vectors.md. The guide now documents only the in-tree --glp surface and points at no tap or release.
  • Neutralized the sample metadata: the publication sample no longer names refusal or harm, and the contrast sample reads matched_prompts_unpaired.
  • Resolved the rebase conflicts: metal_main.zig keeps the attention and steering imports; engine_api.zig keeps upstream's engine_request_controls.zig, so the branch no longer duplicates those request shapes.

zig build test-glp, zig build test-glp-serve and zig build tf-qwen27-served-check pass locally. CI is running on the new head. The CUDA refusal is yours to check on the GB10.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

release-paths caught one rebase follow-on: the contract imported bf16_round.zig by path, and the release build also gives that file its own module. Fixed in 9c90e0956 by importing the module. Head is now 9c90e0956; test-glp, test-glp-serve, tf-qwen27-served-check and check-release-paths pass locally.

BlivionIaG added a commit to BlivionIaG/TensorFold that referenced this pull request Nov 4, 2026
Review changes from ashhart#1835:
- the app's settings panel, IPC, preload and locale packs move to
  feature/glp-steering-app, so app changes go through the app's review
- glp.read refuses a file that names one layer twice (direction.5 and
  direction.05 both parse as 5), with a test
- the serve refuses a layer id past the checkpoint's num_hidden_layers at
  startup, before the model loads
- the GLP container is read by the engine's own GGUF reader; its writer stays
  in glp.zig, so there is one GGUF reader
- the deriver, the matched prompt sets, the refusal-measurement gate and their
  receipt are removed; a vector file is supplied by the operator
@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thank you, @BlivionIaG. We ran the off path on an M3 Ultra with Qwen3.8-27B, main against this branch (builds alternated base, new, new, base): tokens identical (0 of 20 prompt rows differ) and speed within run spread, so with no vector this changes nothing.

What remains is the steered side from our last review: exact serial parity with steering on across strengths, and the longer-context and concurrent comparisons, at this head.

  • Synthena

@BlivionIaG

BlivionIaG commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @ashhart. The steered side is measured on an M5 Ultra (main 9edf2f89d4 with 5b7f3845e6 as a local scratch merge 2035e4a32d, since the head conflicted with main in CHANGELOG.md; the PR head is now 1cd8399312, a merge of current main, and the GLP steps pass on it). Checkpoint TensorFold/Qwen3.8-27B-MLX-4bit @ 70ae7fac6327, DFlash2 drafter for the steered cells, Zig 0.17.0. The vector is synthetic (63 deterministic unit directions, layers 1-63; file sha256 4717ec19…), not a trained asset.

  • Steering off, same tree: the 20-row matrix (2,048 to 65,536 tokens) is token-equal 20/20, and the 1/2/4/8 sweep has every per-stream hash equal in 16 of 16 cells; speed within +0.2 to +1.2 %. This agrees with your M3 Ultra result.
  • Exact steered serial parity across strengths: at 0.1, 0.5, 1, 2 and 4, greedy and seeded, the solo reply equals the drafted reply, the four concurrent replies and the repeat in all 12 cells. The repeat is a real chat-route restore (4,594 or 4,595 cached tokens, 0.08 s against 3.1 to 4.8 s cold) and equals the flushed cold reply token for token. Drafted runs accept real drafts (for example 50/210 at 0.1).
  • Loaded zero: --glp-alpha 0 is refused at parse (finite strength above 0), so the control is a zero-direction file at alpha 1; it is token-identical to off, greedy and seeded.
  • Longer context: 20 steered rows at alpha 1 from 2,048 to 65,536 tokens complete with exact prompt tokens and 0 cached; decode goes 48.1 to 41.4, 46.2 to 40.0, 45.4 to 39.4, 43.2 to 37.1, 37.9 to 31.3 tok/s.
  • Concurrent: the steered 1/2/4/8 sweep with the drafter (--alone --serial) keeps every concurrent reply equal to its solo run and every serial drafted reply equal to plain, with real drafts accepted (so serial is not vacuous); throughput against off is -18.8 to +7.8 % across the code/chat, T=0/1 cells.
  • Layer-63 MTP composition: not runnable on this backend. The pinned checkpoint ships no mtp-4bit.safetensors, and the M5 refuses --mtp-drafts by design. The host check passes: test-qwen27-startup-host 27/27, including the test that the target resolves the layer-63 direction and the head's stages resolve none.

No divergence in any equality cell. The body carries the summary of each cell; the per-cell hashes are in the run records.

@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thanks @BlivionIaG. The new off-path, cached-restore and concurrent comparisons are useful, and the earlier parser and MTP fixes remain present.

One distinction remains: solo versus drafted execution uses the same fused steering arithmetic. We still need its byte comparison with the separately ordered steering reference. Please retain the full checkpoint, vector and drafter identities with the scratch-tree receipt, including the measured steering costs.

The current-main composition and the MTP check on a supported backend remain ours.

  • Synthena

Main's SenseNova support turned the qwen27 norm into normShift and filled quant_gpu.zig to its 600-line limit. The steered norm now dispatches from norm_steer_gpu.zig with its pipeline held by the steering plan, unsteered norms call main's normShift, and SenseNova models refuse a control vector.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Merged main 4c79cfe346; it conflicted after main's SenseNova norm and Qwen host refactors. Unsteered norms now call main's normShift unchanged (quant_gpu.zig is byte-identical to main; the steered norm moved to qwen27/norm_steer_gpu.zig to keep it under 600 lines), and SenseNova checkpoints (looped or shifted-norm) refuse --glp, since the steered kernel has no mHC and no shifted gains. Head 178a01a70b: test-glp test-glp-serve test-steer test-glp-steer test-qwen27-startup-host native 92/92 steps, 132/132 tests; tf-kernel-contract --only steer exit 0 (1 pass, nan control red as planted, 0 limit problems) on the M4 Pro; pr_check 0/0, lean 165 vs 165, fmt clean. Your last request (solo versus drafted steering against the separately ordered reference, with the full checkpoint, vector and drafter identities) is still open; I will post it separately.

Metal contracted hv + alpha * d in the steered norm into one fused multiply-add. At strengths whose products round (0.1, 0.3) that differs in the bf16 stream from the separately ordered reference the contract declares; powers of two were exact either way, and the GPU suite ran only at 1.0. The kernel now turns contraction off, and the suite checks the steered row bit for bit against the separately rounded add at 0.1 and 0.3 on rows built to sit on a bf16 tie, with a planted contracted kernel that must differ in every element.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Thanks. The byte comparison found a real mismatch. Metal compiled the steered norm's hv + alpha * d into one fused multiply-add. The separately ordered reference rounds the fp32 product alpha·d on its own, then does the fp32 add, then bf16, then main's input norm. At alpha 0.1 that changed greedy and seeded tokens on the M5 Ultra; the first difference is layer 1's steered stream at prompt row 78. Solo and drafted still agreed with each other because both use the same fused arithmetic. At 0.5, 1, 2 and 4 the product is exact, so all 132 recorded planes (every block, final norm, logits) were byte-equal. The contract missed it: its GPU suite ran only at strength 1.0 and checks a float64 bound that an fma result stays inside.

Fix in a86339038c: #pragma clang fp contract(off) in norm_steer.metal, and a GPU contract cell at alpha 0.1 and 0.3 on rows built so the two orders must differ. The new cell is red on the old kernel and green on the fix, with a planted contracted control red.

Fixed build (a86339038c) on the M5 Ultra, 4,528-token prompt, 256 tokens, compared with the separately ordered reference:

alpha greedy solo / drafted seeded solo / drafted stage planes (greedy, seeded)
0.1 b1b7abcb3f76… = ref, both 5d60b2a2ebc6… = ref, both 132/132 equal, 132/132 equal
0.5 41e9b7876c24… = ref, both a13e272cf214… = ref, both 132/132, 132/132
1 34b9a8ec752e… = ref, both 22fecdafc6d6… = ref, both 132/132, 132/132
2 aa6f937d620c… = ref, both 0729bd61aade… = ref, both 132/132, 132/132
4 22ff63217d54… = ref, both dc7b39ad9d2f… = ref, both 132/132, 132/132

"= ref" means full token ids and text bytes match, not only the hash prefix. Each stage comparison covers 6,494,299,655 bytes. Before the fix, alpha 0.1 gave cc8b4624… (greedy) and 38cbcf10… (seeded).

The steering cost on the fixed build is being re-measured against the earlier figures in the body, because the two do not agree yet; I will post it separately.

Identities: checkpoint TensorFold/Qwen3.8-27B-MLX-4bit @ 70ae7fac63274ff2eac54152031433374cb80f2f (shards 6cc1508e…, 83f2a20c…, 31b8c91e…, matching HF). Drafter z-lab/Qwen3.8-27B-DFlash2 @ 50307d4c4cde6860d4eee73e2547cd786fe8e8a4 (67fc76d6…). Vector sha256 4717ec195a90ae82f0dafb8c873527fa00728f31e23dab3168230540d46e309d: 63 F32 directions of shape [5120], layers 1–63, tensor digest 093762d3…, synthetic. Apple M5 Ultra, 30 cores, 256 GB, macOS 27.0, Zig 0.17.0.

ashhart pushed a commit to BlivionIaG/TensorFold that referenced this pull request Nov 25, 2026
- Reuse the native reader and Qwen additive path from c5947a8 on upstream main.
- Preserve weightless/@msuiche, original directional-research and llama.cpp attribution; no project mode or vector assets.
- Correct tf-glp-check missing-output argument handling before I/O, with actual CLI regression checks.
- Host and compile-only gates pass; Metal GPU/runtime qualification remains separate.
ashhart pushed a commit to BlivionIaG/TensorFold that referenced this pull request Nov 25, 2026
- Extend ashhart#1835’s additive reader with strict GLPv3 paired-site admission; retain the original format, research and native implementation credits.
- Add immutable add-only GPU plans, TP policy agreement, checkpoint binding, and decode/whole-prefill integration without changing the release refusal or importing the fork Metal backend.
- Verify paired parsing/startup host tests, 317 host tests with two platform skips, Linux CUDA/tool compile gates, and a real GLPv3 checker round trip. GPU qualification remains pending.
ashhart pushed a commit to BlivionIaG/TensorFold that referenced this pull request Nov 25, 2026
One changelog line for the feature, as the maintainer asked on ashhart#1835, and the --glp rows name the DeepSeek CUDA paired site that takes its own file instead of reading as a blanket CUDA refusal.
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Steering cost on the fixed build (a86339038c), M5 Ultra, alpha 1, 63 layers, A/B/B/A interleaved, cold prompts, 64 tokens, no drafter: decode 48.00 to 47.91 (2K), 46.16 to 46.06 (8K), 45.35 to 45.29 (16K), 43.39 to 43.34 (32K), 37.73 to 37.76 (64K) tok/s, so -0.2% to +0.1%; prefill -1.7% to +0.5%. Solo serving of the 4,528-token prompt: -0.25% greedy, -0.21% seeded; seeded drafted -0.19%; greedy drafted is not comparable (steering changes the greedy text, and the steered text accepts more drafts). Steering is on in these rows: the server logs the vector in force (alpha 1, 63 layers) and the steered token hashes differ from the off arm's in 17 of 20 rows. I also corrected the body: it carried an earlier figure of about -14% decode, which came from a non-interleaved block on a contended GPU; the same older binary, interleaved, measures -0.2% to -0.3% at 2K and 64K rows.

# Conflicts:
#	CHANGELOG.md
#	zig/src/native/metal.zig
#	zig/src/native/qwen27_served.zig
@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Merged upstream/main, which adds --slide (Folded Memory). The qwen27 open options now carry both .glp and .slide, and both GLP CHANGELOG entries are back under Unreleased, once each. The GLP and Metal-open host steps pass. Head 2370dd9c4f.

@BlivionIaG

Copy link
Copy Markdown
Contributor Author

Proposed gate: additive GLP steering for Inkling 2 Mini on Metal. Following the 22 Nov note on #1834, I'm posting this here before opening a PR. It would stack on #4273 and land after it. Same policy: add mode only, off by default, no refusal vectors, measurements or links.

Hook. Each decoder pass's output: the BF16 partial that tf_ink2_mlp_partial writes (families/inkling2/metal/forward.zig). It is the value the reference decoder layer returns (huggingface/transformers#51050), and everything after it reads it: the next pass's attention-residual mix, block-boundary stores, the pass bank, DSpark taps 5/23/41 and the final norm. Inkling's residual add is not fused with the next norm, so no norm kernel changes.

Indexing by pass. direction.N is the output of zero-based pass N, N = 1..47 (layers 6-17 run three passes, so a token makes 48 passes). Core layer 6 owns passes 6, 18 and 30, each with its own direction. The bound comes from text_config.loop_config through the family's plan, not from num_hidden_layers (24 weight layers).

Kernel. A steered variant of the partial write: p = bf16(bf16(t + x) + alpha*d) under #pragma clang fp contract(off). It uses the same rounding order as #4273's norm_steer: the residual is rounded first and the product rounded on its own. Unsteered passes, and every server without --glp, launch main's mlp_partial unchanged, and no new pipeline is compiled. DSpark reads taps that are already steered, so nothing is applied twice; a regression test pins that.

Exactness against main and within the engine (an M5, and an M1-M4 class chip):

  1. Off path: no --glp against main with your 20-row protocol (2,048 to 65,536 tokens; offsets 0/5,000/10,000/0; base, new, new, base) and the 1/2/4/8 --alone --serial sweep, default and --no-drafts. Bar: equal token_sha256 and level speed.
  2. Loaded zero: a zero-direction file, and --glp-alpha 0, are token-identical to off and still name the file.
  3. Same-setting steered parity at several strengths, greedy and seeded: solo = drafted = four concurrent = repeat = prompt-cache resumed.
  4. Ordering: the fused op against a separately rounded reference (main's mlp_partial, then a standalone add), byte-equal in token ids, logits bits and every pass's partial. Planted controls must fail: contracted FMA, wrong pass, NaN.
  5. Layer map: a one-hot direction at pass N changes nothing before pass N.
  6. Kernel contract SUMMARY, with planted controls red and the resource entry on the serving specialization.

Cost and memory. Steering cost measured with A/B/B/A interleaved, on cold 2k/8k/32k/64k prompts, at 1 and 4 streams, with and without --drafter. Bar: decode within 1% of off. Steered draft acceptance is reported separately, since steering changes the target's tokens. Peak process footprint and Metal allocation are compared off against on.

Refusals, by name before load:

  • a project file
  • glp.rank > 1, spec version 2, version 3 or the paired site, a hook other than residual_stream_post_layer
  • direction.0, or a pass index >= 48
  • a loop config that doesn't match (is_varloop, a pass count other than three, or --loops)
  • a width other than 2,304, a non-finite value, a repeated id, or a base model or revision mismatch
  • Inkling with --glp on CUDA or HIP

The vector. Pirate voice, add mode, from the text recipe accepted here (comment 6840174474): the same 12 topics in two forms, through the chat template with thinking effort 0. Capture is each pass's output at the last prompt token, in F32. The direction is the difference of means, with no normalisation. Pinned to thinkingmachines/Inkling-2-Mini @ ed40e7da62. The pass window and strength come from a held-out sweep: ordinary prompts, with a norm-matched random direction and a zero file as controls. Before a default strength ships it passes the spec's dose gate: auto tool_choice tool calls, ordinary-task integrity and finish_reason=length empties against stock, all recorded in glp.validation. The recipe will be posted here as text, and the file published on Hugging Face at a fixed revision with its SHA-256. No binary is attached here.

Card. BlivionIaG/Inkling-2-Mini-pirate-cvec-GLP-<n>-L<first>-<last> (window chosen by the sweep), with the file ...-a<alpha>.gguf. It covers the style results by strength, the dose gates, the recipe, the digests and the limits. It makes no safety or quality claim.

Credits. @msuiche's weightless project defines the GLP format, and the reader implements it; no weightless code, prompts or tools are copied. The additive direction.N convention is llama.cpp's. The pirate-voice recipe is the one accepted in comments 6840174474 and 6870030008. The Inkling Metal lane is the maintainers' (#4387), and the plan is @akol1's #4274.

Does this gate match what you'd want before a PR?

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you for finding and fixing the fused multiply-add mismatch, and for supplying the full checkpoint, drafter and vector identities.

The separately ordered arithmetic and its failing controls address the remaining exactness concern. The MTP head also suppresses the target steering plan in source, so the target's already-steered activations are not steered twice. The steering-off path remains unchanged.

The remaining checks are on the final integrated tree: the steering-off long-context and concurrency matrix, together with the layer-63 MTP composition check on a backend that supports it. Those qualification checks remain on our side; no further source change is requested.

  • Synthena

This branch has not been deployed

No deployments
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.

3 participants