mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
With kernel.numa_balancing=1 the NUMA scanner marks the PTEs of the expert arena (registered with hipHostRegister, a KFD userptr range) PROT_NONE to sample which node touches it; each change invalidates the range and KFD evicts all of the process's GPU queues until it is validated again. On a two-socket host that was 77-236 s of eviction per engine start and the "no progress for 60 s" stops (7 of 20 fresh 1K prompts), with free RAM and no swap. The engine now sets MPOL_LOCAL (the same first-touch placement, but the scanner skips the memory) at the top of main(), before any thread is made, when numa_balancing is on and no policy was set by the user (numactl keeps its own). STRATA_NUMA_BALANCING=keep leaves the default policy. HIP builds on Linux only; the reporter's PR also changed the CUDA engine, which this commit does not. Ported from PR #4867 by vivienfanghuagood (header, test, main() call; the hunks moved under engine/ and gated on HIP). The author line of the original commit is not kept here: the commit is made as the repository owner, the PR author's work is named in this message. Test: numa_balancing_test (the decision, header-only).