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

[RFC] Extend Turbine tensor.py to handle torch_dispatches, nn.Module, and torch computational functions #114

Merged
merged 4 commits into from
Oct 28, 2023

Conversation

raikonenfnu
Copy link
Member

No description provided.

@raikonenfnu
Copy link
Member Author

@stellaraccident Any thoughts on defaulting to using async-exec mode? So that we won't need to have these guards

https://github.com/nod-ai/SHARK-Turbine/pull/114/files#diff-26bd2a602db8753e912ba73e3cebffe2fd5924c04a2dd090e460e4119f2b8e56R171

@stellaraccident
Copy link
Contributor

@stellaraccident Any thoughts on defaulting to using async-exec mode? So that we won't need to have these guards

https://github.com/nod-ai/SHARK-Turbine/pull/114/files#diff-26bd2a602db8753e912ba73e3cebffe2fd5924c04a2dd090e460e4119f2b8e56R171

No time like the present. The worst it can do is reveal bugs and this is the time to hunt them down.

@raikonenfnu
Copy link
Member Author

raikonenfnu commented Oct 27, 2023

I am thinking of unifiying the SpecializedExecutable and the newly created EagerSpecializedExecutable before trying to land this. I think the main problem lies in if we want to introduce execution-model=async-* dynamo/cpu.py backend.

The main issue with this is IIRC a dynamo backend of torch.compile needs to output torch.Tensor. Which means we'd need to sync up all the HalFences in the executable's _returns_to_user method before we convert it to torch.Tensor. This AFAICT would result in it not really being asynchronous per se. 😅

Copy link
Contributor

@stellaraccident stellaraccident left a comment

Choose a reason for hiding this comment

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

Very neat and a good start! Some general code comments and then this looks good for a first step.

python/shark_turbine/dynamo/executor.py Outdated Show resolved Hide resolved
python/shark_turbine/dynamo/tensor.py Outdated Show resolved Hide resolved
python/shark_turbine/dynamo/tensor.py Outdated Show resolved Hide resolved
python/shark_turbine/dynamo/tensor.py Outdated Show resolved Hide resolved
python/shark_turbine/dynamo/tensor.py Show resolved Hide resolved
python/shark_turbine/dynamo/tensor.py Outdated Show resolved Hide resolved
@raikonenfnu raikonenfnu force-pushed the eagerMode branch 3 times, most recently from 963365c to fe48aee Compare October 27, 2023 20:59
@raikonenfnu raikonenfnu merged commit 5ab12bf into nod-ai:main Oct 28, 2023
1 check passed
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