[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"news-slug-apple-m5-integer-exact-mxfp4-int8-prefill":3,"topics-all":38,"news-related-02d227b5-3e7f-4a76-b277-f010d040059c":67},{"id":4,"title":5,"summary":6,"content":7,"original_url":8,"source_id":9,"tags":10,"translations":24,"news_slug":31,"published_at":32,"created_at":33,"modified_at":34,"is_published":35,"publish_type":36,"image_url":14,"view_count":37},"02d227b5-3e7f-4a76-b277-f010d040059c","苹果 M5 跑 4-bit:改写权重整数,快 1.34 倍","苹果 M5 的 INT8 矩阵单元比 FP16 快近两倍,但市面 4-bit 量化都先反量化回 FP16,整数通路一直闲置。有预印本把 MXFP4 权重改写成精确整数,让线性层跑成单次 INT8 GEMM,预填充快 1.34 到 1.74 倍,但解码基本没有提速,精度也输给社区主流的五比特量化格式。","## 苹果 M5 的整数快车道,一直没人走\n\n先说结论:苹果 M5 的 GPU 里每个核都带一个叫 Neural Accelerator 的矩阵引擎,纯 INT8×INT8 的吞吐大约是 FP16 的两倍。但前提是两个操作数都得是整数——论文测到,FP16×INT8 和 FP16×INT4 反而只有 FP16 的 0.68 到 0.96 倍,比什么都不做还慢。\n\n问题在于,现在 Mac 上跑的 4-bit 模型走的全是反量化路线。MLX 官方 issue #4627 里,开发者 magnuslundstedt 在 M6 上测过:MLX 0.32.3 的所有量化矩阵乘(affine 2 到 8 bit、mxfp4、mxfp8、nvfp4)都把打包权重解包进 threadgroup 内存,然后跑一次 FP16\u002FBF16 的 GEMM,硬件那几条 8-bit 通路一次都没被用上。量化后的 prefill 被死死摁在 FP16 速率上:同一台 M6 上,int8×int8 跑 26.9 TOPS(1.98 倍),原生 4-bit 量化矩阵乘只有 18.9 TF\u002Fs。8-bit 通路不是不存在,是被格式和运行时联手浪费掉了。\n\n论文给的办法出人意料地朴素:不改模型,不改权重文件格式,只把权重换个写法。原始论文见 [arXiv:2611.00486](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.00486)。\n\n## MXFP4 的权重,本来就能整成整数\n\nMXFP4 的元素值用 E2M1 编码。论文的观察是:把一个 E2M1 值乘 2,结果正好落进整数集合 {0,±1,±2,±3,±4,±6,±8,±12} —— 这个事实现有的 MXFP4 内核早就在用,只是拿它们去构造 INT8 操作数。\n\n再进一步。设某一行的块指数跨度 sn = 最大块指数 − 最小块指数。论文证明:当 sn ≤ 3 时,这一行所有元素乘 2 之后的绝对值不超过 96,正好落在 INT8 的动态范围里,于是这一行可以精确表示成「一个 INT8 向量 × 一个 2 的幂缩放因子」。整个线性层于是塌缩成一次完整的 INT8 GEMM,每个输出只做一次 rescale。INT32 累加也不会溢出,只要 K ≤ 约 176k。\n\n那如果 sn 大于 3 呢?论文的做法是强行把过小的块指数抬到 max−3,代价被证明极其有限:被改动的块的绝对舍入误差最多是该行最大舍入误差的 1\u002F16。而且约束只碰那些相对本行就很小的块,对输出的贡献本就有限。\n\n关键是真实权重几乎天然满足这个条件。论文在七个模型上统计,符合条件(指数跨度 ≤ 3)的权重行占 97.9% 到 99.97%;那台 125B 的 Qwen3.8-Flash-Next 更是 95.4M 行里有 99.93% 合格。改造后的文件仍然是标准 MXFP4,任何 MXFP4 解码器都能直接读。\n\n## 实测:预填充提速,解码原地不动\n\n论文在 M5 Max(128GB)上跑完整系统。稠密模型 Qwen3-1.7B 上,首 token 延迟相对 MLX 的 MXFP4 快 1.34 到 1.74 倍,相对 llama.cpp 快 1.56 到 2.49 倍;MoE 上分别是 OLMoE-1B-7B 的 1.20 到 1.57 倍、Qwen3.5-35B-A3B 的 1.10 到 1.43 倍。整条 W4A8 系统在 M5 上输出的 logits 与量化参考实现逐比特一致。\n\n精度也顺手赚了:在 125B 的 Qwen3.8-Flash-Next 上,把每一个矩阵都量化之后,论文的整数精确格式在 GSM8K 上解出 94.8%,而 MLX 的 MXFP4 是 91.0%;对 FP8 模型的 KL 散度 0.0557,和带 scale search 的 NVFP4 的 0.0553 基本持平。另外只量化那 73,728 个 routed expert 矩阵(占参数 96%),论文自己的格式困惑度损失最多 0.2%(其他 FP4 格式最多 0.4%)。\n\n但速度账的另一面必须说清楚。解码几乎没有收益:稠密模型和 OLMoE 上是 MLX 的 0.99 到 1.01 倍,Qwen3.5-35B-A3B 上是 0.90 到 0.91 倍,也就是略慢。原因很直白,batch 1 解码时每个权重只被读一次算一次,瓶颈是显存带宽和 kernel 延迟,INT8 算术帮不上忙。\n\n而在 125B 那台模型上,端到端加速只有 1.22 到 1.29 倍,比单独隔离测到的专家层 1.33 到 1.65 倍缩水明显——论文的解释是,每次 prefill 有大约 0.5 秒花在 W4A8 矩阵之外(DeltaNet 递归、注意力、96 个残差混合器、主机侧的 n-gram 查询)。更麻烦的是那个更准的整数精确格式,因为文件不再兼容 MXFP4,无法复用 MLX 的解码 kernel,在 125B 上解码速度掉到 MLX 的 0.65 倍。\n\n## 泼两盆冷水\n\n第一,精度上并非没有代价。论文自己承认,llama.cpp 的 Q4_K_M(约 5 bit 每权重,部分张量留在 6 bit)在全文都比他们的格式更准;换成 INT8 激活还会再加 0.7 到 2.8 个点困惑度。他们也没做 block rotation 配 GPTQ 的组合。\n\n第二,这是一份还没有社区验证的预印本。仓库 [shinyoungkang1\u002Fmxfp4-int8-m5](https:\u002F\u002Fgithub.com\u002Fshinyoungkang1\u002Fmxfp4-int8-m5) 只有 5 次提交、0 star、0 fork,MIT 协议,复现需要 M5 系芯片、macOS 26 加 Metal 4,125B 那条线还得自己编译 mlx-lm 的 PR 分支。作者分别来自 UT Southwestern、Emory、Duke 和 CMU,不是苹果的人——他们做的是把苹果硬件上那条没人走的路走通。\n\n## 所以呢\n\n这篇论文真正的价值可能不在那些加速比,而在于它把一个大家都默认了的浪费摊开:4-bit 量化在 Mac 上省的是显存,不是算力;你换来的是更小的模型和更慢的 prefill,同时把硬件那条 2 倍速的整数通路整个闲置。\n\n有意思的是,苹果自己没动,社区先动了。MLX 那个 issue 从 2026 年 10 月 5 日挂到现在,补丁作者后来补上了实测:int8 暂存方案让量化 prefill 在 M6 上提升 1.39 倍、最差领域困惑度代价 +0.92%,解码不变。同一个硬件事实,论文作者和 MLX 社区在两个地方各自独立测到了。\n\n而这篇论文还留了个更硬的引子:它用一条纯数学的构造,证明了 4-bit 权重和 INT8 单元之间那道所谓的墙,本来就没有那么宽——大部分真实权重本来就已经站在能整成整数的那一边,只是没人去证明它。","https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.00486","7437aeb9-930c-4866-a2e9-48003c1a792b",[11,15,18,21],{"id":12,"name":13,"slug":13,"description":14,"color":14},"0ef8513a-0a26-42f0-b6f9-5b6dadded45c","efficiency",null,{"id":16,"name":17,"slug":17,"description":14,"color":14},"e0d31e94-ce47-4c8f-831c-d3d2926d42f3","hardware",{"id":19,"name":20,"slug":20,"description":14,"color":14},"0a93ec8e-ea39-4693-81de-563ca8c173f7","inference",{"id":22,"name":23,"slug":23,"description":14,"color":14},"b49648f9-963e-4082-8684-3d085b7358fe","quantization",[25],{"id":26,"lang":27,"title":28,"summary":29,"content":30},"86ed46bc-4aaf-465d-860c-4ad7a3eb71d9","en","Apple M5 integer-exact MXFP4 speeds up prefill","Apple M5 has INT8 units at 2x FP16, but 4-bit formats dequantize to FP16. A preprint makes MXFP4 weights exact integers, lifting prefill 1.34-1.74x.","## Apple's M5 has an integer fast lane nobody was driving\n\nStart with the hardware fact: every GPU core in Apple's M5 carries a matrix engine called the Neural Accelerator, and a pure INT8×INT8 matmul runs at roughly twice the FP16 rate. But the catch is that both operands have to be integers. The paper measures FP16×INT8 and FP16×INT4 at only 0.68 to 0.96× the FP16 rate, which is slower than doing nothing clever at all.\n\nThe problem is that every 4-bit model running on a Mac today takes the dequantization route. In MLX's own issue #4627, developer magnuslundstedt measured on an M6 that all quantized matmuls in MLX 0.32.3 (affine 2-to-8-bit, mxfp4, mxfp8, nvfp4) unpack the packed weights into threadgroup memory and then run an FP16\u002FBF16 GEMM, so the hardware's 8-bit lanes are never used. Quantized prefill is pinned to the FP16 rate: on that same M6, int8×int8 hits 26.9 TOPS (1.98×), while the stock 4-bit quantized matmul reaches only 18.9 TF\u002Fs. The 8-bit path is not missing from the hardware; it is wasted by the format and the runtime together.\n\nThe paper's fix is surprisingly plain: do not change the model, do not change the weight file format, just rewrite the weights. The original paper is [arXiv:2611.00486](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.00486).\n\n## MXFP4 weights were already integers waiting to happen\n\nMXFP4 elements use E2M1 encoding. The paper's observation: doubling an E2M1 value lands exactly in the integer set {0, ±1, ±2, ±3, ±4, ±6, ±8, ±12} — a fact existing MXFP4 kernels already exploit to form INT8 operands.\n\nOne step further. Define a row's block exponent spread as the largest block exponent minus the smallest. The paper proves that when the spread is at most 3, every doubled element in that row has absolute value at most 96, which lands squarely inside the INT8 range. The row can then be represented exactly as one INT8 vector times one power-of-two scale. The whole linear layer collapses into a single INT8 GEMM over the full reduction dimension with one rescale per output, and INT32 accumulation cannot overflow as long as K is at most about 176k.\n\nWhat if the spread exceeds 3? The paper simply raises the too-small block exponents up to max minus 3, and shows the cost is negligible: the absolute rounding error of every modified block is at most 1\u002F16 of the row's largest rounding error. The constraint also only touches blocks that are small relative to their own row, so they contribute little to the output anyway.\n\nThe key point is that real weights almost naturally satisfy this condition. Across seven models the paper finds that 97.9% to 99.97% of weight rows meet the condition; on the 125B Qwen3.8-Flash-Next, 99.93% of 95.4M rows qualify. The rewritten files remain standard MXFP4, so any MXFP4 decoder reads them unchanged.\n\n## Measured: prefill speeds up, decode does not\n\nThe paper runs a complete system on an M5 Max (128GB). On the dense Qwen3-1.7B, time to first token is 1.34 to 1.74× faster than MLX's MXFP4 and 1.56 to 2.49× faster than llama.cpp; on the MoEs it is 1.20 to 1.57× on OLMoE-1B-7B and 1.10 to 1.43× on Qwen3.5-35B-A3B. The entire W4A8 system on the M5 produces logits that are bit-identical to the quantized reference.\n\nAccuracy comes along for the ride. On the 125B Qwen3.8-Flash-Next, with every matrix quantized, the paper's integer-exact format solves 94.8% of GSM8K versus 91.0% for MLX's MXFP4, and its KL divergence from the FP8 model is 0.0557, essentially level with the 0.0553 of NVFP4 with scale search. Quantizing only the 73,728 routed expert matrices (96% of the parameters) costs the paper's own format at most 0.2% perplexity, and other FP4 formats at most 0.4%.\n\nThe other side of the speed ledger has to be stated plainly. Decode gains essentially nothing: 0.99 to 1.01× MLX on the dense model and OLMoE, and 0.90 to 0.91× on Qwen3.5-35B-A3B, which is slightly slower. The reason is straightforward — at batch 1 decode each weight is read once and used once, so the bottleneck is memory bandwidth and per-kernel latency, where INT8 arithmetic does not help.\n\nAnd on the 125B model, end-to-end speedup is only 1.22 to 1.29×, well short of the 1.33 to 1.65× measured in isolation on the expert layers. The paper's explanation is that about 0.5 seconds of every prefill is spent outside the W4A8 matrices (the DeltaNet recurrence, attention, 96 residual-stream mixers, and a host-side n-gram lookup). The more accurate integer-exact format is more awkward still: because the files are no longer MXFP4-compatible, they cannot reuse MLX's decode kernels, and on the 125B model its decode speed drops to 0.65× MLX's.\n\n## Two cold buckets of water\n\nFirst, accuracy is not free. The paper itself admits that llama.cpp's Q4_K_M (about 5 bits per weight, with some tensors left at 6 bits) is more accurate than its formats throughout, and that switching to INT8 activations adds another 0.7 to 2.8 points of perplexity. They also did not evaluate block rotations combined with GPTQ.\n\nSecond, this is a preprint with no community validation yet. The repository [shinyoungkang1\u002Fmxfp4-int8-m5](https:\u002F\u002Fgithub.com\u002Fshinyoungkang1\u002Fmxfp4-int8-m5) has 5 commits, 0 stars and 0 forks under the MIT license, and reproducing it needs an M5-family chip, macOS 26 and Metal 4, with the 125B line requiring you to build an mlx-lm pull request branch yourself. The authors come from UT Southwestern, Emory, Duke and CMU rather than Apple — what they did was open a path on Apple's hardware that nobody had opened.\n\n## So what\n\nThe real value of this paper may not be the speedups at all. It is that it lays open a waste everyone had simply assumed: 4-bit quantization on a Mac saves memory, not compute. You get a smaller model and a slower prefill, while the hardware's 2× integer path sits completely idle.\n\nInterestingly, Apple did not move, but the community did. That MLX issue has been open since October 5, 2026, and the patch author later added measurements: the int8 staging approach raises quantized prefill by 1.39× on M6 at a worst-domain perplexity cost of +0.92%, with decode unchanged. The same hardware fact was measured independently in two places, by the paper's authors and by the MLX community.\n\nAnd this paper leaves a harder hook: with a purely mathematical construction it shows that the supposed wall between 4-bit weights and INT8 units was never that wide in the first place. Most real weights were already standing on the side that can be made into integers — nobody had just proved it.","apple-m5-integer-exact-mxfp4-int8-prefill","2026-11-03T03:23:27Z","2026-11-03T03:23:33.193650Z","2026-11-03T03:23:33.193663Z",true,"agent",354,[39,49,58],{"slug":40,"tag_slug":41,"title_zh":42,"title_en":43,"intro_zh":44,"intro_en":45,"id":46,"is_active":35,"created_at":47,"modified_at":48},"image-generation","text-to-image","图像生成：从文生图到逐框编辑的模型竞赛","Image Generation: from text-to-image to frame-level editing","文生图已是红海，战场正转向编辑与可控性：FLUX.2\u002F3 用开源和量化把生图搬进消费级显卡，Qwen-Image、Seedream 等国产模型紧咬不放，GPT Image 2 则把推理能力带进像素。本专题追踪图像生成与编辑模型的发布、架构演进、加速量化与商业化数据，看「好图」如何变成「可用的图」。","Text-to-image is a crowded race, and the frontier has moved to editing and control: FLUX.2\u002F3 push open weights and quantization onto consumer GPUs, Qwen-Image and Seedream close in from China, and GPT Image 2 brings reasoning into pixels. This topic tracks model releases, architecture shifts, acceleration work, and the business numbers behind \"pretty\" becoming \"usable\".","52de7c59-7864-4569-8ae7-3d656d26a1a1","2026-11-20T07:20:23.534506Z","2026-11-20T07:20:23.534527Z",{"slug":50,"tag_slug":50,"title_zh":51,"title_en":52,"intro_zh":53,"intro_en":54,"id":55,"is_active":35,"created_at":56,"modified_at":57},"ai-for-science","AI for Science 2026：从 UniPert 到 GPT-Rosalind 的硬核进化","AI for Science 2026: from UniPert to GPT-Rosalind","生命科学、化学材料、物理世界模型——AI 正在从\"语言工具\"变成\"实验伙伴\"。本专题收录 AI 在三大科学方向的关键节点：UniPert 统一基因与化学扰动空间、GPT-Rosalind 端到端生命科学推理、达摩院 AI 智能体 28 小时找到 4 种超导新材料、Anthropic Claude Science 把工作台做成标准品。","From language tool to lab partner — AI is reshaping life sciences, chemistry\u002Fmaterials, and physical world models. This topic covers the key milestones: UniPert unifying genetic-chemical perturbation spaces, GPT-Rosalind's end-to-end life-sciences reasoning, DAMO's AI agent discovering 4 superconducting materials in 28 hours, and Anthropic's Claude Science workbench going mainstream.","988a4300-5fab-41c4-b5d8-63711a2dc757","2026-09-10T01:34:15.296649Z","2026-09-10T01:34:15.296663Z",{"slug":59,"tag_slug":59,"title_zh":60,"title_en":61,"intro_zh":62,"intro_en":63,"id":64,"is_active":35,"created_at":65,"modified_at":66},"h3-series","MiniMax H3 系列：从开源权重到 35 倍吞吐","MiniMax H3 Series: from open weights to 35x throughput","MiniMax H3 自 2026 年 8 月开源以来节奏密集：官方把生成、参考与编辑收回一个模型；ComfyUI 当天压进 RTX 3060；摩尔线程 3 小时完成国产 GPU 适配；fal 后训练版把吞吐拉到 35 倍；FastH3 蒸馏再砍推理成本。本专题持续追踪 H3 的发布—开源—蒸馏—部署全链路。","Since MiniMax open-sourced H3 in August 2026 the pace has been relentless: one unified omni-modal model, same-day ComfyUI support down to an RTX 3060, a 3-hour Day-0 port to Moore Threads GPUs, fal's post-trained H3 Max at 35x throughput, and FastH3 distillation cutting inference cost further. This topic tracks the full H3 chain — release, open weights, distillation, deployment.","83ef0daa-3c31-4cb3-86ed-e5ee58654d5f","2026-09-08T07:33:19.942193Z","2026-09-08T07:33:19.942209Z",{"items":68},[69,74,79,84,89,94],{"id":70,"title":71,"news_slug":72,"published_at":73},"9940f11e-3f2c-4cb1-9310-1f1ad0940627","Enerzai 突破 AI 极低量化极限：1.58-bit 权重实现 77% 内存削减","enerzai-1-58-bit-77pct-memory-lg-uplus","2026-06-03T19:10:00+00:00",{"id":75,"title":76,"news_slug":77,"published_at":78},"cb1044d5-dc15-4f72-b720-e4a110f939e9","论文实测:视频KV缓存2比特量化,主体一致性92.02","temporal-rotation-2bit-kv-cache-video-diffusion","2026-11-21T21:30:00+00:00",{"id":80,"title":81,"news_slug":82,"published_at":83},"b80697dc-e9ee-40f5-a2c7-3944cd36abba","权重不等长:哈夫曼重编码,边缘LLM再省31.4%","lazyweights-huffman-edge-llm","2026-11-13T23:30:00+00:00",{"id":85,"title":86,"news_slug":87,"published_at":88},"081148f2-39eb-432d-8841-5cb1e58ed527","省内存还是多跑几遍:本地小模型怎么花推理预算才划算","quantization-bits-vs-option-order-budget","2026-11-12T09:10:00+00:00",{"id":90,"title":91,"news_slug":92,"published_at":93},"a6f5abcc-f1eb-4b6c-ba50-062836f50d0d","量化前先算一遍:二阶筛查排序能信,绝对值不能","quantization-fisher-screen-pre-registered-audit","2026-11-11T03:30:00+00:00",{"id":95,"title":96,"news_slug":97,"published_at":98},"62bc171e-2954-4c08-b3e8-d484acce7894","回放AUC 0.93,实跑却分不出:本地小模型升位门控","uncertainty-gate-local-llm-replay-vs-live","2026-11-10T17:57:51+00:00"]