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

feat: support tile dynamo converter #2402

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

zewenli98
Copy link
Collaborator

@zewenli98 zewenli98 commented Oct 17, 2023

Description

Support tile dynamo converter. This is a part of slice converter.

Fixes part of #2215

Type of change

Please delete options that are not relevant and/or add your own.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • 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
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@zewenli98 zewenli98 self-assigned this Oct 17, 2023
@github-actions github-actions bot added component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests labels Oct 17, 2023
@github-actions github-actions bot requested a review from peri044 October 17, 2023 21:47
@gs-olive gs-olive requested a review from apbose October 20, 2023 18:39
shapes = []
for i, (s, d) in enumerate(zip(input.shape, dims)):
shapes.append(
impl.elementwise.mul(ctx, target, source_ir, f"{name}_mul_{i}", s, d)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this part, if in the function definition the dims is Sequence[int]?
I am assuming it is for the case where the dims is a sequence of ITensors? Then accordingly maybe the function definition needs to be changed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the else part is not needed. Thanks for comments!

@zewenli98 zewenli98 requested a review from apbose October 26, 2023 22:50
Copy link
Collaborator

@apbose apbose left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a minor clarification I wanted, in this I see that dims are SymInt[] so that should be fine for int based arithmetic operations right?

@zewenli98
Copy link
Collaborator Author

Yes, I think symInt is kind of like int per the doc. @gs-olive Could you help us confirm we can use int when seeing symInt in the schema?

@zewenli98 zewenli98 requested a review from apbose October 27, 2023 20:48
@gs-olive
Copy link
Collaborator

Hi - generally SymInt and int are not interchangeable, since int is a concrete value whereas SymInt does not generally have a fixed or concrete value. In the test cases, are the values you encounter in args[1] ints or SymInts when calling this function?

@zewenli98
Copy link
Collaborator Author

Hi, in the tests we pass in int[] and also get int[] for args[1]

@gs-olive
Copy link
Collaborator

In that case, we should be typing everything with int and not SymInt, since we are not able to support Dynamic shape through SymInt now anyway.

@apbose apbose merged commit 5578763 into pytorch:main Nov 1, 2023
17 of 19 checks passed
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: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants