FP8 grouped-expert prefill with on-chip int4-to-e4m3 dequant
Ran Tao (Octoryn Research)
摘要
Prefill latency drops roughly 2.1x by making both the dense attention projections and the expert FFN FP8 (e4m3) and replacing per-token int4 expert dispatch with one grouped expert GEMM per layer, int4 weights dequantized to e4m3 on-chip. On a consumer 8 GB GPU, two single-run prefill configs show about 2.1x speedups versus the int4 baseline, at logit-cosine parity >= 0.997. Honest scope: single-run, two layer-depth configs, prefill-only; e4m3 cosine narrows with depth while staying above the parity gate. Parity is numerical agreement with int4, not a generation-quality measurement.
本 Research Object 以其原始语言(英文)发表。
1. Contribution
Claimed. On an idle consumer 8 GB GPU running real int4-quantized shards, making both the dense q/k/v/o attention projections and the expert FFN FP8 (e4m3) — and replacing per-token int4 expert dispatch (one dispatch per routed token per layer) with a single grouped expert GEMM per layer — speeds the prefill phase by 2.13x at depth L=8 and 2.18x at L=12, with logit parity cosine >= 0.997 versus the int4 baseline on the same inputs. A secondary engineering claim: int4 weights can be dequantized to e4m3 on-chip without unpacking the resident packed-int4 weight bank, with a per-(token, group) activation scale folded into the accumulator path.
NOT claimed. This is a prefill-phase latency engineering result on two layer-depth configurations on a single GPU — not a novel algorithm and not a benchmark-scale evaluation. It does NOT claim: (a) decode-phase speedups (only prefill was measured); (b) any statement about generation quality — cosine-of-logits parity is a numerical proxy, not a quality measurement; (c) that the cosine holds at greater depth — it is observed to narrow with depth (about 0.9987 at L=8 to 0.9973 at L=12); (d) dense-FP8 benefit at small prompt length (dense FP8 requires a sufficiently large prompt); (e) full-model behavior — only L=8 and L=12 subsets were measured. The altitude is a correctness-gated latency optimization, not a research contribution.
2. Methods
| Field | Value |
|---|---|
| Hardware | Consumer 8 GB GPU, idle |
| GEMM atom | e4m3 (FP8) tensor-core GEMM, shared with the output-projection path |
| Weight handling | int4 (packed) weights dequantized to e4m3 on-chip; resident bank stays packed int4 |
| Activation scaling | per-(token, group) scale folded into the accumulator path |
| Baseline | int4 (packed) per-token expert dispatch path, same shards/inputs |
| Stack | links against the vendor GPU runtime only (no third-party GEMM/DNN libraries) |
| Precision | FP8 e4m3 (3 mantissa bits) vs int4 baseline |
| Metric + gate | logit cosine vs int4 baseline, gate >= 0.997; argmax match |
| Inputs (stimulus) | real int4-quantized shards; L=8 and L=12 prefill configs |
| Oracle/baseline version | not recorded in source notes (baseline is the engine's own int4 path) |
| Runs / variance | single run per config; not recorded in source notes |
3. Results
| Config | Speedup vs int4 | Parity cosine | argmax |
|---|---|---|---|
| L=8, short prompt | 2.13x | 0.9987 | match |
| L=12, short prompt | 2.18x | 0.9973 | match |
| Attention-projection only (no MoE) | 2.7x | — | — |
Both MoE configs PASS the parity gate (>= 0.997).
Measured depth curve (this work)
A fresh single-run sweep on the same consumer 8 GB GPU, with a short prompt and FP8 prefill enabled, varying layer depth L. Cosine is final-logits FP8-vs-int4.
| layers (depth) | final-logits cosine (fp8 vs int4) | e2e prefill speedup | attn-proj speedup | argmax match | gate >=0.997 |
|---|---|---|---|---|---|
| 4 | 0.9992 | 1.67x | 2.69x | yes | PASS |
| 8 | 0.9989 | 1.73x | 2.66x | yes | PASS |
| 12 | 0.9979 | 1.76x | 2.70x | yes | PASS |
| 16 | n/a — FP8 weight prepare exceeded the 8 GB budget | — | — | — | — |
Cosine narrows monotonically with depth (about 0.9992 -> 0.9989 -> 0.9979) but stays above the 0.997 gate through L=12, with exact argmax match at every measured depth. At L>=16, FP8 weight preparation could not fit within the 8 GB VRAM budget (a resource limit on this hardware, NOT a correctness result) — so the depth curve here is capped at L=12 and the deeper-stack trend is unmeasured on this hardware. Attention-projection speedup is depth-stable (~2.66-2.70x); end-to-end speedup rises slightly with depth (1.67x -> 1.76x) as more layers amortize the dense win. (Coherence text from a partial layer stack is meaningless and is not a generation claim.)
4. Threats to validity / Limitations
- Sample size. Two prefill configurations on a single GPU. This is a latency smoke test on subsets, not a benchmark-scale evaluation. Full-model behavior was not measured.
- Single run, no variance. Latencies and speedups are single-run; no variance, confidence interval, or repeat count is recorded in source notes.
- Parity != quality. The >= 0.997 gate is logit-cosine versus the engine's own int4 baseline. It bounds numerical agreement with int4, NOT generation quality, and the int4 baseline is itself a lossy reference (not an fp16/fp32 oracle).
- Precision ceiling / depth trend. e4m3 has 3 mantissa bits and rounds harder than fp16. Cosine narrows monotonically with depth across the measured points (about 0.9987 at L=8 -> 0.9973 at L=12). The trend is downward toward the gate; nothing here proves the gate holds at greater depth.
- Scope of the speedup. Prefill only — decode was not measured. Dense FP8 only engages for sufficiently large prompts; the grouped expert path engages for any prompt length. The 2.7x attention-projection figure is reported without its own cosine.
- Evidence level. Carried as reproduced; source notes describe single-run measurements on two configs. The reproduction strength is bounded by the single-run, two-config scope above.
- Baseline-comparison weakness. Speedup is int4-path vs FP8-path within the same engine; there is no external/library baseline comparison.
5. Reproducibility / Provenance
- Hardware: Consumer 8 GB GPU, idle.
- Stack: links against the vendor GPU runtime only (no third-party GEMM/DNN libraries).
- Build/run toolchain: standard vendor GPU compiler at the target architecture, optimized C++ build.
- Validate-baseline caveat: the parity gate compares FP8 against the engine's own int4 path, which is a lossy reference; a stronger validation would anchor against an fp16/fp32 oracle, which is not recorded here.
声明边界
作者对范围的明确界定——本工作证明了什么、未证明什么——沿用自 Octoryn Research 的发表模型。
证明
- Making both the dense attention projections and the expert FFN FP8 (e4m3), with one grouped expert GEMM per layer, speeds prefill roughly 2.1x across two layer-depth configs at logit-cosine parity >= 0.997 versus the int4 baseline.
- int4 weights can be dequantized to e4m3 on-chip while the resident weight bank stays in its packed int4 form.
未证明
- That the e4m3 logit cosine holds at greater depth: it narrows with depth, staying above the parity gate but trending downward across the measured points.
- Decode-phase speedups, or generation quality, since logit-cosine is a numerical proxy rather than a quality measurement.
- Dense-FP8 benefit at small prompt length, which requires a sufficiently large prompt to engage.
- Anything beyond two single-run configs on one consumer GPU: no variance, no full-depth measurement, no external-library baseline.
适用于
- Prefill of real int4-quantized shards on an idle consumer 8 GB GPU, at the two measured layer-depth configs, with a prompt long enough to engage the grouped expert path.
不适用于
- Deep-stack cosine guarantees, decode-throughput claims, small-prompt dense-FP8 claims, generation-quality claims, or any multi-run or variance-sensitive comparison.
作者
- Ran Tao — 调查研究, 写作
引用本文
引用格式
Tao, R., Octoryn Research. (2026). FP8 grouped-expert prefill with on-chip int4-to-e4m3 dequant (BR-2026-0005). Octopus Research Institute.
BibTeX
@techreport{oribr20260005,
title = {FP8 grouped-expert prefill with on-chip int4-to-e4m3 dequant},
author = {Tao, Ran and {Octoryn Research}},
institution = {Octopus Research Institute},
year = {2026},
note = {Permanent ID BR-2026-0005. Not peer reviewed.}
}披露
- 资助
- 硬件与基础设施由 Octoryn / Octopus Core Pty Ltd 提供。
- 利益冲突
- Octoryn 提供商业推理与治理工具;相关发现独立报告。
