feat: PyTorch PT2 Model Generation#8547
Conversation
| # 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.
Please refactor and make the statement clear
There was a problem hiding this comment.
done. also, apologies for the force push, hadn't realized that anyone had reviewed the changes already. won't happen again. thanks.
| with open(f"{config_path}/config.pbtxt", "w") as f: | ||
| f.write( | ||
| """ | ||
| backend: "pytorch" |
There was a problem hiding this comment.
trying to keep them as the same backend.
There was a problem hiding this comment.
I see. They differs by "platform"?
There was a problem hiding this comment.
Correct. That's the plan. Ideally we don't have competing "pytorch" and "pytorch_inductor" backends.
There was a problem hiding this comment.
renamed the platform to torch_aoti to better reflect what it is and does.
55ebafa to
558c361
Compare
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.
Where is this variable used?
| @@ -0,0 +1,124 @@ | |||
| # Copyright 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |||
There was a problem hiding this comment.
Where is this file being used?
5dd1300 to
53b28e7
Compare
dd98938 to
a8a2415
Compare
2610725 to
f00cef1
Compare
b94a33c to
f302116
Compare
f302116 to
82df242
Compare
This change adds the generation of PT2 format serialized PyTorch model files to the QA model generation scripts. add backend: pytorch to model config generation fix pedantic style complaints and very valid copyright mistakes pedantic style cop fix fix variable name error after rebase rename model add nvcc to pytorch path remove unnecessary changes add torch.export.export generation support to libtorch remove set -x from generated scripts improving gen_qa_models.py print statements fix color add print based on flags improve color visibility remove IDE help (caused errors) pedantic style cop fixes specify cuda fix libtorch pt2 generation add torchvision generation
82df242 to
dafcf53
Compare
|
Please mark this PR Draft if not ready. |
171eeed to
62909e0
Compare
62909e0 to
64f7855
Compare
This change adds the generation of PT2 format serialized PyTorch model files to the QA model generation scripts.
Includes significant changes to the gen_qa_model_repository flow to improve debugability.
TRI-172