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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AOTI][UX] One has no way of knowing whether they need to load DSO as CPU or CUDA runner #126547

Open
malfet opened this issue May 17, 2024 · 1 comment
Labels
module: aotinductor aot inductor oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@malfet
Copy link
Contributor

malfet commented May 17, 2024

馃悰 Describe the bug

Right now Inductor API offers no way queuing whether given DSO target CUDA or CPU

And attempts to load CUDA binaries in CPU corrupts CUDA context, so trick like

try {
  runner = new torch::inductor::AOTIModelContainerRunnerCpu(model_path);
} catch (std::runtime_error& e) {
  runner = new torch::inductor::AOTIModelContainerRunnerCuda(model_path);
}

does not work (though if invoked in opposite order it does, but it might change in the future)

Two proposals:

  • As right now AOTI is limited to one architecture it should simple check whether device it's being instantiated on matches the one it's been exported from
  • In a longer term, one should have an API to query whether model was created for CUDA or CPU (or may be even for both)

Versions

2.3.0, nightly

cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @desertfire @chenyang78

@malfet
Copy link
Contributor Author

malfet commented May 17, 2024

A very naive and simple approach of achieving something of the nature is #126536

@xmfan xmfan added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: aotinductor aot inductor oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants