Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tests/jax/distributed_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ def count_collectives(splitted_hlo):
is_sync_collective = "collective_backend_config" in line and sync_symb in line

if is_async_start or is_sync_collective:
if is_sync_collective:
is_all_reduce = re.search(r"\ball-reduce\s*\(", line)
is_all_gather = re.search(r"\ball-gather\s*\(", line)
else:
# Some direct *-start instructions are tagged with
# `"is_sync":true`. Classify the explicit async form first so
# it is not mistaken for an unsuffixed synchronous collective.
if is_async_start:
called_collective = get_called_collective_type(line)
is_all_reduce = COLL_AR_KEY in txt[0] or called_collective == COLL_AR_KEY
is_all_gather = COLL_AG_KEY in txt[0] or called_collective == COLL_AG_KEY
else:
is_all_reduce = re.search(r"\ball-reduce\s*\(", line)
is_all_gather = re.search(r"\ball-gather\s*\(", line)

if is_all_reduce:
result[COLL_AR_KEY] += count_bytes(txt)
Expand Down
Loading