Skip to content

Conversation

@hugolatendresse
Copy link
Contributor

@hugolatendresse hugolatendresse commented Apr 14, 2025

New op for advanced indexing + unit tests

@hugolatendresse hugolatendresse marked this pull request as ready for review April 17, 2025 01:34
@hugolatendresse
Copy link
Contributor Author

@tvm-bot rerun

1 similar comment
@hugolatendresse
Copy link
Contributor Author

@tvm-bot rerun

@hugolatendresse
Copy link
Contributor Author

@MasterJH5574 @tlopex this is ready for review.

@tqchen note that this allows OpenAI's Whisper to be ingested by TVM using the exported program translator (after a few minor edits, including remove in-place operations). Correctness is achieved, as tested here https://github.com/hugolatendresse/catalyst-fleet/blob/a4a4be6/whisper/whisper_inlined.py

The tvm-bot refuses to rerun the tests due to Ubuntu 20.04 LTS being retired - maybe this needs to be merged first

@hugolatendresse hugolatendresse changed the title [Relax][Python] support for index.Tensor [Relax][PyTorch] support for index.Tensor Apr 18, 2025
Copy link
Contributor

@MasterJH5574 MasterJH5574 left a comment

Choose a reason for hiding this comment

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

Looks very great, nice done! I only left one comment for potentially better clarity.

Comment on lines 170 to 176
while isinstance(t, Var):
binding = bb.lookup_binding(t)
if not isinstance(binding, (Tuple, Var)):
break
t = binding

assert isinstance(t, (Tuple, Var))
Copy link
Contributor

Choose a reason for hiding this comment

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

It might help understanding if we can briefly explain why backtracing t is needed. My understanding is that without backtracing it's still correct, but may result in trivial TupleGetItems that can be easily removed. Correct me if I'm wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MasterJH5574 you are right that it is not needed. It would simply remove unneeded TupleGetItems like you said. I removed the backtracking and all tests still pass. Let me know if you prefer it like that or if I should revert (I'm indifferent).

Copy link
Contributor

@MasterJH5574 MasterJH5574 left a comment

Choose a reason for hiding this comment

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

Looks great, thank you @hugolatendresse for landing this!

@MasterJH5574 MasterJH5574 merged commit b5b0337 into apache:main Apr 21, 2025
10 checks passed
@hugolatendresse hugolatendresse deleted the indextensor_1_and_3 branch May 4, 2025 19:46
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
New op for advanced indexing + unit tests
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.

2 participants