-
Notifications
You must be signed in to change notification settings - Fork 363
[Intel XPU] Enable test/quantization UTs on XPU #3249
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3249
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit a9043e2 with merge base ba3ac9f ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
To add the ciflow label This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
To add the ciflow label This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows. |
| return devices | ||
|
|
||
|
|
||
| def auto_detect_device(): |
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.
does this include cuda?
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.
Yes.
|
|
||
| torch.manual_seed(0) | ||
|
|
||
| _DEVICE = auto_detect_device() |
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.
auto_detect_device seems to be changing what we want to test, I think previous we only want to test on CUDA, can you preserve this?
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.
We have refine the auto_detect_device functions and cpu will not be included.
|
|
||
| class TestGPTQ(TestCase): | ||
| @unittest.skip("skipping until we get checkpoints for gpt-fast") | ||
| @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") |
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.
just change this to torch.accelerator.is_available()?
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
|
|
||
|
|
||
| class TestMultiTensorFlow(TestCase): | ||
| @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") |
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.
we don't want to expand test to cpu I think
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.
cfe14e2 to
7b5d2c4
Compare
|
To add the ciflow label This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows. |
| m2.load_state_dict(state_dict) | ||
| m2 = m2.to(device="cuda") | ||
| example_inputs = map(lambda x: x.cuda(), example_inputs) | ||
| example_inputs = map(lambda x: x.to(_DEVICE), example_inputs) |
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.
so when in CPU, _DEVICE will be None now, what happens when we do x.to(None)? I think we don't want auto detect here, since in L267, it is converting model m2 to "cuda"?
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.
changed m2.to(_DEVICE), as it is skip if not torch.accelerator.available(), when in CPU, this case will be skipped
| def test_get_group_qparams_symmetric_memory(self): | ||
| """Check the memory usage of the op""" | ||
| weight = torch.randn(1024, 1024).to(device="cuda") | ||
| weight = torch.randn(1024, 1024).to(device=_DEVICE) |
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.
this test also has skip if no cuda, so it is still only going to run in cuda right? the change doesn't seem to have any effect right now
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.
changed skip if no cuda to skip if not torch.accelerator.available().
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 think it might make sense if we change all the skip if no cuda to skip if not torch.accelerator.available() in this file
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.
test_module_fqn_to_config_regex_basic, test_module_fqn_to_config_regex_fullmatch, test_module_fqn_to_config_regex_precedence and test_module_fqn_to_config_regex_precedence2 are not ready for XPU, others are changed to skip if not torch.accelerator.available()
This PR is targeted to enable the CI for the test/quantization on XPU device.