-
Notifications
You must be signed in to change notification settings - Fork 315
refactor common used toy model #2729
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
Integrates common used toy model and refactor across TorchAO (ao/test/benchmark/tutorial) - fix: pytorch#2078 Test Plan: CI
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2729
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@namgyu-youn thanks for taking up this effort |
self.linear1 = torch.nn.Linear(k, n, bias=False).to(dtype) | ||
self.linear1 = torch.nn.Linear(m, n, bias=False) | ||
self.linear2 = torch.nn.Linear(n, k, bias=False) | ||
self.linear3 = torch.nn.Linear(k, 1, bias=False) |
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 create a separate model for two linear layers. This model for single linear layer is used in benchmarking run on CI.
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.
@jainapurva I prefer to define ToySingleLinearModel
and ToyMultiLinearModel
for a future update as you mentioned, but how about reverting benchmark_aq.py
?
Unit tests (e.g., test_quant_api.py
, test_awq.py
) are using single/multiple layers in a mixed manner, and using only multiple layers might be an update. If this makes sense, benchmark_aq.py
would be the only case using single layers. Let me know which one aligns better.
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.
ToySingleLinearModel
and ToyMultiLinearModel
sounds good. Please ensure all the tests are running smoothly for it.
For benchmark_aq.py
you can add the bias parameter as the last arg in init and set it to False by default. In addition to this, ToySingleLinearModel
is used in running .github/workflows/run_microbenchmarks.yml
. It uses the create_model_and_input_data, please ensure that method is running smoothly, and is updated as per the new toy models.
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.
Sorry for opening the PR without checking it. And I will move into your suggestion; thanks for your leading.
@namgyu-youn Please feel free to divide this into multiple PRs if it's too many changes. |
Integrate commonly used single/multi-linear toy models and refactor them across the codebase (src/test/benchmark/tutorial). - fix: pytorch#2078 Test Plan: CI
Summary:
Integrate commonly used single/multi-linear toy models and refactor them across the codebase (src/test/benchmark/tutorial).
Test Plan: CI