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
platforms: native dispatcher reuses buffers that workers may still read after an exception #170
After moe_disp_start posts jobs, any exception before moe_disp_wait (e.g. a GPU OOM in a device tier) leaves workers running with d->n set. The next call's reserve() frees j->x/out/idx while a worker may still read them (use-after-free); a half-finished pipe exchange also desyncs the RNGD server.
Evidence and reproduction
opt_prime/opt_prime/accel/moe/layer.py:154-185, accel/platforms/cpu/csrc/dispatch.c:272-290,294. Verified by reading: no try/finally around start/wait.
Environment
optimus-rm @253be20; Python 3.10, torch 2.10.0+cu128, transformers 5.1.0; RNGD+A100 host (CPU / one A100 for the checks).
Scope
dispatch.c, layer.py.
Done when
Start drains jobs left from a failed call and Python always waits in finally; a test raises between start and wait and the next call is correct.
Activity
accel.moe: wait for native dispatch jobs when a call raises (#170) (#179
gspark-etri commentedon Oct 23, 2026
Fixed by #179, squash-merged into optimus-rm.