You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EXL3 native dispatch caches race on concurrent GIL=0 first use #3951
EXL3's native kernel selection has process-wide mutable C++ containers with no synchronization:
tuning_cache, a std::map<uint64_t, TResult>, is searched and inserted into during select_exl3_gemm_kernel_tuned (lookup and write). Two first-use GEMMs on different Python threads can race even when their shapes differ. The forced-shape branch also mutates and returns one shared forced_result object.
GIL=0 callers can enter these native operators concurrently. Concurrent read/write of either standard container is a C++ data race and can corrupt its internal state, crash, or select the wrong dispatch result. The per-device guard protects CUDA context selection; it does not serialize these process-wide host containers.
Expected
Synchronize lookup and insertion, including forced-result publication, or use immutable/per-call dispatch results and one-time initialization with a defined publication order. Add a concurrent cold-start native test under PYTHON_GIL=0.
This is source-supported; the review host lacks nvcc and could not run the EXL3 extension.
Activity
fix(exllamav3): synchronize the EXL3 native dispatch caches (#3951) (#…