Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
127b530
perf(moe): avoid intra-op fanout while filling NVFP4 host banks
Oct 8, 2026
4f48328
fix(engine): apply shrinking cache resizes before growing ones in liv…
void-mckenzie Oct 8, 2026
803a3b4
fix(kernel): correct jit tensor matcher checks and pdl arch guards (#…
jason-fxz Oct 8, 2026
23fc922
feat(deepseek_v4): serve image input on the V4-Flash-Vision release (…
void-mckenzie Oct 8, 2026
9b585b7
fix(rocm): gate CUDA-only optional backends on ROCm (#134)
zihaomu Oct 9, 2026
6c36af0
test(kernel): cover Triton activation and norm fallbacks (#652)
zihaomu Oct 9, 2026
2d8b9cc
perf(kernel): avoid the activation layout conversion in fp8 moe decod…
jason-fxz Oct 9, 2026
9528190
feat(server): add --api-key authentication (#639)
jason-fxz Oct 10, 2026
ee9789f
fix(kernel): avoid nan in triton sampling softmax when a chunk starts…
ischencheng Oct 10, 2026
74a3877
build(deps): move to torch 2.14.1, triton 3.8 and sglang-kernel 0.4.9…
jason-fxz Oct 10, 2026
c818639
fix(sampling): apply presence and frequency penalties (#527)
taking-lying-flat Oct 11, 2026
95ac86f
feat(cpu-moe): serve block-fp8 experts on the cpu and hybrid backends…
jason-fxz Oct 12, 2026
7080dad
test(moe): grant one bf16 ulp only at rounding ties in the dsfp4 tran…
void-mckenzie Oct 9, 2026
9c635a1
build(deps): move to flashlib 0.4.0 and drop the numpy<2.5 cap (#669)
jason-fxz Oct 13, 2026
a8caf93
merge #408: nvfp4 kv quantization
gdevenyi Sep 23, 2026
1b978be
test(kvcache): give the qsa fp8 pool fakes the mrope flag main now reads
gdevenyi Sep 14, 2026
5c01119
merge #435: resolve JSON Schema refs and union types in tool arguments
gdevenyi Sep 23, 2026
8958440
merge #391: accept the OpenAI developer role
gdevenyi Sep 23, 2026
f3e8d1c
merge #475: respect explicit enable_thinking=false with tools
gdevenyi Sep 23, 2026
921a3f7
merge #339: drop the D2H sync from the varlen GDN/KDA prefill conv
gdevenyi Sep 23, 2026
a66dd10
merge #338: fuse the PLE n-gram row-id hash into one Triton kernel
gdevenyi Sep 23, 2026
ee68670
merge #169: load prefill triton kernels at startup, not mid-request
gdevenyi Sep 23, 2026
6aa2991
merge #231: --moe-collect-stats, so expert-cache behaviour is measurable
gdevenyi Sep 23, 2026
4430345
merge #389: load-time per-tensor FP8 dense projections (stacked on #3…
gdevenyi Sep 23, 2026
2b31a31
fix(models): restore the os import and truthy set the fp8 env helpers…
gdevenyi Sep 15, 2026
e4ad27c
test(qwen4_exp): restore the rope device and clear get_rope after the…
gdevenyi Sep 15, 2026
8645292
test(kernels): give the block_ends backend fake the kv scale accessor…
gdevenyi Sep 15, 2026
beadecf
merge fork #18: fix(moe): report the routing top-k figure as a static…
gdevenyi Sep 23, 2026
450ece7
merge fork #19: fix(qwen4_exp): refuse an ftw checkpoint whose fp8 sp…
gdevenyi Sep 23, 2026
d9850db
merge fork #20: fix(engine): let moe-cache-auto drop prefill overlap …
gdevenyi Sep 23, 2026
f79ca2a
merge fork #21: fix(triton): keep the float glm dsa sparse launches t…
gdevenyi Sep 23, 2026
b097a14
merge fork #23 (upstream FlashML-org/FreeToken#17 rebased): fix(serve…
gdevenyi Sep 23, 2026
942fa81
merge fork #47 (upstream FlashML-org/FreeToken#393 rebased): OpenAI p…
gdevenyi Sep 23, 2026
dc80e89
fix(models): skip the ftw layout check for a bare ftw without an hf c…
gdevenyi Sep 18, 2026
ac36e24
merge #505: fix(scheduler): preserve pending hybrid checkpoint across…
gdevenyi Sep 23, 2026
1f62405
merge #466: fix(utils): tolerate coalesced msgpack frames in zmq pull…
gdevenyi Sep 23, 2026
83fc9c3
merge #414: fix(kernel): order the batch-memcpy probe against the cur…
gdevenyi Sep 23, 2026
3bceb79
merge #118: fix(scheduler): clamp admission to the actual KV pool so …
gdevenyi Sep 23, 2026
b814bd7
test(scheduler): give the rejection test's engine fake the pool size …
gdevenyi Sep 18, 2026
05dd06e
merge #476: feat(server): add --default-thinking-mode flag for server…
gdevenyi Sep 23, 2026
81ce78f
merge #340: fix(engine): reserve the pool's dummy page in the --moe-c…
gdevenyi Sep 23, 2026
92d40ab
merge #198: fix(engine): reserve explicit KV pages during MoE auto-si…
gdevenyi Sep 23, 2026
c14c765
merge #459: fix(checkpoint): validate FTW v1 indexes eagerly
gdevenyi Sep 23, 2026
a7e8009
merge #487: fix(server): hoist system messages to front for templates…
gdevenyi Sep 23, 2026
573585a
merge #222: fix(server): guarantee AbortMsg delivery on stream cancel…
gdevenyi Sep 23, 2026
3a52c33
test(server): abort every sample of an n>1 non-streaming request on d…
gdevenyi Sep 18, 2026
b58c2da
fix(server): record requests with a pure asgi middleware so handlers …
gdevenyi Sep 18, 2026
b819e80
merge #499: feat(kvcache): host-RAM KV tier for sparse-attention mode…
gdevenyi Sep 23, 2026
8452e00
merge #525: feat(kvcache): host-resident prefix tier for hybrid GDN m…
gdevenyi Sep 23, 2026
0fb68e0
fix(kvcache): refuse the host kv tiers on an nvfp4 pool whose block s…
gdevenyi Sep 19, 2026
5bfbe74
merge #500: perf(moe): single-launch prefill buffer invalidation with…
gdevenyi Sep 23, 2026
5848676
merge #108: feat(server): add OpenAI /v1/models/{model_id} endpoint
gdevenyi Sep 23, 2026
a864a3c
merge #504: feat(server): serve per-request inference metrics under -…
gdevenyi Sep 23, 2026
63ad60a
test(scheduler): give the scheduler stubs the prefill-start map the m…
gdevenyi Sep 23, 2026
ac07919
merge #224: feat(server): OpenAI-compatible logprobs for chat and leg…
gdevenyi Oct 13, 2026
d1f4ffb
test(engine): give the logprobs sampler fakes the logits-processing f…
gdevenyi Sep 23, 2026
16bf3a7
merge fork review fixes: 11 bugs found re-reviewing the 5080deploy stack
gdevenyi Sep 24, 2026
282c8a6
merge fork fix (issue #65): run the PLE graph fill on its own thread,…
gdevenyi Sep 24, 2026
6394901
merge fork perf: load only the routed experts for short prefills (FRE…
gdevenyi Sep 24, 2026
bda573c
merge fork fix: small-prefill on-demand path hands the LRU kernel uni…
gdevenyi Sep 24, 2026
8e8c67b
merge fork fix: small-prefill ensures its experts in decode-width chunks
gdevenyi Sep 24, 2026
6308548
merge fork perf: scored expert eviction (--moe-cache-policy), shared …
gdevenyi Sep 26, 2026
2b6c18e
merge fork perf: expert prefetch into low-priority slots with single-…
gdevenyi Sep 27, 2026
0a0ef4a
test(engine): give the kv quant config fake the rope table size #573'…
gdevenyi Oct 2, 2026
02a0c38
merge #531: fix(server): clamp /v1/models context_length to the alloc…
gdevenyi Oct 2, 2026
17b718b
merge #269: fix(server): report why a tokenizer/detokenizer worker di…
gdevenyi Oct 2, 2026
122eabb
merge #468: fix(engine): reject fa attention backend below sm_90 at c…
gdevenyi Oct 2, 2026
881d342
merge #461: fix(server): loopback-bind the TP rendezvous store, add -…
gdevenyi Oct 13, 2026
f0003da
fix(engine): hand the rendezvous listen fd to TCPStore instead of kee…
gdevenyi Sep 25, 2026
af84ef3
merge #484: feat(scheduler): interleave decode steps into long prefil…
gdevenyi Oct 2, 2026
c7f5672
merge #464: fix(scheduler): match stop strings with incremental decoding
gdevenyi Oct 2, 2026
cff1f86
fix(scheduler): trim the stop-match EOS only at the delivered output …
gdevenyi Sep 25, 2026
090ddab
test(tokenizer): cover a detokenize batch that carries one uid more t…
gdevenyi Sep 25, 2026
7ff8cb2
fix(scheduler): match stop strings in the text the request's skip_spe…
gdevenyi Sep 25, 2026
a423501
merge #266: fix(server): hide qwen transport markers from semantic re…
gdevenyi Oct 2, 2026
51ce195
merge #572: fix(server): keep a silent stream alive and notice a clie…
gdevenyi Oct 2, 2026
2ba1ec1
perf(ple): skip the device n-gram hash for the disk table, which read…
gdevenyi Sep 25, 2026
06db968
fix(ple): give each graph fill its own readback event and keep every …
gdevenyi Sep 25, 2026
d0075b1
fix(ple): recycle the fill readback events instead of freeing them on…
gdevenyi Sep 25, 2026
4bee047
fix(kvcache): refuse the host kv-page tier on a pool whose index slab…
gdevenyi Sep 25, 2026
5955339
perf(kvcache): keep one gpu gdn snapshot slot when the host snapshot …
gdevenyi Sep 25, 2026
996c45d
perf(scheduler): probe the host tier for the exact tombstone prefix
gdevenyi Sep 25, 2026
2e639de
fix(scheduler): re-probe the host entry after making room to rehydrat…
gdevenyi Sep 25, 2026
616fd12
test(kvcache): cover the engine-stream waits of the prefix tier's kv …
gdevenyi Sep 25, 2026
8053a76
fix(engine): reserve the GDN prefill workspace in the cache budget
Aug 30, 2026
6083c4a
fix(engine): reserve the gdn prefill workspace in the rebuild fit-che…
gdevenyi Sep 25, 2026
c717506
fix(engine): count min_tokens progress from the device length
gdevenyi Sep 25, 2026
af32927
test(engine): import pytest for the parametrized min_tokens test
gdevenyi Oct 2, 2026
0298321
fix(server): let protocol-level thinking requests win over --default-…
gdevenyi Sep 25, 2026
74aed6c
fix(server): type allOf-wrapped refs and untyped enum/const tool para…
gdevenyi Sep 25, 2026
4da2af9
fix(server): keep /v1/models/ listing the model after the retrieve route
gdevenyi Sep 25, 2026
9e0f229
fix(server): open the streamed thinking block with the signature field
gdevenyi Sep 25, 2026
b089ba6
test(server): exercise detector SDK and lifecycle contracts
gdevenyi Sep 25, 2026
4ad4263
fix(server): drop /v1/completions from the --enable-metrics-report he…
gdevenyi Sep 25, 2026
6448f4e
fix(server): keep developer ahead of system and reject images when me…
gdevenyi Sep 25, 2026
3fafed0
test(server): ask for n=0 in the invalid-request sdk test, since n=2 …
gdevenyi Oct 2, 2026
0e84435
fix(moe): keep unpinned layers off the small-prefill path and take it…
gdevenyi Sep 25, 2026
932e2ff
test(moe): let the small-prefill ensure fake take the eviction policy…
gdevenyi Oct 2, 2026
23cc477
test(qwen4_exp): compare chunked prefill to one-shot at bf16 tolerance
gdevenyi Sep 4, 2026
7788451
test(qwen4_exp): compare the chunked prefill's compressed slab rows t…
gdevenyi Sep 25, 2026
a03feb6
feat(engine): keep the token embedding in pinned host ram (--embed-we…
gdevenyi Sep 25, 2026
583a36b
fix(layers): gather fp32 host embeddings and refuse other dtypes at p…
gdevenyi Sep 25, 2026
4b4c9eb
fix(kernel): compute the host gather output offset in int64
gdevenyi Sep 25, 2026
ca5e02e
fix(engine): charge the host embedding's pinned bytes to the pin budget
gdevenyi Sep 25, 2026
de617e3
fix(engine): refuse --embed-weights host for a tied embedding or tp >…
gdevenyi Sep 25, 2026
40ed327
test(engine): fake cached_load_hf_config with the overrides argument …
gdevenyi Oct 2, 2026
100ac71
test(ple): drive overlapped graph fills against an in-order fake stre…
gdevenyi Oct 2, 2026
a461bb2
merge #578: perf(moe): dequant nvfp4 prefill experts by bit placement…
gdevenyi Oct 2, 2026
03209f1
fix(kernel): keep one e4m3_f32_to_u8, #408's copy duplicates the one …
gdevenyi Oct 7, 2026
477be55
fix(server): leave late Anthropic system messages to the inline-syste…
gdevenyi Oct 7, 2026
949786a
test(server): give main's DeepSeek-V4.1 detector its contract class a…
gdevenyi Oct 7, 2026
45d82fc
merge #614: fix(server): leak no semaphores when a signal stops the s…
gdevenyi Oct 7, 2026
1d0a690
merge #593: fix(checkpoint): refuse converting into a directory that …
gdevenyi Oct 7, 2026
4a534cd
feat(qwen4_exp): read llm-compressor (compressed-tensors) NVFP4 route…
gdevenyi Oct 7, 2026
315d520
test(moe): let the prefetch counter test's copy spies pass #610's blo…
gdevenyi Oct 7, 2026
cc054ae
merge #650: fix(engine): apply shrinking cache resizes before growing…
gdevenyi Oct 13, 2026
7a1249a
merge #635: perf(moe): avoid intra-op fanout while filling NVFP4 host…
gdevenyi Oct 13, 2026
42c2605
merge #668: test(moe): grant one bf16 ulp only at rounding ties in th…
gdevenyi Oct 13, 2026
370de04
test(engine): give #650's rebuild engine fake the kv offloader and gd…
gdevenyi Oct 13, 2026
87c8166
test(server): expect out-of-range penalties to fail request validation
gdevenyi Oct 13, 2026
695bfc9
fix(kernel): decode nvfp4 qsa prefill tiles narrow at head_dim 256
gdevenyi Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,67 @@ batch size x miss rate.
python benchmarks/bench_offload_cache_copy.py
```

**`bench_scored_ensure.py`** — synthetic (no checkpoint): us per decode `ensure` call at a
fixed miss count, flashlib `lru_ensure` vs the `--moe-cache-policy` kernels (lru, kd, kdfb,
rule), from a CUDA graph of two decode steps on a full cache. `--stats` times it with
`--moe-collect-stats` accumulation on.

```bash
python benchmarks/bench_scored_ensure.py --slots 1650 --k 10,20
```

**`bench_moe_copy_overlap.py`** — synthetic (no checkpoint): `FREETOKEN_MOE_COPY_OVERLAP`
off vs on for Qwen4ExpMoE decode layers at the Qwen3.8-Flash-Next expert geometry, as CUDA
graphs. Checks the outputs are bitwise identical, times replays ABAB, and profiles the copy's
start after the ensure and how much of the side-stream shared expert runs inside it.

```bash
python benchmarks/bench_moe_copy_overlap.py --bs 1 --slots 160
```

**`bench_moe_prefetch.py`** — synthetic (no checkpoint): `FREETOKEN_MOE_PREFETCH=measure`
cost. The router-lookahead predictor alone per layer (GEMV `[bs, 2560] x [2560, 512]`, top-K
select, and the count kernel), then prefetch off vs measure on a real-geometry Qwen4ExpMoE decode
stack (512 experts, rule eviction, copy overlap on) with forced routing that misses exactly m
experts per layer, as CUDA graphs. `--on` times whole 48-layer decode steps with prefetch off vs
on instead: a GEMV per layer stands in for attention (`--filler-us`), each layer prefetches 3 or
4 candidates of which `--useful` are its misses, and `--delay-us` holds every prefetch copy back
to price a late one. It reports ms/step, demand misses/step and the late fraction. `--steady
--trace DIR` runs steady-state decode on a recorded routing trace instead (experts.npy,
logit_idx.npy, logit_val.npy, req_index.npy): no cache restore, so wrong prefetches and evictions
carry over, and a noisy copy of each layer's traced logits (`--sigma`) stands in for the
lookahead. Arms such as `off,measure,on,on:4/4` (budgets before GDN / QSA layers) replay step by
step in turn, each on its own copy of the cache state; it adds pollution (non-resident demands
per layer against off's misses) and the late fraction per layer kind. Slots and sigma were
calibrated to production's measure line (misses/layer ~4.3, precision ~0.56) at 24 layers.

```bash
python benchmarks/bench_moe_prefetch.py --bs 1,2 --misses 0,4
python benchmarks/bench_moe_prefetch.py --on --bs 1,2 --misses 4 --delay-us 0,50,150,300
python benchmarks/bench_moe_prefetch.py --steady --trace DIR --bs 1,2 --steady-slots 740 --sigma 0.55 \
--arms off,measure,on,on:empty,on:3/3,on:4/4,on:4/5
```

**`bench_expert_copy_corun.py`** — synthetic (no checkpoint): the fused expert copy kernel
alone and beside compute, on registered host banks with the qwen4_exp NVFP4 row sizes. Sweeps
`fast_index_copy_multi` (threads x blocks/bank) and `fast_index_copy_multi_slim`
(blocks x threads x unroll) over 1..10-expert plans (GB/s, "hot" back-to-back and "cold"
spacer-separated copies), then reports the stretch sigma of bf16/fp8 GEMVs, a small matmul and
the NVFP4 routed decode GEMV while a copy loop runs on another stream. `--json` keeps the raw
per-trial times.

```bash
python benchmarks/bench_expert_copy_corun.py --trials 5 --json copy_corun.json
```

For host RAM vs PCIe bandwidth and the offload/hybrid backend pick, use `ft bench bw`
instead — it writes the JSON profile the engine reads.

**`bench_kv_quant.py`** compares BF16, FP8 and NVFP4 KV storage bytes, one-step
scatter latency and paged decode latency on synthetic inputs. No checkpoint is
required. Keep the GPU idle and use identical arguments for A/B comparisons;
this does not measure model quality or end-to-end serving throughput.

```bash
PYTHONPATH=python:. uv run python benchmarks/bench_kv_quant.py --lengths 1024,8192,32768
```
Loading