-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: PyTorch PT2 Model Generation #8547
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
base: main
Are you sure you want to change the base?
Conversation
qa/common/gen_qa_models.py
Outdated
| # Use a different model name for the non-batching variant | ||
| model_name = tu.get_model_name( | ||
| "libtorch_nobatch" if max_batch == 0 else "libtorch", | ||
| "libtorch_nobatch" if max_batch == 0 else "libtorch2" if torch2 else "libtorch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor and make the statement clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. also, apologies for the force push, hadn't realized that anyone had reviewed the changes already. won't happen again. thanks.
qa/common/gen_qa_torch_aoti_model.py
Outdated
| with open(f"{config_path}/config.pbtxt", "w") as f: | ||
| f.write( | ||
| """ | ||
| backend: "pytorch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be pytorch2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying to keep them as the same backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. They differs by "platform"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. That's the plan. Ideally we don't have competing "pytorch" and "pytorch_inductor" backends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed the platform to torch_aoti to better reflect what it is and does.
55ebafa to
558c361
Compare
This change adds the generation of PT2 format serialized PyTorch model files to the QA model generation scripts.
558c361 to
78f755f
Compare
| TEST_RESULT_FILE="./test_results.txt" | ||
| CLIENT_PY="./python_based_backends_test.py" | ||
| GEN_PYTORCH_MODEL_PY="../../common/gen_qa_pytorch_model.py" | ||
| GEN_TORCHAOTI_MODEL_PY="../../common/gen_qa_torch_aoti_model.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this variable used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
qa/common/gen_qa_torch_aoti_model.py
Outdated
| @@ -0,0 +1,124 @@ | |||
| # Copyright 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this file being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
5dd1300 to
53b28e7
Compare
53b28e7 to
16c6c0a
Compare
This change adds the generation of PT2 format serialized PyTorch model files to the QA model generation scripts.
TRI-172