Optimize and benchmark Qwen3.8 Flash Next on Apple silicon #99
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Area
Optimize the completed Qwen3.8 Flash Next path on the user's M5 Max MacBook Pro, meet the same-model MTPLX target, publish parity/performance receipts, and enable the model's production defaults.
Sequence
Step 7 of 7. Previous: #98. This is the final issue. Start only after correctness, long-context state, and MTP are complete.
Baseline contract
mtplx serveand DS4Server on the same M5 Max MacBook Pro with the exact pinned Bare Speed model/precision map, single stream, fans verified at maximum, identical prompts/context, official sampling at temperature 1.0/top-p 0.95/top-k 20, and controlled thermal/load order.Optimization order
Performance target
The primary target is the exact MTPLX Bare Speed pack. Its public same-task M5 Max result is 47.0 tok/s plain AR and 75.9 tok/s MTP; MTPLX 2.10 also reports approximately 61 tok/s AR and 63–76 tok/s MTP depending on workload.
Verification and receipts
Completion requirements
Non-goals
hugo referenced this issue2026-09-01 18:27:01 +00:00
Implemented and delivered in commit
bd63538(pushed to origin/main).The Qwen3.8 Flash Next path now follows the pinned MTPLX/MLX execution contract end to end: exact affine QMV/QMM and BF16 rounding, fused GDN input/conv/recurrent/verifier capture, row-owned router and merged gate/up, MTPLX qsa_flash_skip long-context attention, streamed group-32 PLE with bounded hot cache and telemetry, NumPy-compatible PCG64 plus official temperature 1.0/top-p 0.95/top-k 20 sampling, exact MTP accept/reject/cache repair and full-accept bonus, stable allocation/pipeline reuse, and device-side sparse sampling. Experimental NAX, custom verifier MoE, scalar QMM, altered Metal math, and shortened recurrence paths were removed after oracle failures or lack of a measured win. MTP is now the Qwen production default while an explicit user opt-out remains authoritative. Non-Qwen sampling remains on the DS4 behavior.
Measured on Mac17,7 / Apple M5 Max / 128 GiB / macOS 26.6.2. The matched 4096-context, 26-prompt-token, 64-output-token acceptance sequence reached a 60.825779 tok/s three-run MTP median with stable token SHA-256 46ce63601c44d80b5ef8297eaa49a636f6680040b916fe30cf7a154c05daef72, 44 accepted of 60 drafts, and 20 verifier passes. A later confirmation sequence under the then-current load measured 58.019436 tok/s with the identical token hash. Both are within 5% of the fresh matched MTPLX median 59.751170 tok/s. Plain AR median was 50.671077 tok/s. Peak MTP RSS is 52.61 GB, down from the original 102.65 GB path. Long-context oracle coverage passed at 2K, 16K, 64K, 131K, and 262K.
The public 75.9 tok/s figure is not the matched workload result. The current installed MTPLX package/source combination later refused the Flash Next pack because of source-package drift, so no invalid fresh AR number was substituted. Fan boost was also unavailable because neither supported fan utility is installed; both engines were compared under the same no-boost constraint.
Receipts: docs/QWEN38_PERFORMANCE.md and docs/qwen38-issue-99.csv.
Verification passed: