-
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.
| 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
| python3 $TRITON_MDLS_SRC_DIR/gen_qa_models.py --torch-aoti --variable --models_dir=$TRITON_MDLS_QA_VARIABLE_MODEL | ||
| chmod -R 777 $TRITON_MDLS_QA_VARIABLE_MODEL | ||
| python3 $TRITON_MDLS_SRC_DIR/gen_qa_identity_models.py --libtorch --models_dir=$TRITON_MDLS_QA_IDENTITY_MODEL | ||
| python3 $TRITON_MDLS_SRC_DIR/gen_qa_identity_models.py --libtorch --models_dir=$VOLUME_IDENTITYDESTDIR |
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.
Given variable is not declared, may I suggest suggest to preserve the existing one, otherwise following issue will happen.
+ chmod -R 777 /mnt/20251208_1446/25.11/qa_variable_model_repository
+ python3 /mnt/20251208_1446/gen_srcdir/gen_qa_identity_models.py --libtorch --models_dir=
+ chmod -R 777 /mnt/20251208_1446/25.11/qa_identity_model_repository
+ python3 /mnt/20251208_1446/gen_srcdir/gen_qa_reshape_models.py --libtorch --variable --models_dir=/mnt/20251208_1446/25.11/qa_reshape_model_repository
This change adds the generation of PT2 format serialized PyTorch model files to the QA model generation scripts.
TRI-172