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
GIL=0 P2P policy reconfiguration can cache a stale peer-access verdict #3947
configure_p2p replaces the process-wide policy, then clears _STATUS_CACHE after releasing _CONFIG_LOCK (source). A concurrent enable_peer_access captures the previous threshold, runs a potentially long link validation, and inserts its result into _STATUS_CACHE under a key that contains mode/probe/device indices but not the threshold or a policy generation (lookup, write).
A bounded Python 3.14 free-threaded (PYTHON_GIL=0, sys._is_gil_enabled() == False) test with mocked capability and bandwidth probes paused thread A while it measured 10 GB/s under min_gbps=5. Thread B installed min_gbps=20 and cleared the cache. After A resumed, it cached enabled; B's next enable_peer_access([0,1]) reused that exact object and also returned enabled under the active 20 GB/s policy. A fresh 20 GB/s policy run with the same mocked 10 GB/s probe correctly returns degraded.
The result is a persistent stale classification after concurrent reconfiguration. It can make the current policy's direct-copy gate ineffective for that device pair. This race matters when free-threaded model loads/quantization runs set different P2P policies in one process.
Expected
Bind each status to an immutable policy generation or full policy values, and publish a completed probe only if its generation is still active. Protect configuration, cache lookup/clear, and result publication consistently; add a deterministic interleaving test.
The reproduction executes the actual policy/cache code but mocks two-device capability and bandwidth probing, because the review host has only one NVIDIA GPU. No actual cross-GPU transfer was claimed.
Activity
fix(p2p): bind cached peer verdicts to the policy generation (ModelCl…