Skip to content

5080deploy: rebuild on upstream main 07813248 (upstream #631 marlin decode, +3% decode; nothing superseded) - #84

Open
gdevenyi wants to merge 107 commits into
5080/base-ecb52158from
5080/39-rebuild-07813248
Open

gdevenyi wants to merge 107 commits into
5080/base-ecb52158from
5080/39-rebuild-07813248

Conversation

@gdevenyi

@gdevenyi gdevenyi commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Stacked on #82. The base 5080/base-ecb52158 is the previous 5080deploy tip. This PR rebuilds 5080deploy on upstream main 07813248, which has 4 new commits:

Superseded work: none this round. None of the 4 commits is patch-equivalent to a fork commit, and all 103 replayed steps still change something on the new base. The carried PRs whose upstream heads moved (FlashML-org#408, FlashML-org#435, FlashML-org#572, FlashML-org#578) have identical content, so their recorded heads are kept.

Replay: the same method as #81. Two hand resolutions:

Effect in production. Only FlashML-org#631 changes what this deployment runs: it is the Triton NVFP4 MoE decode GEMV, used in every layer at every decode step. An r4-without-FlashML-org/FreeToken#631 arm reproduces the previous greedy fingerprints bit-for-bit in both rounds.

Interleaved A/B, 2 rounds, RTX 5080, production config (2100 slots, rule eviction, prefetch, host embedding):

prod ecb52158 this PR
decode 128K (tok/s) 51.15-51.50 52.61-52.98 (+2.8%)
decode 64K 51.86 / 51.98 53.39 / 53.44 (+2.9%)
decode 32K (rep 1 / rep 2) 53.4 / 53.7 52.4 / 55.3
decode 255K + side calls 47.22 48.79 (+3.3%)
255K peak VRAM 15616 MiB 15616 MiB
quality.py 14/15 14/15
misses/token 93.8 95.1

Tests:

  • Kernel tests: 179 passed (nvfp4 backends, e4m3, triton attention, kv fp8/nvfp4, qsa nvfp4, qsa kernels).
  • Full not-slow GPU suite: 3506 passed. The only failures are the 4 known environment ones and upstream's test_dsfp4_reference_semantics GEMV case, which fails the same way on pure upstream on sm_120.

Not merged this round:

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bu6LgoxLR4wETqb7RPR2vt

jason-fxz and others added 30 commits October 7, 2026 22:42
…ention (FlashML-org#632)

* perf(kernel): skip masks and out-of-window tiles in triton extend attention

* perf(kernel): drop the sm90-only register cap and k/v pipelining in triton extend attention
# Conflicts:
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/qsa_pool.py

# Conflicts:
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/qsa_pool.py

# Conflicts:
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/qsa_pool.py

# Conflicts:
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/qsa_pool.py
#	tests/kernels/test_e4m3_compat.py

# Conflicts:
#	docs/cli.md
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/base.py
#	python/freetoken/kvcache/qsa_pool.py
#	tests/kernels/test_e4m3_compat.py

# Conflicts:
#	docs/cli.md
#	docs/models.md
#	python/freetoken/attention/triton.py
#	python/freetoken/kernel/triton/attention.py
#	python/freetoken/kvcache/__init__.py
#	python/freetoken/kvcache/base.py
#	python/freetoken/kvcache/qsa_pool.py
#	tests/kernels/test_e4m3_compat.py
Assisted-by: Claude Opus 5
(cherry picked from commit 150c95d)
(cherry picked from commit 4db8b85)
(cherry picked from commit 495770e)
# Conflicts:
#	tests/tokenizer/test_tokenize.py

# Conflicts:
#	tests/tokenizer/test_tokenize.py
…d-request

# Conflicts:
#	python/freetoken/engine/config.py

# Conflicts:
#	python/freetoken/engine/config.py

# Conflicts:
#	python/freetoken/engine/config.py

# Conflicts:
#	python/freetoken/engine/config.py

# Conflicts:
#	python/freetoken/engine/config.py
… is measurable

# Conflicts:
#	python/freetoken/engine/engine.py

# Conflicts:
#	python/freetoken/engine/engine.py

# Conflicts:
#	python/freetoken/engine/engine.py

# Conflicts:
#	python/freetoken/engine/engine.py

# Conflicts:
#	python/freetoken/engine/engine.py
…acked on FlashML-org#385 TP)

# Conflicts:
#	python/freetoken/models/qwen4_exp/attention.py
#	python/freetoken/models/qwen4_exp/config.py
#	python/freetoken/models/qwen4_exp/weight.py

# Conflicts:
#	python/freetoken/models/qwen4_exp/attention.py
#	python/freetoken/models/qwen4_exp/config.py
#	python/freetoken/models/qwen4_exp/weight.py

# Conflicts:
#	python/freetoken/models/qwen4_exp/attention.py
#	python/freetoken/models/qwen4_exp/config.py
#	python/freetoken/models/qwen4_exp/weight.py

# Conflicts:
#	python/freetoken/layers/quantization/moe/nvfp4.py
#	python/freetoken/models/qwen4_exp/attention.py
#	python/freetoken/models/qwen4_exp/config.py
#	python/freetoken/models/qwen4_exp/weight.py

# Conflicts:
#	python/freetoken/layers/quantization/moe/nvfp4.py
#	python/freetoken/models/qwen4_exp/attention.py
#	python/freetoken/models/qwen4_exp/config.py
#	python/freetoken/models/qwen4_exp/weight.py
… read

Assisted-by: Claude Opus 5
(cherry picked from commit 82a21ae)
(cherry picked from commit 0369ed9)
(cherry picked from commit b5c7812)
… cpu build test

Assisted-by: Claude Opus 5
(cherry picked from commit 27ad92e)
(cherry picked from commit e152f66)
(cherry picked from commit 333f7f9)
…s the quantized-kv backend reads

Assisted-by: Claude Opus 5
(cherry picked from commit 600819f)
(cherry picked from commit dd2ebdf)
(cherry picked from commit 12754d4)
…e Hugging Face repo ids to a local checkpoint dir

# Conflicts:
#	python/freetoken/utils/hf.py
…verage

# Conflicts:
#	python/freetoken/tokenizer/tokenize.py

# Conflicts:
#	python/freetoken/engine/sample.py
#	python/freetoken/tokenizer/tokenize.py

# Conflicts:
#	python/freetoken/engine/sample.py
#	python/freetoken/tokenizer/tokenize.py

# Conflicts:
#	python/freetoken/engine/sample.py
#	python/freetoken/tokenizer/tokenize.py
…onfig

Fork #19 asks the model family to check the stored fp8 split against the env flags; a
synthetic FTW written straight from tensors (upstream's test_ftw_weights) carries no
config.json, so there is no family to ask and the read proceeds as before.

Assisted-by: Claude Fable 5.1
(cherry picked from commit cab9be3)
(cherry picked from commit e59e544)
…the admission clamp reads

Assisted-by: Claude Fable 5.1
(cherry picked from commit 4584957)
(cherry picked from commit 0ab1764)
…thinking-mode

returned early, so reasoning_effort / reasoning.effort / thinking.type were silently turned
off under --default-thinking-mode chat. count_tokens also skipped the default.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 8276ccd)
…meters

FlashML-org#435 sends any parameter it cannot type to the loose JSON parser, so an untyped
string enum member such as "1" came back as the integer 1, outside the enum.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit ab2693c)
Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 7ccc433)
The full response and the closing signature_delta already send signature="", but
exclude_none dropped it from content_block_start, where the SDK types it as required.
Taken from upstream FlashML-org#517 (b044276).

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 55a8e72)
Upstream FlashML-org#517 tests without its docs and pyproject dev-extra: the SDK tests importorskip
anthropic/openai/httpx so the server suite still collects without them.

(cherry picked from commit b044276, tests only)

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 50f99d1)
…lp, which it does not serve

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit c6b7ce7)
…rging system messages

render_messages hoisted system ahead of a leading developer message, which the
tokenizer then merged as "S\n\nD"; it now leaves developer requests to the
tokenizer's per-template mapping. Both merge sites joined str() of an image
part list into the prompt, data URL included; they now raise the template's
400 instead.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit e60b2c3)
… in every layer

An unpinned layer's copy_missing is the whole-layer pageable copy, which cannot serve
the LRU slot remap, so it keeps streaming. The per-layer fallback when a layer routes
to more than half the cache is gone: the engine's num_experts slot floor already keeps
every chunk resident, and a uniform path cannot leave a later layer in an overlap
buffer that was never begun.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 37c2479)
`torch.equal` fails for all three cut points on torch 2.11.0+cu130 /
flashinfer 0.6.18 / triton 3.6.0 (sm_89): cuBLAS picks a different kernel
for M=5000 and M=5000-cut, so the indexer's q and k round differently, a
few rows flip one block at the top-k margin, and the layer output differs
by up to 2.6e-3 (a few bf16 ulps). Both paths are deterministic run to run.
Use the tolerance of the neighbouring oracle tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0173pf9k9fSVtwbm3f898HDt
(cherry picked from commit 3849e3c)

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit e700e8f)
…o the one-shot run

At bf16 output tolerance a broken dual-source compress only swaps a block in a few rows
and passes; the slab keys are unit-scale, so a wrong straddling-group key stands out.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit cedf179)
…ked prefix

min_p (FlashML-org#393) writes -inf over most of the vocabulary; a column chunk or leading block that
is -inf throughout computed exp(-inf - -inf) = NaN and poisoned the whole row. Pascal
samples through this softmax (no flashinfer below sm_75), so min_p > 0 drew uniform noise.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit dbe82ad)
…ights host)

The embedding is a row lookup, so a single-GPU engine can leave the table in page-locked
host RAM and gather each step's rows over UVA with the PLE row kernel (5 KiB per decode
token, graph-safe): 1.2 GiB of VRAM back for Qwen3.8-Flash-Next.

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 9f2b7a2)
…lacement

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit ccfb2b8)
No regression test: overflowing it needs an output of 2^31+ elements (4 GiB+ in bf16).

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit cc5af7a)
Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit a8b2f0a)
… 1 at config time

Assisted-by: Claude Opus 5.5 (1M context)
(cherry picked from commit 579e03a)
…am so a post-launch fence fails as a hang

Upstream FlashML-org#588's _graph_consumed fence is left out of the merge: our graph fill runs on the
filler thread before its own launch passes its WAIT, so that fence deadlocks the second step.

Assisted-by: Claude Opus 5.5
…t placement and load activations contiguously

# Conflicts:
#	tests/kernels/test_e4m3_compat.py

# Conflicts:
#	python/freetoken/kernel/triton/e4m3_compat.py
#	tests/kernels/test_e4m3_compat.py

# Conflicts:
#	python/freetoken/kernel/triton/e4m3_compat.py
#	python/freetoken/kernel/triton/nvfp4_fused_moe.py
#	tests/kernels/test_e4m3_compat.py
…es the one FlashML-org#603 added to main

Assisted-by: Claude Opus 5.5
…m policy instead of hoisting them

FlashML-org#487's hoist ran before FlashML-org#608's fold on /v1/messages and moved a late system reminder into
the system head, so every reminder missed the prefix cache; the OpenAI and Responses
paths keep the hoist the qwen templates need.

Assisted-by: Claude Opus 5.5
…nd the count fake the inline-system kwarg

Assisted-by: Claude Opus 5.5
…d experts

The expert spec now takes its tensor names and global-scale direction from the checkpoint's
quant config, as qwen3_5_moe does, so RedHatAI/Qwen3.8-Flash-Next-NVFP4 loads and converts;
the nvidia modelopt checkpoint keeps the same spec.

Assisted-by: Claude Opus 5.5
…g#610's blocks_per_bank through

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants