[GH-ISSUE #566] DeepSeek on 4x RX 7900 XT / 2-socket Xeon: tuning numbers (TP4, drafter placement, DRAFT_VRAM) #233

Open
opened 2026-10-29 21:23:01 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Cass67 on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/566

Hi! I spent today tuning DeepSeek V4.1 Flash on a box that's a bit unusual for Maya and thought the numbers might be useful to you or anyone else with several AMD cards. Machine: Dell T7910, 2x Xeon E5-2699C v4, 1 TB DDR4-2400, 4x RX 7900 XT (gfx1100, ROCm 10). Model: unsloth's UD-Q4_K_XL pack with an MXFP8 Engram, all six experts, every CPU-lane expert copied into RAM. Each number is decode tok/s over 8 greedy 1K-token prompts (code review, explanation, math, story).

setup tok/s
v1.1.28 as it was this morning, --tp 2 (one pair per socket), in Docker 21.9
+ CAP_SYS_NICE so the RAM copies bind per socket, and #562's MPOL_LOCAL 30.5
v1.1.32 + #561-#564, --tp 2 30.9
+ HC_FUSE=2 ROUTE_FUSE=2 DECODE_TRIM=15 AR2_DECODE=1 31.7
--tp 4 instead 30.1
--tp 4 + those four + DRAFT_DEV=0,1,2 32.8
same + DRAFT_VRAM=32,32,32 35.0 / 35.1

The biggest jump was the first one. Without CAP_SYS_NICE Docker refuses mbind, so the per-node RAM copies weren't bound to their socket and each socket read about half its experts from the other one. #562 makes that failure visible.

TP4 surprised me. I'd assumed the all-reduces across sockets would kill it, but with two TP2 pairs the pairs never computed at the same time (rocprof showed 0% overlap), so the bubble cost more than the cross-socket sums.

After that, what mattered most was where the drafter goes. In a TP group the matched expert slots stop at the fullest member, so with the head and two drafter blocks on one card the other three sat on 3 to 5.7 GB of unused VRAM. Spreading the blocks one per card and capping their VRAM experts let every card hold about 285 more trunk experts. The cap has a clear sweet spot:

DRAFT_VRAM per block 0 16 32 64
tok/s 33.2 34.6 35.0 34.2

DRAFT_DEV=1,2,3 (head alone on the lead) balanced the VRAM best but came out a hair behind (34.8 / 34.9).

What I'd take from it for a multi-GPU box: run with CAP_SYS_NICE if you're in a container, and with --tp above 2 put the drafter blocks one per member rather than all on the lead, capping their VRAM experts at around a quarter of each block (32 of 128 here) so the trunk gets the room back.

Originally created by @Cass67 on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/566 Hi! I spent today tuning DeepSeek V4.1 Flash on a box that's a bit unusual for Maya and thought the numbers might be useful to you or anyone else with several AMD cards. Machine: Dell T7910, 2x Xeon E5-2699C v4, 1 TB DDR4-2400, 4x RX 7900 XT (gfx1100, ROCm 10). Model: unsloth's UD-Q4_K_XL pack with an MXFP8 Engram, all six experts, every CPU-lane expert copied into RAM. Each number is decode tok/s over 8 greedy 1K-token prompts (code review, explanation, math, story). | setup | tok/s | |---|---| | v1.1.28 as it was this morning, --tp 2 (one pair per socket), in Docker | 21.9 | | + CAP_SYS_NICE so the RAM copies bind per socket, and #562's MPOL_LOCAL | 30.5 | | v1.1.32 + #561-#564, --tp 2 | 30.9 | | + HC_FUSE=2 ROUTE_FUSE=2 DECODE_TRIM=15 AR2_DECODE=1 | 31.7 | | --tp 4 instead | 30.1 | | --tp 4 + those four + DRAFT_DEV=0,1,2 | 32.8 | | same + DRAFT_VRAM=32,32,32 | 35.0 / 35.1 | The biggest jump was the first one. Without CAP_SYS_NICE Docker refuses mbind, so the per-node RAM copies weren't bound to their socket and each socket read about half its experts from the other one. #562 makes that failure visible. TP4 surprised me. I'd assumed the all-reduces across sockets would kill it, but with two TP2 pairs the pairs never computed at the same time (rocprof showed 0% overlap), so the bubble cost more than the cross-socket sums. After that, what mattered most was where the drafter goes. In a TP group the matched expert slots stop at the fullest member, so with the head and two drafter blocks on one card the other three sat on 3 to 5.7 GB of unused VRAM. Spreading the blocks one per card and capping their VRAM experts let every card hold about 285 more trunk experts. The cap has a clear sweet spot: | DRAFT_VRAM per block | 0 | 16 | 32 | 64 | |---|---|---|---|---| | tok/s | 33.2 | 34.6 | 35.0 | 34.2 | DRAFT_DEV=1,2,3 (head alone on the lead) balanced the VRAM best but came out a hair behind (34.8 / 34.9). What I'd take from it for a multi-GPU box: run with CAP_SYS_NICE if you're in a container, and with --tp above 2 put the drafter blocks one per member rather than all on the lead, capping their VRAM experts at around a quarter of each block (32 of 128 here) so the trunk gets the room back.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#233
No description provided.