Commit Graph

49 Commits

Author SHA1 Message Date
Xiaoze Fan a80b4d308a fix(hf): download the shards the safetensors index names (#336) 2026-09-01 19:43:19 -07:00
Xiaoze Fan a2538a428b feat(glm5_next): support GLM-5.3-Flash (#332)
Hybrid 45-layer model (34 KDA + 11 DSA) with NVFP4 MoE (288 experts):

- KDA linear-attention kernels and op, hybrid-linear pool dispatch
  generalized to any paged family
- NoPE-MLA attention with a kpool DSA indexer backend: 64-token pages,
  1/ratio shadow index slab, per-request tail rings, CUDA-graph-safe
  decode, prefix-cache snapshot contract
- mHC (x4 residual streams) layer with a fused split-K triton kernel;
  torch reference kept as the semantic pin
- clamped-SwiGLU activation across the MoE stack
- weight loading for NVFP4 exports in the multimodal-wrapper layout:
  ModelOpt and compressed-tensors (RedHatAI) tensor kinds;

Co-authored-by: Shuo Yang <73746844+andy-yang-1@users.noreply.github.com>
2026-09-01 15:18:15 -07:00
Xiaoze Fan 4c0bad3f56 feat(qwen4_exp): stream the PLE n-gram table from disk (#311)
* feat(qwen4_exp): stream the PLE n-gram table from disk (--ple-backend disk)

* fix(qwen4_exp): hash disk PLE rows with the checkpoint-loaded constants

* fix(kernel): handle io_uring partial submission and validate ple_store geometry

* fix(qwen4_exp): validate PLE row coverage, widen deferred-fill signaling, log io/sync choice

* fix(qwen4_exp): zero the eager PLE staging for the warmup prefill

* fix(qwen4_exp): read back the padded decode batch for the disk PLE fill
2026-09-01 13:35:14 -07:00
Xiaoze Fan e05cff83a0 perf(moe): route fused_topk through the in-repo triton router (#319) 2026-08-31 20:21:11 -07:00
Xiaoze Fan 3a20a79038 fix(kernel): unbreak the nightly kernel-cache wheel build (#310)
* fix(kernel): move fp8_block_scale_pad into aot_models to unbreak the kernel-cache build

* fix(kernel): exclude bank rows fast_index_copy cannot compile from aot specs

* fix(moe): fail fast when fused copy is off and a bank row cannot fall back
2026-08-30 22:43:50 -07:00
Xiaoze Fan 4b94bdc38a docs: add SECURITY.md
Added guidelines for reporting security issues.
2026-08-30 01:00:07 -07:00
Berni McCoy 58f4b9ec0e fix(kernel): avoid row-wise _scaled_mm stall on sm_89 with torch<2.12 (#243)
PyTorch < 2.12 runs row-wise FP8 _scaled_mm on sm_89 through a CUTLASS stream-K kernel whose launch ignored the current stream (pytorch/pytorch#177651, fixed by pytorch/pytorch@252bb4a in 2.12). FreeToken issues the fused per-tensor-FP8 projections (q/k/v and GDN qkv|z of the NVFP4 checkpoints) from a side stream, so on Ada every prefill of >= 256 tokens stalled the GPU and the worker hung or died (#182, #72, #220). Windows torch builds ship no row-wise kernel at all (#227).

Tensor-wise scaling is unaffected. Where row-wise is unsafe (sm_89 on torch < 2.12, or a probe on the default stream raises), a fused projection now runs one tensor-wise GEMM per part over its row slice and concatenates: the same W8A8 scheme (rel ~7e-4 to row-wise, accumulation order), one extra launch per part. The parts' row ranges come from the load-time weight_scale run-lengths; the decision and its probe run at load, never under CUDA-graph capture. FREETOKEN_FP8_ROWWISE_MM=0/1 forces either path for A/B.

Tested on RTX 4070 SUPER (sm_89), driver 591.86, torch 2.11.0+cu130, WSL2. Sweep over M on a side stream: row-wise stalls at M >= 256, the new path completes at every M. tests/kernels/test_fp8_pertensor_linear.py: the side-stream test fails on main (rc=124, 0/128 GEMMs complete) and passes here; the per-part path is compared directly against row-wise at M=1/4/64/300. Three pre-existing test_w8a8_matches_w8a8_reference cases miss the 1e-2 tolerance on this GPU (rel 0.0103-0.0107) on main and on this branch alike.

Assisted-by: Claude Fable 5
2026-08-28 21:20:16 -07:00
Xiaoze Fan a05c26543f docs(models): add Qwen3.8-Flash-Next & Qwen3.8 27b
Signed-off-by: Xiaoze Fan <jasonfxz@sjtu.edu.cn>
2026-08-28 15:49:00 -07:00
Xiaoze Fan bd8f3d519a feat(qwen4_exp): support Qwen3.8-Flash-Next (#257)
Serve Qwen3.8-Flash-Next (HF model_type qwen4_exp) text-only: 36 GDN +
12 QSA compressed-sparse attention layers on 4 hyper-connection residual
streams, a PLE n-gram embedding layer backed by a 47.7 GiB pinned-host
table with UVA gather, and 512 NVFP4 / block-fp8 routed experts (top-10)
plus a gated shared expert.

- attention: qsa_sparse backend (AttnType.QSA) over QSAKVCache -- paged
  GQA K/V, a 1/ratio compressed index-key slab shadowing the KV pages,
  and a per-request pending ring sized from index_ratio
- kvcache: declarative slot-sibling states (ModelConfig.slot_states) on
  LinearStatePool carry the PLE conv history and n-gram context through
  the hybrid-radix snapshot/COW lifecycle
- scheduler: hybrid prefill chunks align to the page size so snapshots
  land on donatable boundaries
- kernels: triton kernels adapted from vLLM/SGLang (hc, qsa, ple gather,
  moe router / shared gate) plus an original radix block top-k; int64
  row addressing throughout
- moe: non-power-of-2 top-k router, deep-K marlin decode config, one
  fp8 scale-bank padding rule shared with the AOT row table
- engine: the PLE table load reserves its pinned bytes from the pin
  budget before the expert banks plan their residency
2026-08-28 15:33:15 -07:00
Xiaoze Fan 9ef3651309 chore(assets): update wechat group QR code 2026-08-26 00:41:24 -07:00
Xiaoze Fan f7c31e92db fix(fla): stop l2norm recompiling per token count 2026-08-25 16:39:32 -07:00
Xiaoze Fan 2757bb5f91 feat(server)!: add --gpu to choose the GPU on multi-GPU machines (#117)
* feat(server)!: add --gpu to choose the GPU on multi-GPU machines

--gpu takes a GPU UUID (as nvidia-smi -L prints) or an nvidia-smi index.

It is applied as CUDA_VISIBLE_DEVICES in the parent before the workers spawn, so the engine still binds cuda:<rank>.

/v1/stats reports the engine's GPU under "gpus".

ft bench bw takes the same --gpu and writes one profile per GPU (benchbw/<gpu-uuid>.json); the legacy benchbw.json is still read by GPU name.

The daemon's /bench/profile returns the running serve's GPU profile.

BREAKING CHANGE: ft checkpoint --device is removed; use --gpu.

* refactor!: resolve --gpu via NVML and bind by UUID, not CUDA_VISIBLE_DEVICES

BREAKING CHANGE: ft bench bw --device is removed; use --gpu.

* refactor: name the id namespaces and drop the multi-device e4m3 scan

Splits the published id into _assigned_physical (UUID) and
_assigned_visible (CUDA ordinal). One process runs on one GPU, so
e4m3_native() judges that card instead of scanning every visible device.
2026-08-24 16:44:01 -07:00
Lancer bd372b630a fix(checkpoint): FTW truncated shard raises OSError instead of silent garbage load (#25) 2026-08-23 17:53:27 -07:00
Shuo Yang e0a3bbc046 Merge pull request #112 from FlashML-org/feat/split-residency
feat(moe): per-layer host-bank residency
2026-08-23 17:39:31 -07:00
Xiaoze Fan 831d38a66b fix(moe): report the residency banks actually settle at 2026-08-23 23:06:56 +00:00
Xiaoze Fan eebb3f53f3 feat(moe): estimate expert-bank bytes from the model config 2026-08-23 23:06:56 +00:00
Xiaoze Fan c41833b717 feat(moe): per-layer host-bank residency -- split lock-CPU/pin-GPU layers, auto selection under capped pin quota 2026-08-23 21:02:59 +00:00
jasonfan 184a4f114d build(kernel-cache): add sm_80 (A100/A800) to default arches (#75)
Signed-off-by: jasonfan <36730318+jason-fxz@users.noreply.github.com>
2026-08-22 23:38:42 -07:00
jasonfan f0abe587a1 docs: add CONTRIBUTING.md 2026-08-22 22:22:15 -07:00
Shuo Yang 0ab982f109 chore(README): Add Community WeChat link to README
Added a link to the Community WeChat in the README.
2026-08-20 11:43:47 -07:00
Shuo Yang bc6b269cbc chore(assets): Add FreeToken wechat group invite 2026-08-20 11:41:16 -07:00
Xiaoze Fan 9db1a39455 chore(release): 0.1.2
Release wheels / build (push) Has been cancelled
Release wheels / publish-testpypi (push) Has been cancelled
Release wheels / publish-pypi (push) Has been cancelled
Release wheels / github-release (push) Has been cancelled
v0.1.2
2026-08-19 05:57:18 +00:00
jason-fxz 3f02e3c5a8 docs(README): use absolute URLs so PyPI renders assets and links 2026-08-18 20:49:53 -07:00
jason-fxz c0a4a60b2c Merge branch 'dev/refine-readme': README overhaul + quick start guide 2026-08-18 20:38:49 -07:00
jason-fxz 9ecbc9f33f docs(README): add a Desktop screenshot to Getting Started
The Desktop paragraph promised a GUI for running models and tuning the engine
without showing either. The shot is the console with DeepSeek-V4-Flash FP4
resident on a 32 GiB card, so the cache sliders carry real numbers: 512K KV
tokens for 3.40 GiB against 1024 of 11008 expert slots for 12.8 GiB.

Framed as a floating window (rounded, drop shadow, transparent margin) so it
sits on both the light and dark README themes.
2026-08-18 20:36:08 -07:00
jason-fxz 12ed695386 feat(stats): record per-request TTFT and report its mean
The request ring only carried whole-request duration, so /v1/stats exposed no
first-token latency — the number that says how responsive a local model feels,
independent of decode speed. Streaming generations now stamp the first delta
they emit; non-streaming rows carry None and are skipped by the mean, so a
/health probe can never drag it toward zero.

Surfaced as requests.ttft_mean_ms in /v1/stats and in `ft ctl stats`.
2026-08-18 19:08:52 -07:00
Xiaoze Fan 586a6c16ce perf(fp8): run per-tensor fp8 as W8A8 via scaled_mm (#7) 2026-08-18 18:04:39 -07:00
jason-fxz f4373f8a45 docs(README): add install commands to Getting Started 2026-08-18 16:09:32 -07:00
jason-fxz 5528af06a4 docs(README): add Citation 2026-08-18 15:50:32 -07:00
jason-fxz fca27580a1 docs: refine README.md, add quick start guide
Signed-off-by: jason-fxz <jason341132@qq.com>
2026-08-18 15:24:47 -07:00
Xiaoze Fan 5812fbd084 chore(README.md): add links. 2026-08-18 13:25:02 -07:00
Shuo Yang 6223cda1b0 Support muse glimmer (#4)
* feat(muse_glimmer): serve Muse-Glimmer-30B
2026-08-18 12:26:05 -07:00
Xiaoze Fan b86a904f86 build(release): pypi-ready wheels, metadata, and publish workflow (#6) 2026-08-17 23:03:44 -07:00
Xiaoze Fan 76edc16282 build(release): pypi-ready wheels, metadata, and publish workflow 2026-08-18 05:00:47 +00:00
jason-fxz 711325d17e fix(server): stop API server when backend dies
Signed-off-by: jason-fxz <jason341132@qq.com>
2026-08-16 14:34:17 -07:00
jason-fxz 2635246ba2 ci: move nightly wheels to 11:00 UTC 2026-08-16 12:11:17 -07:00
Xiaoze Fan d7cd6ed88b [Feature] unify reasoning effort on one shared scale (#5)
* feat(server): accept every reasoning-effort dialect

* refactor(server): derive thinking gears from the checkpoint, not a registry
2026-08-15 23:40:52 -07:00
Xiaoze Fan a2572083e9 feat(launch): support launch deepseek harness (#3)
* feat(launch): support launch deepseek harness

* fix(launch): node version gate, cloud key clearing, and dsh docs
2026-08-14 23:50:44 -07:00
Xiaoze Fan 4f510f1ba6 feat(server): enable reasoning_effort on /v1/chat/completions (#2)
* feat(server): enable reasoning_effort on /v1/chat/completions

* fix(server): glm thinking-off mislabeling and reasoning_effort mapping edge cases
2026-08-14 00:02:32 -07:00
jasonfan c28e93a8c0 chore(assets): update icons & logos 2026-08-13 18:09:01 -07:00
Xiaoze Fan fdfcacd491 chore: Enhance README with logo 2026-08-13 16:28:39 -07:00
Shuo Yang 9dc3ff4ca5 Support minimax m3 (#1)
* feat(minimax_m3): serve MiniMax-M3-NVFP4 single-GPU (block-sparse GQA + MXFP8 dense + swigluoai NVFP4 experts)
2026-08-13 16:22:41 -07:00
jasonfan 17af154bb5 feat(assets): add dark/light logos 2026-08-13 16:10:28 -07:00
jasonfan 3e5214d4a3 build(deps): pin apache-tvm-ffi, flashlib, triton to exact versions 2026-08-13 14:51:26 -07:00
jasonfan 97eb4e25b5 Merge branch 'main' of github.com:FlashML-org/FreeToken 2026-08-13 13:27:51 -07:00
jasonfan a8669e4950 chore(assets): add freetoken icon & logo 2026-08-13 13:26:53 -07:00
Xiaoze Fan ea5348b4e3 feat(kvcache): checkpoint decode state at the tool-call opener token 2026-08-13 18:32:02 +00:00
Xiaoze Fan ee54f638fd fix(gemma4): read head_dim / kv heads per attention type from per_layer_config 2026-08-13 03:57:59 +00:00
Xiaoze Fan 3af9d90ee5 feat: initial open-source release
Co-authored-by: Shuo Yang <andy_yang@berkeley.edu>
2026-08-11 22:53:25 +00:00