feat: support tile dynamo converter by zewenli98 · Pull Request #2402 · pytorch/TensorRT

@zewenli98

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

apbose

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)

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?

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!

apbose

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

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?

@gs-olive

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

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

@gs-olive

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.

@zewenli98

@zewenli98

apbose