Commit 33d39f2
committed
[None][fix] Always sync local ranks after prefetch in HfWeightLoader
`enable_prefetch` depends on `psutil.virtual_memory().available`, a per-rank
volatile value, so different local ranks may take different branches. Gating
`local_mpi_barrier()` on `enable_prefetch` could deadlock between ranks that
prefetched and ranks that skipped. Move the barrier out of the conditional so
all local ranks synchronize unconditionally; ranks that didn't prefetch reach
the barrier immediately.
Signed-off-by: Lanyu Liao <lancelly@users.noreply.github.com>1 parent 3a790bd commit 33d39f2
1 file changed
Lines changed: 6 additions & 2 deletions
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
0 commit comments