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

Commits on Sep 18, 2024

  1. Add a pass to remove redundant check (select) feeding into a collecti…

    …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
    toli-y authored and Google-ML-Automation committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a050924 View commit details
    Browse the repository at this point in the history