Files
Strata/tests/prefill/stream_floor_rule_test.cpp
T
Niko1221 75d91db5e2 prefill: the staged group entry for layers with no MMQ tile is the default on Windows gfx1151
On Windows, one gfx1151 card, with a layer set in which every layer has no MMQ tile and the fused kernels take it (UD-Q4_K_XL), a prompt piece below the
long-prompt floor takes the staged walk's fused group entry with nothing set: only the routed experts stream and run on the fused kernels, instead of a
dequantize and two FP16 GEMMs per routed expert. STRATA_PF_STAGED_FO=0 turns it off (the previous floor rule of 64 tokens then applies again);
STRATA_PF_STAGED_FO=1 still asks for it on any card.

The floor rule now only decides between the staged entry and the long path: with the entry on the floor stays 1,024, with it off the class floor is 64
as before. The entry writes FP32 down rows (bit-identical to the long path run with STRATA_PF_DM16=0 at 256 and 768 tokens).

Strix Halo, UD-Q4_K_XL, prompt ms, median of 3: 96 tokens 1,601 -> 320, 256 2,293 -> 446, 768 3,189 -> 799, 1,000 3,646 -> 980; the long path takes 395 / 507 / 836 / 1,012.
The default needs the staged walk's resident-group gather and its group entry (STRATA_PREFILL_GROUP_GATHER, STRATA_PF_FUSED); without them the class keeps the floor of 64.
2026-11-12 22:39:59 +01:00

34 lines
2.1 KiB
C++

// stream_floor_default (include/strata/prefill/stream_floor_rule.hpp): the chunk size from which a prompt chunk takes the long-prompt path.
// Only the measured class (Windows gfx1151) with a layer set that is fused-only on every layer AND without the staged fused entry leaves the 1,024 default. No GPU, no model.
#include <cstdio>
#include "strata/prefill/stream_floor_rule.hpp"
using strata::prefill::kFusedOnlyFloor;
using strata::prefill::kStreamFloorDefault;
using strata::prefill::stream_floor_default;
static int failed = 0;
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #x); ++failed; } } while (0)
int main() {
static_assert(kStreamFloorDefault == 1024, "the default floor is the discrete cards' measured 1,024");
static_assert(kFusedOnlyFloor >= 1 && kFusedOnlyFloor < kStreamFloorDefault, "the fused-only floor is below the default");
// the staged fused entry off (STRATA_PF_STAGED_FO=0, or its prerequisites missing): step one's rule
CHECK(stream_floor_default(true, true, false) == kFusedOnlyFloor); // Windows gfx1151, every layer fused-only
CHECK(stream_floor_default(true, false, false) == kStreamFloorDefault); // a layer on MMQ or the FP16 path: unchanged
CHECK(stream_floor_default(false, true, false) == kStreamFloorDefault); // another card class (not measured): unchanged
CHECK(stream_floor_default(false, false, false) == kStreamFloorDefault);
// the entry on: pieces below 1,024 tokens take it, the long path from 1,024 up, on every class
CHECK(stream_floor_default(true, true, true) == kStreamFloorDefault);
CHECK(stream_floor_default(true, false, true) == kStreamFloorDefault);
CHECK(stream_floor_default(false, true, true) == kStreamFloorDefault); // STRATA_PF_STAGED_FO=1 on another class: the floor stays
CHECK(stream_floor_default(false, false, true) == kStreamFloorDefault);
if (failed) {
std::fprintf(stderr, "stream_floor_rule_test: %d check(s) failed\n", failed);
return 1;
}
std::printf("stream_floor_rule_test: OK\n");
return 0;
}