Skip to content

TensorFold 1.3.5

Latest

Choose a tag to compare

@ashhart ashhart released this 25 Nov 07:49
· 205 commits to main since this release

TensorFold 1.3.5

1.3.5 adds TFQ3, TensorFold's own quantized weight format, for GLM-5.3-Flash and Flash Next on Metal, and brings Inkling 2 Mini to native serving on CUDA and Metal, with images on Metal and large decode speedups on both. New models and paths include SenseNova-Loop-9B on Metal, Ripple-65B-Preview on CUDA, speech input for Nemotron 3.5 Transcribe, ZONOS3 Mini text to speech and Idol end to end on M5. The contributing rules now say exactness is bit for bit: a changed reduction order or rounding point must keep every output bit, by default and with any switch on (#4888).

TFQ3

TFQ3 is TensorFold's own quantized weight format: .tffpw record files and a shared pw_v3_tables.bin beside a checkpoint, loaded zero-copy and run by native Metal kernels. A checkpoint without TFQ3 records takes the same paths as before. Within TFQ3, a repeat equals its prefill and 1-row decode equals multi-row decode, while prompt and decode may differ in the last bits.

  • GLM on Metal: TFQ3 weight loading (layer_XX.tffpw, nonmoe.tffpw, pw_v3_tables.bin) with decode and prefill kernels for M5 and earlier Macs, plus 8-bit/64 KDA split-parts and window kernels. On an M5 Ultra, GLM-5.3-Flash-TFQ3 (139.55 GB on disk) loads in 8.4 s, matches depth 0 == depth 3 bit-identically, prefills p2048 at 1,567 tok/s and decodes at 69.2 tok/s (B=1), 87-104 tok/s with live MTP streaming. Non-TFQ3 checkpoints compile no TFQ3 kernels (#4953).
  • Flash Next on Metal: checkpoints with TFQ3 routed MoE sidecars (pw_v3_tables.bin, layer_XX.tffpw, mtp_00.tffpw) run native TFQ3 kernels for decode (B=1 and deduplicated B=2..16) and prompt prefill; non-TFQ3 checkpoints stay on the existing MLX affine paths. --ple-on-ssd works with TFQ3 and an incompatible --ssd-experts is refused. On an M5 Ultra, Qwen3.8-Flash-Next-TFQ3 (78.99 GiB) reaches 5.996 combined PPL (against 6.007 for the 8-bit source and 6.644 for MLX 4-bit), 3,855 tok/s p2048 prefill, 82.9 tok/s B=1 decode and 154.5 tok/s at MTP depth=3, with bit-exact depth 0 == depth 3 parity (#4964).
  • Release fixes: GLM decode windows of 8 to 16 rows give each row the same bytes as 1-row decode (the prompt pass alone uses the MMA kernels), GLM refuses misaligned 4-bit records, a stray pw_v3_tables.bin no longer turns TFQ3 on for a checkpoint without TFQ3 records (GLM and Flash Next), and Flash Next checks its table file as GLM does (#4996).

Speed

  • Inkling 2 Mini on Metal: routed experts and the combine run a thread per output with the same serial arithmetic, so one-stream decode is about 16x faster on an M5 Ultra and 17x on an M3 Ultra (#4894). The router's and loop gates' dots do the same, so prompts reach the first token about 42% sooner and four streams decode about 64% faster on an M5 Ultra (#4912). DSpark drafting uses the 1/sqrt(128) attention scale and reads kappa as FP32, so one-stream draft acceptance on an M3 Ultra rises from 3% to 55% and drafted decode is about 56% faster (#4447). Tokens and replies are unchanged in each.
  • Inkling 2 Mini on CUDA: expert weights staged a warp at a time make one-stream decode about 70% faster on GB10, four streams about 60% faster and long prompts reach the first token about 25% sooner (#4728); the loop gate as a down and an up half adds about 28% one-stream (#4697), and decode experts a warp over 8 columns about 3% more (#4729). Tokens are identical.
  • Lanes (host sampler): Flint, Llama, Kimi K3 and MiniMax-M3's draws keep a draw's best 1,024 candidates in one bounded heap pass instead of sorting the row, bit for bit the full sort's. On an M4 Pro a sampled stream of a 201,058-token-vocabulary model decodes at 29.2 tokens a second where it did 21.2, and four streams at 56.1 where 33.5; greedy is unchanged (#4744).
  • GLM on Metal: one-Mac GLM-5.3-Flash prefills short remaining work first by default, cutting a short reply beside a long prompt from 6.11 s to 3.56 s with long-prompt TTFT within 1.2% (#3903).
  • Qwen3.8-27B on Metal: Macs with tensor units that are not Ultras take 8-bit prompt chunks in row blocks, as Ultras already did (#3280). On M1-M4 a prompt that runs alone takes the prompt frame's rows per pass (512 by default) instead of 128 (#2916). On M5 and later, row projections take the wide kernel from 8 rows instead of 4 (#4617), and pick their narrow or wide kernel per chip, so an M5 Max no longer runs 8-row and wider windows on the kernel that is slower there (#4730).
  • XPU: Qwen3.8-27B decode attention computes a key's twelve exponentials as one 16-lane vector exp, with every output byte unchanged; on an Arc Pro B70 served drafted decode gains 1.3% at 7,588 prompt tokens, 3.0% at 28,946 and 4.9% at 121,022, and plain decode is level (#4651).
  • Streams beside long prompts: Nemotron on CUDA (#4700) and Gemma 4 on Metal (#3025) fill a new prompt a chunk at a time between other streams' decode rounds, so a long prompt no longer stalls replies already streaming.
  • CUDA: Kolibri-1 decode rounds of two or more rows replay a CUDA graph captured once a shape, with tokens unchanged; TENSORFOLD_KOLIBRI_GRAPHS=0 keeps them eager (#4884). Flash Next on one GPU skips a non-final prompt chunk's last-layer MLP stream and experts, which nothing reads (#4885), and its MTP draft rows' best value, first id and log-sum-exp run over 32 one-warp blocks a row with the same bytes (#4632).
  • Lanes (pricing): drafted lone streams in families that opt in to copy pricing are priced as in 1.3.3 again, up to 2.5% faster at 4 code streams on M3 and M5 Ultra with the DFlash2 drafter (#4688); a lone stream with a fixed-block drafter is priced for its full block (#4457).
  • Other kernels: H3 on Metal runs transformer products on h3_gemm_32x64 with sums unchanged (#4641), Flint draws a shared round's sampled rows in one launch (#4780), HIP decode weighs each slot's rows from one read (#4754), HIP Qwen uses the policy prompt step on lone RDNA 3.5 iGPUs (#4207), the 4-rank RoCE ring relay forwards each half as it arrives, bytes unchanged (#4798), and long H3 image renders on Macs give way to live speech on the GPU (#4650).
  • Opt-in switches, off by default (each PR's line says what it keeps): Nemotron CUDA TF_NEMOTRON_WIDE_ROUNDS=1, decode rounds of up to 16 streams, +2% to +6% at 16 streams on a GB10 (#4741); Qwen3.8-27B Metal TF_Q27_DFLASH_ABSORB_BATCH=1 (#4629), TF_Q27_DFLASH_ADAPTIVE_BLOCK=1 (#4628) and TF_Q27_MTP_GPU_PICK=1 (#4570); Qwen3.5/3.8 CUDA TF_Q35_DFLASH_ABSORB_BATCH=1 (#4648), TF_Q35_GROUP_PROJ=1 (#4515) and TF_QWEN35_ATTN_ALL_ROWS=1 (#4496); Flash Next Metal TF_FN_GX_GATEUP_MB2=1 (refs #1486), TF_FN_GX_SHARED=1 (#4834) and TF_FLASHNEXT_BATCH_GDN_WIDE=1 (#4489); Flash Next CUDA TF_FLASHNEXT_GDN_CHAIN_TPR=1 (#4484) and TF_FLASHNEXT_WINDOW_GRAPH_PARITY=1 (#4492); MiniMax-M3 CUDA TF_MINIMAX_GRAPHS=1 (#4610); Gemma 4 CUDA TF_GEMMA4_ARGMAX_GRAPH=1 (#4616); DFlash2 CUDA TF_DFLASH_QL_SPAN=1 and TF_DFLASH_GRAPH=1 (#4516); GLM TP=2 TF_GLM_WIDE_EXPERT_TILE=1 (#4565); CUDA qmmf TF_QMMF_HALF_BN=1 (#4533); CUDA TF_CUDA_POOL_AFTER_WARMUP=1 (#4591).

New

  • SenseNova-Loop-9B on Metal: served natively through the qwen27 lane backend in BF16 and AWQ 4-bit (group size 128), with its looped 56-step schedule, two-stream mHC, 512K YaRN context and vision, and drafts with its published mtp.safetensors (#3868, carries #3859, fixes #3781).
  • Inkling 2 Mini: native serving on CUDA (one rank, NVFP4 and MXFP8 experts) and Metal, with kernel contracts on both (#4387). On Metal it serves images under --vision (PNG, JPEG and WebP), with the vision tower and projector on the GPU; without --vision images stay refused by name (#4704). Its startup line breaks the serve's demand into weights, dense layers, scratch and stream state (#4705). Inkling 2 on HIP has attention kernels under the kernel contract (#4633).
  • Ripple-65B-Preview: serves on the native CUDA engine from the publisher's NVFP4 release, with lane rounds as CUDA graphs, kept states and the prompt cache; the bf16 release is refused by name, and structured output and forced tool calls are refused until masked sampling lands (#2302, fixes #2300). On Metal, --drafter takes the publisher's DFlash2 drafter beside either release, with drafted replies equal to plain ones (#2260, fixes #2259).
  • Nemotron 3.5 Transcribe on CUDA: chat requests take speech as 16 kHz mono WAV in OpenAI input_audio and vLLM audio_url parts, up to an hour a request, with clips keyed in the prompt cache (#1632, closes #1549).
  • ZONOS3 Mini text to speech on CUDA: named voices, reference codes and cloning from a clip (#3720). Drama 3 on CUDA gains semantic guidance (--cfg-gamma and the other guidance flags), as on Metal (#4153).
  • Idol on M5 Metal: tf-idol-generate runs end to end from one preprocessed picture to a 3DGS PLY and camera; on an M5 Ultra it takes 29.1 s against 95.4 s for the SDK's pipeline on MPS, at a 2.71 GB peak footprint against 12.88 GB (#1780).
  • Qwen on Metal: the 9B's DFlash (v1) drafter is served with --drafter beside DFlash2, its ring keeping fused rows (8 KiB a token instead of 64 KiB), and TF_Q27_KV_GROW=<rows> starts K/V slots at that many rows and grows them with their streams, with byte-identical replies (#1896). Qwen3.6-35B-A3B's text-only checkpoint serves on the routed expert path (#3239).
  • CUDA: an sm_110 target serves Qwen3.8-27B text on one Thor GPU (#4796), Flash Next takes a top-5 checkpoint with a 1280-wide shared expert as well as top-10 (#3523), and GLM-5.3-Flash with --learn-conversations keeps conversation states on disk, so after an eviction or a restart the next turn reads its state back (#1411).
  • More hardware and placement: Qwen 3.8-27B on XPU opens Arc Pro B60 cards when no B70 is found (#4802), and Ling-3.0-tiny gets an exact decoder for the published 4-bit GGUF on aarch64 Linux (#4266). GLM, MiniMax and Nemotron on CUDA are placed by --tp, --rank, --master and --master-port; the TF_GLM_*, TF_MINIMAX_* and TF_NEMOTRON_* rank and world variables still work as aliases until 1.4.0, with a start-up warning (#2919).
  • GLM on Metal: GLM_POOL_TOKENS sizes the shared latent pool apart from each stream's --context, so one Mac's streams can share a 2M-token pool with zero output-token differences (#3906).
  • MiniMax-H3-Image: CUDA tools for the prompt path and image decoder (#3733), a Metal tool that writes a whole text-to-image case from a size and a seed (#2781), and 19 Metal kernels under the kernel contract (#2808).
  • Opt-in features and diagnostics: LFM3 warm turns under TF_LFM3_METAL_WARM_TURNS=1 re-prefill a tool loop only from the first changed token (#4585); tied embedding heads for the Qwen3.8-27B family under TF_QWEN27_TIED_HEAD=1 (#4519); Flash Next CUDA TF_FLASHNEXT_WINDOW_CHECK=1 grows a lone stream's copy window past 32 rows when a boot self-check proves it (#4075); Qwen3.5 CUDA TF_QWEN_KV_SNAPSHOT_GPU=1 keeps prefix snapshots on the device (#4473); DeepSeek-V4.1 Metal TF_DSV41_ROUND_PROF=1 (#2951) and GLM Metal GLM_ROUND_PROF (#3894) report round timings, and Qwen 3.5 Metal TF_QWEN35_CHUNK sets the prefill chunk size for measurement, the default staying 128 rows (#3762). GLM-5.3-Flash CUDA TF_GLM_VISION_FUSED=1 runs the image tower's attention on the shared full-attention vision kernel; its sums run in another order, so replies to prompts with images can differ from the default path, which is unchanged (#3790).
  • Building blocks: Hy4-flash host weight maps for its ModelOpt NVFP4 build (#4110) and its W8A16 FP8 checkpoint with TP partitions (#4827), with serving in later PRs, and a host tier that keeps the core KV pool's logical pages in host RAM behind device frames (#1501).
  • tensorfold start: selects a fitting catalog model, downloads it with consent, starts a local server and checks its reply, keeping API keys out of output (#4852).

Server and API

  • Legacy echo: /v1/completions takes echo, returning the prompt's text and, with logprobs, each prompt token's entry ahead of the reply's; engines without prompt logprobs refuse it by name (#3526).
  • Prompt cache flush: POST /v1/prompt_cache/flush takes an optional retain count that keeps the most recently used prompt states (#4856).
  • Priority aging: TENSORFOLD_PRIORITY_AGE_MS (default 0, unchanged order) lets a background request that has waited that long start before foreground work (#4833).
  • OCR: POST /ocr answers PaddleX's (#2575), docTR's (#2574) and LiteParse's (#2573) request contracts.
  • Capabilities: tensorfold capabilities --json lists TENSORFOLD_PARALLEL and the other variables serve honours, so the desktop app's Engine variables page accepts them (#4588, fixes #3684).
  • Web fetches: hostname lookup uses the shared bounded resolver, so a request's deadline holds when the system lookup is slow (#4551).

Changes you may notice

  • Qwen 3.5 and 3.8 stop tokens: one EOS rule for every family reader, and qwen27 now reads generation_config.json, so qwen27's own stop tokens match the served set on the ten configs that declare <|im_end|> (#4678).
  • Inkling 2 Mini thinking off: enable_thinking: false and reasoning_effort: "none" reach the chat template as thinking effort 0 instead of the default 0.9; thinking-on replies are unchanged (#4876).
  • Inkling 2 tool calls: required and named tool calls use the model's own message format, so a request that needs several calls ends after them instead of repeating until max_tokens; a required single call keeps its parsed tool_calls but its token ids change (#4898).
  • Qwen3.8 on CUDA: TF_QWEN_PDL is on by default on sm_12x GPUs (GB10, RTX 50 series), with tokens unchanged; other GPUs keep plain launches, TF_QWEN_PDL=1 still turns it on from sm_90 and TF_QWEN_PDL=0 turns it off (#4881).
  • Flash Next on CUDA: the fused read-out is the default, making prompt processing about 3-5% faster on GB10 with identical tokens; TF_FLASHNEXT_READOUT_FUSED=0 keeps the old path (#4799).
  • --vision on CUDA and HIP: one core gate decides it at startup. --vision on a checkpoint without a vision tower is refused, including Qwen3.5 on HIP and Flash Next on CUDA; LFM2 on CUDA loads its tower only with --vision (#3456).
  • Settings checked at startup: TF_Q27_KV_GROW (Metal) and TF_QWEN_KV_SNAPSHOT_GPU (CUDA) are checked at startup and refused by name like every registered setting; TF_QWEN_KV_SNAPSHOT_GPU accepts only 0 or 1, where other text was read as off (#4963).
  • Loading: Gemma 4's CUDA drafters and one more MoE family's CUDA loader refuse a checkpoint with tensors the engine never binds (#4566). Flash Next on Metal fits an oversized --ssd-experts pool to the load ceiling instead of refusing the load (#4811). An LFM3-VL text-only load leaves the vision tower on disk (#3420).

Fixes

  • Qwen 3.8-27B on Metal M5: 5-bit and 6-bit group-64 checkpoints get split-plane storage and register-direct lane kernels (#4419), and split K for decode and prompt rows as v1.3.4 did again, so their sums run in v1.3.4's order (#4962).
  • Flash Next on CUDA: the pass scratch has room for the MTP head's rows, so a 128 to 1,023-token prompt with drafts on no longer writes past it (#4801).
  • Prompt cache and kept states: a Metal stream whose setup fails partway no longer leaves the prompt cache smaller in Llama, Ripple, Spark2.5, Flint, Step-5 and MiniMax-M3 (#4731); a waiting stream under stepped prefill no longer pins its kept state (#4751); a GLM CUDA prefill cancelled between chunks keeps its completed shared-cache prefix (#4694); and GLM-5.3-Flash on Metal sizes its staging permit from the model's whole image, so deep saves past 1 GiB are kept and a restarted server resumes (#4216).
  • Lost wakeups: score requests and server shutdown wait on their own conditions (#4690), and the sessions tier thread's job runner can no longer sleep with a job queued (#4653).
  • Host status: the lane host's status read copies a published snapshot, so a monitoring client no longer holds the decode round's lock (#4525, refs #3200).
  • Cancels and failures: Unlimited-OCR-2 stops a cancelled request before image encoding and between chunks (#4528), and Idol's octree and decode-trace allocation failures unwind cleanly (#4304).
  • Lanes: window-cost tables are measured in interleaved sweeps and repaired at startup within a time budget (#4755), lone-stream copy pricing refuses an empty chance list and keeps the unpriced width for a bad cost (#4668), MiniMax-M3 on Metal times its 12- to 32-row shared rounds at load (#3120), and the shared price log covers the shared-drafts grant path (#4686).
  • Pull and macOS: a refused proxy or timeout setting is named correctly on every configure (#4677), and the macOS native server links memcpy from libSystem again (#4736).
  • Desktop: Discover shows a model as installed again once its selected revision matches (#4606), and the app typecheck passes again (#4829).

Thanks

@AbrahamCete, @AIFlowML, @akol1, @atakann, @BadAd84, @Bizuayeu, @BlivionIaG, @BobClawblaw, @cshintov, @devopsfortunato, @eXsoR65, @garvrao80, @gilby, @grantoverton, @GrgaPalcic, @IF-YFXJ, @jayleaton, @joshuaswarren, @jrb-ai, @jschmied, @laudney, @MaverickKB, @Mirrdhyn, @plotarmordev, @SashaMIT, @scchumbletech, @sethforprivacy, @Spectre056, @squirtymcgirt, @ThinkOffApp, @timmyit, @ultradaoto, @wojo.