Skip to content

[FEA][torchinductor-EVT] tensor construction API that takes in shape + stride directly #2245

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

Open
mlazos opened this issue Apr 17, 2025 · 2 comments
Labels

Comments

@mlazos
Copy link
Contributor

mlazos commented Apr 17, 2025

Is your feature request related to a problem? Please describe.
This is a small API change in that is a little annoying to have to check whether strides are row or column major before passing to the tensor constructor at

def __init__(self, tensor=None, element=None, shape=None, layout_tag=None, is_constant=False) -> None:
.
TorchInductor tracks this internally, so it is easier for us to check whether the shape + stride are contiguous and then passing it along.

Describe the solution you'd like
Ideally just take a shape and stride arg rather than having to convert to a shape, layout tag pair and then have the constructor interpret these.

Describe alternatives you've considered
I added a shim layer in inductor that does this, so it's nbd, but just a nice-to-have, perhaps having two versions of the API wouldn't hurt here.

cc @eellison, @henrylhtsang

@mlazos mlazos added ? - Needs Triage feature request New feature or request labels Apr 17, 2025
@hwu36
Copy link
Collaborator

hwu36 commented Apr 30, 2025

@jackkosaian

@jackkosaian
Copy link
Contributor

@apuaaChen, can you take a look at this EVT-related request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants