[Bugfix] Fix IPC publication ordering in custom all-reduce#4294
Open
Fangzhou-Ai wants to merge 1 commit into
Open
[Bugfix] Fix IPC publication ordering in custom all-reduce#4294Fangzhou-Ai wants to merge 1 commit into
Fangzhou-Ai wants to merge 1 commit into
Conversation
Use system-scoped release/acquire synchronization when publishing eager input copies and intermediate writes to peer ranks. Keep final read-completion barriers relaxed because they do not publish output data. Add a TP8 stress test that repeatedly reuses eager fixed buffers and graph-registered input storage under rotating rank skew. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Fangzhou Ai <fangzhouai@gmail.com>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Root cause
The eager path copies input into an IPC-registered fixed buffer immediately before launching the collective. The ready flag was system-scoped but relaxed, and peers polled it with device scope. That did not establish a system-scoped happens-before edge from the producer copy to peer buffer reads. The same gap existed for intermediate writes consumed after a non-final barrier.
Duplicate-work check
I reviewed #4082 and #4084. Those changes protect buffer lifetime after peer reads by adding terminal synchronization or retaining caller tensors. This PR instead publishes data before peer reads. It intentionally excludes their terminal-barrier changes, so the fixes are complementary rather than duplicate. Searches for custom all-reduce IPC publication/order fixes found no other open PR.
Validation
Tested on an 8x gfx950 host at current
maincommitdedc19d32bb31ec134ad0388f878e4cd7a83af16.Passed on all eight ranks, including graph capture/replay. This is a stress regression guard rather than a deterministic reproducer; an unpatched-main 20-iteration control also completed.
The fused all-reduce/RMS integration sweep passed 11,200/11,200 comparisons across M=1,4,8,16,32,64,4096 (100 iterations each), with maximum absolute error 0.125. A graph-free DeepSeek-V4-Pro GSM8K run completed 1,319 samples at 95.906% strict / 95.830% flexible accuracy; its server handled 1,351 successful HTTP responses with no GPU fault.
The stock TP8 graph benchmark was also run on main and this patch:
(2, 7168)(128, 8192)Static checks:
The gfx1250 helper mirrors the same memory-order contract but was not runtime-tested on gfx1250 hardware.
AI assistance
OpenAI Codex was used to audit related PRs, prepare the patch and regression test, run validation, and draft this description. The human submitter is responsible for reviewing every changed line and defending the change end-to-end.