Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
494aa62
server: validate sampling params and rebuild timeout at the API layer
Artemowka22 Aug 26, 2026
c10f472
Merge upstream main into fix/api-input-validation
Artemowka22 Sep 15, 2026
2010271
refactor(cpu-moe): split the executor into weight formats and gpu syn…
jason-fxz Oct 14, 2026
f02fbb1
perf(moe): split hybrid decode routes inside the ensure kernel (#685)
jason-fxz Oct 14, 2026
b416f85
feat(moe): split the offload expert cache into slot pools (#689)
jason-fxz Oct 15, 2026
0bca88f
fix(rocm): reuse staged moe alignment on Triton 3.8 (#691)
LZ-QWQ Oct 15, 2026
a620334
merge #408: nvfp4 kv quantization
gdevenyi Sep 23, 2026
b43c5cc
test(kvcache): give the qsa fp8 pool fakes the mrope flag main now reads
gdevenyi Sep 14, 2026
b9d6d9a
merge #435: resolve JSON Schema refs and union types in tool arguments
gdevenyi Sep 23, 2026
4b8bb36
merge #391: accept the OpenAI developer role
gdevenyi Sep 23, 2026
340dbdb
merge #475: respect explicit enable_thinking=false with tools
gdevenyi Sep 23, 2026
e05f214
merge #339: drop the D2H sync from the varlen GDN/KDA prefill conv
gdevenyi Sep 23, 2026
40a4034
merge #338: fuse the PLE n-gram row-id hash into one Triton kernel
gdevenyi Sep 23, 2026
2278211
merge #169: load prefill triton kernels at startup, not mid-request
gdevenyi Sep 23, 2026
b0c18cd
merge #231: --moe-collect-stats, so expert-cache behaviour is measurable
gdevenyi Oct 15, 2026
99a4065
merge #389: load-time per-tensor FP8 dense projections (stacked on #3…
gdevenyi Sep 23, 2026
dd65248
fix(models): restore the os import and truthy set the fp8 env helpers…
gdevenyi Sep 15, 2026
1dc6b7d
test(qwen4_exp): restore the rope device and clear get_rope after the…
gdevenyi Sep 15, 2026
c5010c9
test(kernels): give the block_ends backend fake the kv scale accessor…
gdevenyi Sep 15, 2026
5e441ba
merge fork #18: fix(moe): report the routing top-k figure as a static…
gdevenyi Sep 23, 2026
c9f7158
merge fork #19: fix(qwen4_exp): refuse an ftw checkpoint whose fp8 sp…
gdevenyi Sep 23, 2026
fbd2004
merge fork #20: fix(engine): let moe-cache-auto drop prefill overlap …
gdevenyi Sep 23, 2026
570456b
merge fork #21: fix(triton): keep the float glm dsa sparse launches t…
gdevenyi Sep 23, 2026
935e121
merge fork #23 (upstream FlashML-org/FreeToken#17 rebased): fix(serve…
gdevenyi Sep 23, 2026
5829f75
merge fork #47 (upstream FlashML-org/FreeToken#393 rebased): OpenAI p…
gdevenyi Sep 23, 2026
9042a72
fix(models): skip the ftw layout check for a bare ftw without an hf c…
gdevenyi Sep 18, 2026
70157f1
merge #505: fix(scheduler): preserve pending hybrid checkpoint across…
gdevenyi Sep 23, 2026
0538042
merge #466: fix(utils): tolerate coalesced msgpack frames in zmq pull…
gdevenyi Sep 23, 2026
220d8ae
merge #414: fix(kernel): order the batch-memcpy probe against the cur…
gdevenyi Sep 23, 2026
4096798
merge #118: fix(scheduler): clamp admission to the actual KV pool so …
gdevenyi Sep 23, 2026
a2d3bbb
test(scheduler): give the rejection test's engine fake the pool size …
gdevenyi Sep 18, 2026
7388a3a
merge #476: feat(server): add --default-thinking-mode flag for server…
gdevenyi Sep 23, 2026
d871385
merge #340: fix(engine): reserve the pool's dummy page in the --moe-c…
gdevenyi Sep 23, 2026
3f4f4d8
merge #198: fix(engine): reserve explicit KV pages during MoE auto-si…
gdevenyi Sep 23, 2026
556efd3
merge #459: fix(checkpoint): validate FTW v1 indexes eagerly
gdevenyi Sep 23, 2026
07436df
merge #487: fix(server): hoist system messages to front for templates…
gdevenyi Sep 23, 2026
cd1b070
merge #222: fix(server): guarantee AbortMsg delivery on stream cancel…
gdevenyi Sep 23, 2026
17166c1
test(server): abort every sample of an n>1 non-streaming request on d…
gdevenyi Sep 18, 2026
455ad07
fix(server): record requests with a pure asgi middleware so handlers …
gdevenyi Sep 18, 2026
bca9f4c
merge #499: feat(kvcache): host-RAM KV tier for sparse-attention mode…
gdevenyi Sep 23, 2026
30e45dd
merge #525: feat(kvcache): host-resident prefix tier for hybrid GDN m…
gdevenyi Sep 23, 2026
34a9988
fix(kvcache): refuse the host kv tiers on an nvfp4 pool whose block s…
gdevenyi Sep 19, 2026
2ca27c6
merge #500: perf(moe): single-launch prefill buffer invalidation with…
gdevenyi Oct 15, 2026
85689b7
merge #108: feat(server): add OpenAI /v1/models/{model_id} endpoint
gdevenyi Sep 23, 2026
0b5bc52
merge #504: feat(server): serve per-request inference metrics under -…
gdevenyi Sep 23, 2026
c7af50f
test(scheduler): give the scheduler stubs the prefill-start map the m…
gdevenyi Sep 23, 2026
47a6bfe
merge #224: feat(server): OpenAI-compatible logprobs for chat and leg…
gdevenyi Oct 13, 2026
70e942e
test(engine): give the logprobs sampler fakes the logits-processing f…
gdevenyi Sep 23, 2026
4d91b47
merge fork review fixes: 11 bugs found re-reviewing the 5080deploy stack
gdevenyi Sep 24, 2026
4f2528f
merge fork fix (issue #65): run the PLE graph fill on its own thread,…
gdevenyi Sep 24, 2026
c8709d9
merge fork perf: load only the routed experts for short prefills (FRE…
gdevenyi Sep 24, 2026
c3ec155
merge fork fix: small-prefill on-demand path hands the LRU kernel uni…
gdevenyi Sep 24, 2026
6593b58
merge fork fix: small-prefill ensures its experts in decode-width chunks
gdevenyi Sep 24, 2026
9975dd0
merge fork perf: scored expert eviction (--moe-cache-policy), shared …
gdevenyi Sep 26, 2026
3b4893c
merge fork perf: expert prefetch into low-priority slots with single-…
gdevenyi Sep 27, 2026
524f438
test(engine): give the kv quant config fake the rope table size #573'…
gdevenyi Oct 2, 2026
0dfbedb
merge #531: fix(server): clamp /v1/models context_length to the alloc…
gdevenyi Oct 2, 2026
9e18f2d
merge #269: fix(server): report why a tokenizer/detokenizer worker di…
gdevenyi Oct 2, 2026
72515b3
merge #468: fix(engine): reject fa attention backend below sm_90 at c…
gdevenyi Oct 2, 2026
a2561ed
merge #461: fix(server): loopback-bind the TP rendezvous store, add -…
gdevenyi Oct 13, 2026
206576a
fix(engine): hand the rendezvous listen fd to TCPStore instead of kee…
gdevenyi Sep 25, 2026
c912d55
merge #484: feat(scheduler): interleave decode steps into long prefil…
gdevenyi Oct 2, 2026
b607ac6
merge #464: fix(scheduler): match stop strings with incremental decoding
gdevenyi Oct 2, 2026
155185c
fix(scheduler): trim the stop-match EOS only at the delivered output …
gdevenyi Sep 25, 2026
c9c883e
test(tokenizer): cover a detokenize batch that carries one uid more t…
gdevenyi Sep 25, 2026
c6e804b
fix(scheduler): match stop strings in the text the request's skip_spe…
gdevenyi Sep 25, 2026
270776a
merge #266: fix(server): hide qwen transport markers from semantic re…
gdevenyi Oct 2, 2026
a741099
merge #572: fix(server): keep a silent stream alive and notice a clie…
gdevenyi Oct 2, 2026
4fa89f8
perf(ple): skip the device n-gram hash for the disk table, which read…
gdevenyi Sep 25, 2026
5221ce0
fix(ple): give each graph fill its own readback event and keep every …
gdevenyi Sep 25, 2026
7bb5359
fix(ple): recycle the fill readback events instead of freeing them on…
gdevenyi Sep 25, 2026
121c0c2
fix(kvcache): refuse the host kv-page tier on a pool whose index slab…
gdevenyi Sep 25, 2026
500b8fa
perf(kvcache): keep one gpu gdn snapshot slot when the host snapshot …
gdevenyi Sep 25, 2026
c22561e
perf(scheduler): probe the host tier for the exact tombstone prefix
gdevenyi Sep 25, 2026
18a082e
fix(scheduler): re-probe the host entry after making room to rehydrat…
gdevenyi Sep 25, 2026
dedec6d
test(kvcache): cover the engine-stream waits of the prefix tier's kv …
gdevenyi Sep 25, 2026
f7d026b
fix(engine): reserve the GDN prefill workspace in the cache budget
Aug 30, 2026
03bae09
fix(engine): reserve the gdn prefill workspace in the rebuild fit-che…
gdevenyi Sep 25, 2026
4b73a93
fix(engine): count min_tokens progress from the device length
gdevenyi Sep 25, 2026
67fc938
test(engine): import pytest for the parametrized min_tokens test
gdevenyi Oct 2, 2026
47bc623
fix(server): let protocol-level thinking requests win over --default-…
gdevenyi Sep 25, 2026
de1dfc9
fix(server): type allOf-wrapped refs and untyped enum/const tool para…
gdevenyi Sep 25, 2026
9e677ee
fix(server): keep /v1/models/ listing the model after the retrieve route
gdevenyi Sep 25, 2026
a1b4778
fix(server): open the streamed thinking block with the signature field
gdevenyi Sep 25, 2026
6cd147b
test(server): exercise detector SDK and lifecycle contracts
gdevenyi Sep 25, 2026
7ac93f5
fix(server): drop /v1/completions from the --enable-metrics-report he…
gdevenyi Sep 25, 2026
ebe7888
fix(server): keep developer ahead of system and reject images when me…
gdevenyi Sep 25, 2026
0838391
test(server): ask for n=0 in the invalid-request sdk test, since n=2 …
gdevenyi Oct 2, 2026
60ef53c
fix(moe): keep unpinned layers off the small-prefill path and take it…
gdevenyi Sep 25, 2026
1cb0b99
test(moe): let the small-prefill ensure fake take the eviction policy…
gdevenyi Oct 2, 2026
e1af695
test(qwen4_exp): compare chunked prefill to one-shot at bf16 tolerance
gdevenyi Sep 4, 2026
5df3b9a
test(qwen4_exp): compare the chunked prefill's compressed slab rows t…
gdevenyi Sep 25, 2026
219d3dc
feat(engine): keep the token embedding in pinned host ram (--embed-we…
gdevenyi Sep 25, 2026
798ae01
fix(layers): gather fp32 host embeddings and refuse other dtypes at p…
gdevenyi Sep 25, 2026
a7c2afb
fix(kernel): compute the host gather output offset in int64
gdevenyi Sep 25, 2026
adac17c
fix(engine): charge the host embedding's pinned bytes to the pin budget
gdevenyi Sep 25, 2026
1f1b2a2
fix(engine): refuse --embed-weights host for a tied embedding or tp >…
gdevenyi Sep 25, 2026
009f5fd
test(engine): fake cached_load_hf_config with the overrides argument …
gdevenyi Oct 2, 2026
bf6c6ee
test(ple): drive overlapped graph fills against an in-order fake stre…
gdevenyi Oct 2, 2026
d705ebb
merge #578: perf(moe): dequant nvfp4 prefill experts by bit placement…
gdevenyi Oct 2, 2026
cee58f6
fix(kernel): keep one e4m3_f32_to_u8, #408's copy duplicates the one …
gdevenyi Oct 7, 2026
4ec2dbd
fix(server): leave late Anthropic system messages to the inline-syste…
gdevenyi Oct 7, 2026
4c7e83c
test(server): give main's DeepSeek-V4.1 detector its contract class a…
gdevenyi Oct 7, 2026
662571d
merge #614: fix(server): leak no semaphores when a signal stops the s…
gdevenyi Oct 7, 2026
2582ae7
merge #593: fix(checkpoint): refuse converting into a directory that …
gdevenyi Oct 7, 2026
52609c5
feat(qwen4_exp): read llm-compressor (compressed-tensors) NVFP4 route…
gdevenyi Oct 7, 2026
d65e5db
test(moe): let the prefetch counter test's copy spies pass #610's blo…
gdevenyi Oct 7, 2026
4827715
merge #650: fix(engine): apply shrinking cache resizes before growing…
gdevenyi Oct 15, 2026
bfdb930
merge #635: perf(moe): avoid intra-op fanout while filling NVFP4 host…
gdevenyi Oct 13, 2026
ec9b0b8
merge #668: test(moe): grant one bf16 ulp only at rounding ties in th…
gdevenyi Oct 13, 2026
0f282b0
test(engine): give #650's rebuild engine fake the kv offloader and gd…
gdevenyi Oct 13, 2026
67a9204
test(server): expect out-of-range penalties to fail request validation
gdevenyi Oct 13, 2026
9567150
fix(kernel): decode nvfp4 qsa prefill tiles narrow at head_dim 256
gdevenyi Oct 13, 2026
1fb005b
merge #676: feat(moe): load a short prefill chunk's experts on demand…
gdevenyi Oct 15, 2026
e307025
fix(kernel): size triton's autotune flush buffer to the device l2
gdevenyi Sep 25, 2026
4b263dd
test(utils): drive the async coalesced-pull test with asyncio.run
gdevenyi Oct 13, 2026
5ca8590
fix(engine): keep multimodal placeholder ids out of the repetition-pe…
gdevenyi Sep 24, 2026
7de35d9
fix(engine): apply the repetition penalty from device state, not a pe…
gdevenyi Sep 25, 2026
be43d10
fix(server): clarify unsupported response_format error text
Oct 5, 2026
bf58e80
fix(mm): classify image fetch errors and re-check redirect targets
Avicennasis Oct 3, 2026
4c83feb
test(engine): cover presence/frequency penalties on the greedy and sa…
gdevenyi Sep 25, 2026
923fd4a
perf(model): fuse hc combine with the next block's RMSNorm via hc_com…
Oct 2, 2026
ada9f8d
fix(kernel): bit-exact rmsnorm reduction tree in hc_combine_norm
Oct 2, 2026
bad406c
test(kernel): bitwise pin for hc_combine_norm against the split path
Oct 2, 2026
51debf6
fix(server): soft-accept OpenAI response_format json_object/json_schema
Oct 5, 2026
d3e8e35
refactor(server): drop response_format system-hint injection
Oct 5, 2026
56561e2
test(engine): drop the pre-volta sampling penalty test, whose torch f…
gdevenyi Oct 13, 2026
f42330e
fix(moe): align on triton past sgl_kernel's 1024-expert limit
gdevenyi Oct 13, 2026
f091909
fix(moe): refuse the global-slot moe features when the cache has seve…
gdevenyi Oct 15, 2026
475e4d7
test(moe): restore the #676 merge's on-demand test updates the replay…
gdevenyi Oct 15, 2026
ac05b40
fix(moe): keep bank_views for the one-pool slot cache
gdevenyi Oct 15, 2026
993fd3e
test: give the rebuild and scored-ensure fakes the slot-pool api of #689
gdevenyi Oct 15, 2026
3694e64
fix(moe): index the per-layout copy row bytes in the verify and audit…
gdevenyi Oct 15, 2026
3c1fc7b
test(kernel): cover the device-sized autotune flush buffer
gdevenyi Sep 25, 2026
ead36ca
merge #223: validate sampling params and rebuild timeout at the API l…
gdevenyi Oct 15, 2026
d5907fc
fix(server): accept top_k <= 0 as "disabled", as vLLM and the OpenAI-…
gdevenyi Sep 26, 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