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

fix: allow torch.Symint in slice_scatter_decomposition #3132

Conversation

jiwoong-choi
Copy link
Contributor

fix: allow torch.Symint objects for start, end and step in slice_scatter_decomposition

Description

When an exported program is torch.exported with dynamic shapes, the start, end and step could be torch.SymInt instead of int. As a result, the assertions on start, end and step in slice_scatter_decomposition aborts the lowering pass.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [v] My code follows the style guidelines of this project (You can use the linters)
  • [v] I have performed a self-review of my own code
  • [v] I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • [v] I have added the relevant labels to my PR in so that relevant reviewers are notified

@github-actions github-actions bot added component: lowering Issues re: The lowering / preprocessing passes component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Aug 30, 2024
@github-actions github-actions bot requested a review from gs-olive August 30, 2024 04:57
Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

I don't think our code can handle (start, end, step) to be SymInt. Can you provide a test case where you see such behavior ?

@jiwoong-choi
Copy link
Contributor Author

I'll reopen this PR (or might open a new one with more changes) after I come with a proper test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: lowering Issues re: The lowering / preprocessing passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants