ds4 icon indicating copy to clipboard operation
ds4 copied to clipboard

DeepSeek V4.1 Flash: a ~3-bit (or mixed Q2/Q4) build for 256 GB Macs

Open maciekd opened this issue 1 month ago • 2 comments

Request

A roughly 3-bit build of DeepSeek V4.1 Flash 1017 (IQ3-class routed experts, or a mixed Q2/Q4 layout like the ds4f-q2-q4 build that exists for V4 Flash 0731) that keeps the main weights resident on a 256 GB Mac.

Why

The 256 GB tier currently has only two options for V4.1 Flash, and they sit on either side of it:

Build On disk Main weights resident 256 GB Mac
ds41f-q2 (IQ2_XXS/Q2_K imatrix) 341 GiB 152 GiB resident, ~100 GiB unused
ds41f-q4 483 GiB 294 GiB SSD streaming only
MXFP4 experts (1017, 9 parts) ~467 GiB ~280 GiB SSD streaming only

A 3-bit expert quant would land around 225 GiB of main weights. With the server's own planning numbers for the Q2 at --ctx 32768 (buffers 7.7 GiB, KV 0.2 GiB, 159.6 GiB planned), that is roughly 235 GiB planned, which fits with headroom for the OS. A mixed layout with Q4 experts on a subset of layers, as in the 0731 ds4f-q2-q4 file, would be the other way to spend the ~100 GiB this tier leaves on the table.

The Q2 is the heaviest quant in the lineup, and there is no published number for how much of the model's quality it keeps. A 3-bit build would give 256 GB machines (M3 Ultra, M5 Ultra) the same "resident, best quant that fits" choice the 128 GB and 512 GB tiers have.

Reference numbers from this machine

Mac Studio M5 Ultra, 256 GB, Metal, ds4 at 5379c1c, ds4-server --ctx 32768, resident ds41f-q2:

  • model residency 16 s cold, server listening at 18 s
  • prefill ~1380 t/s on a 16.5k-token chat prompt (~710 t/s on 4k)
  • generation 28 to 30 t/s
  • planned memory 159.6 GiB, so ~95 GiB of unified memory sits idle during inference

Happy to test a candidate build here (resident speed, --logprob-vectors, --long-context) if that helps.

maciekd avatar Oct 20 '26 21:10 maciekd

This is a very necessary suggestion. I have an M3 Ultra with 256GB of memory and the same need; I’m particularly looking forward to models better optimized for 256GB of RAM.

hduxiao avatar Oct 23 '26 03:10 hduxiao

Looking forward to ds4 being able to load the ISTA GSQ-RCO GGUFs for the DeepSeek-V4.1-Flash-1017 model.

lin16303 avatar Oct 24 '26 15:10 lin16303