Skip to content

Fix/epv2 fp4 push reads input - #720

Merged
zhangfei829 merged 4 commits into
mainfrom
fix/epv2-fp4-push-reads-input
Oct 1, 2026
Merged

zhangfei829 merged 4 commits into
mainfrom
fix/epv2-fp4-push-reads-input

Conversation

@zhangfei829

Copy link
Copy Markdown
Collaborator

fix(ep/v2): fp4 push combine reads the input in place; restore the pre-#719 gather barrier

…wn sync

#719 made the gather and fp4 combines share one cross-device barrier in
which every block polls the peers' signals. On hosts whose local VRAM is
mapped MTYPE_NC (f01) that made the gather combine 10-17 us slower than
before #719, and the fp4 combine no faster than the gather at ct=512.

The gather combine goes back to #719's parent's barrier, word for word.
The fp4 combine goes back to the report/release sync it had before the
shared barrier: every block reports to every peer, and each rank's last
block collects the reports and releases the rest. Its waits are now
unbounded like the gather's, instead of giving up after 65536 polls.
hip_backend reserves the report/release slots behind the landing rows and
rejects fp4 combine variants that differ in block count.

EP4, hidden 7168, topk 6, fp4 dispatch, combine us at ct=512:
  f01-2 (NC): gather 52.40 -> 35.35 (8bffec7 35.23), fp4 35.00 -> 21.91
  c3-1  (RW): gather 32.12 -> 33.47 (8bffec7 33.37), fp4 19.13 -> 19.46
#719 made the op copy the fp4 combine input into out_tok first (up to 65536 x 7168 bf16 a layer), because the first row load of each warp in the send stage is speculative and could read past a caller buffer shorter than the receive capacity. PUSH never exposes that buffer to peers, so the copy is not needed: a warp whose first row is at or past totalRecvTokenNum now returns before loading, and the input goes straight to the kernel. Gather and dispatch machine code is unchanged.
…rrier

#719 made the gather and fp4 combines share one cross-device barrier in which every block polls the peers' signals. On hosts whose local VRAM is mapped MTYPE_NC (f01) that made the gather combine 10-17 us slower than before #719. The gather combine gets #719's parent's barrier back word for word; the fp4 combine keeps #719's barrier, so its machine code is unchanged.
@zhangfei829
zhangfei829 merged commit 3145152 into main Oct 1, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant