Archived
libr4d decode split law: bound the three-wave verify floor by workgroups (#342)
49ca5ff made a three-wave verify past 16k keep at least 64 segments a sequence. The declared scratch
is the worst over every sequence count up to max_seqs, so at 256 sequences it became 64x the law's:
h256/gqa12 at max_ctx 200000 went from 7.62 to 487.5 MiB a card, and the KV pool lost that (#342:
5-8 % prefill on an expert-tiered MoE).
The floor is now min(64, 1024 / units), units = KV heads x sequences. Up to eight sequences of two
KV heads it stays 64; at 16 it is 32, at 256 two, and the declared region stays at what eight
sequences need.
Measured on 2x R9700, Qwen3.8-27B MXFP4 TP2, k6_v4, speculation 7 without the short block (every
step an 8-row verify), forced segment counts, ms a decode step:
45k x8 64: 41.24, 32: 41.20, 16: 42.29
45k x12 64: 57.42, 32: 57.38, 16: 59.39
45k x16 64: 74.83, 32: 74.68, 16: 74.79
90k x8 64: 51.79, 32: 52.02, 16: 54.42
Up to 64 segments past eight sequences changes nothing; the new floor gives x12 42 and x16 32.
r4d_selftest's split-law case pins the region at 16 sequences (100k and 32k: 32 segments) and at
256 (2); it read 64 for all three before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8df39472b6
commit
f8e69c4825
2 files changed
+13
-1
No files matched your search
@@ -1091,6 +1091,9 @@ static void decode_split_law_case(const Plugin& pl) {
|
||||
{ 4, 8, 16384, 16, 20 }, { 2, 8, 16384, 32, 40 }, { 4, 8, 1024, 16, 20 },
|
||||
{ 1, 8, 1024, 32, 32 }, { 4, 8, 640, 16, 16 }, { 8, 4, 100000, 16, 16 },
|
||||
{ 16, 4, 100000, 8, 8 }, { 4, 1, 100000, 32, 32 }, { 1, 1, 100000, 128, 128 },
|
||||
/* Past eight sequences the floor shrinks to kVerifyFloorWorkgroups over the batch, so the region
|
||||
* stays at what eight sequences need (issue #342: 64 a sequence at max_seqs 256 made it 64x). */
|
||||
{ 16, 8, 100000, 32, 32 }, { 16, 8, 32768, 32, 32 }, { 256, 8, 100000, 2, 2 },
|
||||
};
|
||||
int bad = 0;
|
||||
for (const Want& w : want) {
|
||||
|
||||
Reference in new issue
Block a user