-
Notifications
You must be signed in to change notification settings - Fork 363
Update common used toy linear model #3275
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
Co-authored-by: Jerry Zhang <[email protected]>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3275
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 92ba186 with merge base 315e9b4 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
thanks for splitting the PR, this should be much easier to land |
| if model_type == "linear": | ||
| model = ToyLinearModel(k, n, high_precision_dtype).to(device) | ||
| model = ToySingleLinearModel(k, n, device=device, dtype=high_precision_dtype) | ||
| input_data = torch.randn(m, k, device=device, dtype=high_precision_dtype) |
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.
can this be changed to use example_inputs from model now
e.g. input_data = model.example_inputs(batch_size=m)[0]
|
@namgyu-youn please add label for the PR as well, as shown in https://github.com/pytorch/ao/actions/runs/19093634780/job/54642925650?pr=3275 |
|
this one should be |
|
@pytorchbot label "topic: not user facing" |
Thanks for the info, I will keep in mind for future PRs. |
|
@pytorchbot label "topic: for developers" |
Summary:
This PR is smaller chunks of #2729. Instead of implementing a linear model in each test code, we want to support its API for developers' utility and consistency. The updated toy model requires device and dtype to help clearly identify.
Test Plan:
test/sparsity/test_fast_sparse_training.py
Future Plan:
This PR only updates the toy model in test/sparsity/test_fast_sparse_training.py. For a full update, we also have to update the following tests, same as
test_fast_sparse_training.py:cc @jerryzh168