Repository navigation
cli: add tensorfold tfq3 MODEL subcommand for TFQ3 conversion and inspection - #5018
Merged
Merged
Conversation
ashhart
added a commit
that referenced
this pull request
Nov 25, 2026
ashhart
added a commit
that referenced
this pull request
Nov 25, 2026
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 25, 2026 10:20
43bd130 to
cce8a40
Compare
ashhart
added a commit
that referenced
this pull request
Nov 25, 2026
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 25, 2026 10:38
cce8a40 to
aa2941a
Compare
Owner
Author
|
Rebased onto
|
ashhart
added a commit
that referenced
this pull request
Nov 25, 2026
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 25, 2026 11:20
aa2941a to
8f9fccd
Compare
Contributor
|
@ashhart some error paths and options in the converter, read at
|
ashhart
added a commit
that referenced
this pull request
Nov 25, 2026
ashhart
force-pushed
the
feat/tfq3-cli
branch
2 times, most recently
from
November 26, 2026 12:01
c3d8875 to
99dd595
Compare
This was referenced Nov 27, 2026
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 28, 2026 03:39
cbe8769 to
3986d66
Compare
4 tasks done
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 28, 2026 07:16
3986d66 to
d092fbb
Compare
…(~31-38M weights/s)
…and an explicit inspector that is missing
Use explicit conversion admission with ordinary verified pulls and publish requested revision refs. Preserve generic residual choices, normalize local default outputs, and accept the Flash Next MTP shard identity. Validate direct encoder names and head widths, propagate config stat errors, and release scales on allocation failure. Pin each boundary with host regressions and describe native conversion limits.
ashhart
force-pushed
the
feat/tfq3-cli
branch
from
November 28, 2026 08:25
d092fbb to
9edba37
Compare
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.
Summary
Adds the
tensorfold tfq3CLI subcommand so users can pull, convert, and inspect cross-platform TFQ3 checkpoints directly from TensorFold — for both dedicated families and any Safetensors architecture, with zero-install native Zig encoding when the externaltfq3GPU binary is not installed.What's included
tensorfold tfq3 MODEL(zig/src/cli/tfq3.zig,zig/src/cli/cli.zig):owner/name[@revision]), pulling uncached repos throughtensorfold pullunless--no-pullis set.qwen3_5,qwen4_exp,glm5_next) and Qwen3.8-27B residual precision (bf16vs.q8) fromconfig.json.--bits 3|4|5,--target-gib GB,--fit auto|GB,--quantize-vision,--quantize-drafter, or--quantize-embed) to the model-agnostic converter.tfq3(https://github.com/ashhart/TFQ) when installed, fails closed if an explicit--converter PATHis missing, and supports--dry-runandtensorfold tfq3 doctor.zig/src/cli/tfq3_encode.zig):tfq3is not installed (or when--nativeis passed), supporting BF16/F16/F32 Safetensors, arbitrary 2D tensor shapes zero-padded to 128-multiples (TfpnTensorMeta.pad[0..2]),--target-gib/--fit auto(viasys.machine.detect), and--quantize-vision/--quantize-drafter/--quantize-embed.PWV3 v3tables, 16 KiB-alignedTFPN v3shards,residual.safetensors, and copiesconfig.json/ tokenizer files.tensorfold tfq3 inspect [-v] DIR):pw_v3_tables.binand 16 KiB-alignedTFPN/TFPWv3 shards natively whentfq3is absent.zig/src/cli/tfq3_test.zig,docs/quantization.md,CHANGELOG.md):--converterfail-closed behavior,--dry-run,doctor, native inspection + negative alignment controls, and end-to-end native Zig encoding (--bits 4and--fit auto).Verification (Head
43bd130)zig fmt --check build.zig zig— passzig build test-cuda-host— pass (includescli/tests.zig,tfq3_test.zig, and Windowscheckpoint_clicross-compile)zig build native -Dcpu=apple_m1— pass (includinglibc_memcheck)tensorfold-native tfq3 --native --bits 3|4|5→tfq3-inspect -v→reference/tfq3_reference.py):14.59 dB(exact0.00 dBencoder/decoder match,pad_rms = 0.00000)19.73 dB(exact0.00 dBmatch,pad_rms = 0.00000)24.04 dB(exact0.00 dBmatch,pad_rms = 0.00000)python3 tools/pr_check.py --pr 5018—merge base b6ab6dbfd7c6f7cde6e524433ee67dc7fc664c31; 9 changed files; lean 165 vs 165, 0 new; 0 error(s), 0 warning(s)