--aux-cpus: put the engine's threads that are neither pool workers nor the host on spare CPUs (Linux, off by default)
Header-only placement (include/strata/platform/aux_cpus.hpp): the spare CPU set (the host core's SMT siblings, then CPUs of physical cores with no worker; never a CPU that shares a core with a worker), the list parser, threads the engine creates pin themselves, threads somebody else created (the CUDA driver's) are moved by a sweep over /proc/self/task after the pool exists and at every request; pool workers and the host thread are never moved. --aux-cpus off|auto|LIST / STRATA_AUX_CPUS; per request strata_tune aux_cpus=0|1 (serve/server.py). Default off: the hooks do nothing. tests/platform/aux_cpus_test covers the derivation and live threads (CPU only).
This commit is contained in:
1 parent
f47349002c
commit
91f1e85dd1
13 files changed
+714
-10
No files matched your search
@@ -8,6 +8,7 @@
|
||||
#include "strata/kernels/quantize_act.hpp"
|
||||
#include "strata/kernels/s2_expert_grouped.hpp"
|
||||
#include "strata/kernels/cpu/pool.hpp"
|
||||
#include "strata/platform/aux_cpus.hpp"
|
||||
#include "strata/kernels/ngram.hpp"
|
||||
|
||||
#include <cuda_runtime.h>
|
||||
@@ -556,6 +557,7 @@ bool SessionLoopScratch::init(size_t parts_bytes_in, std::string& err) {
|
||||
pinned = pinned_core.valid;
|
||||
}
|
||||
}
|
||||
strata::aux_cpus::note_owned_thread(); // the host: --aux-cpus leaves it where it is
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user