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

[lib/conversion] Create seed only if needed in `convert-torch-convers… #3926

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shelkesagar29
Copy link

…ion-to-mlprogram` pass

This PR changes convert-torch-conversion-to-mlprogram pass implementation by moving seed generation inside ConvertGetNextSeedOp pattern.
Previously, global seed was being created by this pass, even when its only consumer torch_c.get_next_seed op is not present in the IR. This pass is part of Torch->Linalg conversion pipeline. Always creating global seed created an issue for the case when downstream compiler doesn't expect/support ml_program dialect in linalg on tensor IR format. However, when starting torch IR has torch_c.get_next_seed op, ml_program will still be present and will need to be handled by downstream compilers.

…ion-to-mlprogram` pass

This PR changes `convert-torch-conversion-to-mlprogram` pass
implementation by moving seed generation inside `ConvertGetNextSeedOp`
pattern.
Previously, global seed was being created by this pass, even
when its only consumer `torch_c.get_next_seed` op is not
present in the IR. This pass is part of Torch->Linalg
conversion pipeline. Always creating global seed created an
issue for the case when downstream compiler doesn't expect/support
`ml_program` dialect in linalg on tensor IR format.
However, when starting torch IR has `torch_c.get_next_seed`
op, `ml_program` will still be present and will need to be
handled by downstream compilers.
@shelkesagar29
Copy link
Author

@ramiro050 @stellaraccident can you please take a look?

@stellaraccident
Copy link
Collaborator

I'm on vacation and will review substantial changes when I'm back. If you can find another reviewer who knows these parts, that is fine too

@shelkesagar29
Copy link
Author

@vivekkhandelwal1 can you please review this?

Copy link
Collaborator

@vivekkhandelwal1 vivekkhandelwal1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

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.

3 participants