Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a pass to remove redundant check (select) feeding into a collective permute with cycle. #17181

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

copybara-service[bot]
Copy link

Add a pass to remove redundant check (select) feeding into a collective permute with cycle.
When collective-permute operates on a comparison to a device id and the senders match the condition's branch we can link collective-permute to the original data skipping the comparison.
For example
condition = broadcast(compare(replica_id, X), direction=EQ
data_snd = select(condition, compare_true_data, compare_false_data)
rcv = collective-permute(data_snd compare_true_data), pairs={{X,0}}
can be transformed to
rcv = collective-permute(compare_true_data), pairs={{X,0}}

The pass is only handling compare direction={EQ,NE}.
The pass handles Compare with and without preceding Broadcast.

…ve permute with cycle.

When collective-permute operates on a comparison to a device id and the senders match the condition's branch we can link collective-permute to the original data skipping the comparison.
For example
   condition = broadcast(compare(replica_id, X), direction=EQ
   data_snd = select(condition, compare_true_data, compare_false_data)
   rcv = collective-permute(data_snd compare_true_data), pairs={{X,0}}
 can be transformed to
   rcv = collective-permute(compare_true_data), pairs={{X,0}}

 The pass is *only* handling compare direction={EQ,NE}.
 The pass handles Compare with and without preceding Broadcast.

PiperOrigin-RevId: 676181937
@copybara-service copybara-service bot merged commit a050924 into main Sep 18, 2024
@copybara-service copybara-service bot deleted the test_674474635 branch September 18, 2024 23:51
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