prefill: warm the first BF16 and FP16 hipBLAS products on a thread at start (STRATA_PREFILL_WARM=0 skips), STRATA_COLD_TRACE diagnostic

This commit is contained in:
Niko1221 committed 2026-10-18 04:24:19 +02:00
1 parent 79ac3164a0
commit f3be974359
3 files changed
+89

No files matched your search

+6
View File
@@ -2115,6 +2115,10 @@ strata::kernels::cpu::PoolAffinity measure_pool_affinity(strata::core::ExpertSou
return take_p ? cpu::PoolAffinity::PCores : cpu::PoolAffinity::All;
}
// HIP: the thread that warms hipBLAS's libraries while the expert arena loads (see warm_gemm_libraries); joined at exit.
std::thread g_warm_thr;
struct WarmJoin { ~WarmJoin() { if (g_warm_thr.joinable()) g_warm_thr.join(); } } g_warm_join;
// 0.1.42, CUDA single-GPU serve, no --pcie-frac: the share refined from what the CPU pool measures in the first decode
// windows. The balance share of the missed experts is link / (link + CPU rate). The link is the start-up probe; the CPU
// rate is the expert bytes over the pool's wall time per missed expert (ExpertDispatch::ms_run / multi_misses), which the
@@ -5354,6 +5358,8 @@ int main(int argc, char** argv) {
const char* name = named && p.name[0] ? p.name : "(an unnamed GPU)";
#if defined(STRATA_USE_HIP)
std::fprintf(stderr, "strata generate: GPU %d: %s (%s)\n", dev, name, named ? p.gcnArchName : "?");
// the first prompt's one-time hipBLAS library loads (about 2.5 s), done on a thread while the expert arena loads
if (named) g_warm_thr = std::thread([dev] { strata::prefill::warm_gemm_libraries(dev); });
// A hint only, never an action: on RDNA4 with an int8 KV the opt-in matrix-core prompt attention reads prompts
// about 30% faster (R9700, PR #1318), but its output differs from the default kernel's in the last bits, so it
// stays the user's choice. Silent when the variable is set to anything (STRATA_HIP_WMMA=0 included).