From 852e6b8a5f2b3ee23c5cc8249165755d0435e7c7 Mon Sep 17 00:00:00 2001 From: Daigo Kimura <84138151+imD-5@users.noreply.github.com> Date: Mon, 26 Oct 2026 02:00:37 +0900 Subject: [PATCH] perf(dsv41): the default prefill chunk is 4096 rows, not 512 A chunk holds the prompt rows one forward processes, so a bigger chunk reads the expert weights once for more of them. On two GB10 a cold 64K prompt takes 28.14 s at 4096 rows against 30.87 s at 2048, and 8192 rows does not run: its MoE step overruns the allocator ceiling. --- src/tensorfold/families/deepseek_v41/cuda/engine.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tensorfold/families/deepseek_v41/cuda/engine.py b/src/tensorfold/families/deepseek_v41/cuda/engine.py index 84f465bc0b..7eb4be3cf3 100644 --- a/src/tensorfold/families/deepseek_v41/cuda/engine.py +++ b/src/tensorfold/families/deepseek_v41/cuda/engine.py @@ -20,7 +20,9 @@ from . import memtrace -PREFILL_CHUNK = int(os.environ.get("TF_DS_PREFILL_CHUNK") or 512) +# a prompt fills in chunks of this many rows: 4096 measured 28.14 s against 30.87 s for 2048 on a cold 64K prompt (two +# GB10), and 8192 overruns the allocator ceiling inside the MoE (exl3/experts.py:505) +PREFILL_CHUNK = int(os.environ.get("TF_DS_PREFILL_CHUNK") or 4096) # the RDMA gather's slot in MiB (default 4.25; 8 before): fp32 gathers up to it go over RDMA writes, larger ones over # NCCL. Decode's largest is a 16-row vocab-split head (4.14 MB); prefill chunks of 218-409 rows send 4.3-8 MB a gather # (over NCCL at 4.25). Pinned host memory a rank: slot x TF_RDMA_SLOTS x (1 + world) (4.25 MiB x 4 x 3 = 51 MiB; 96 at 8)