[Intel XPU] Enable test/quantization UTs on XPU #3249
[Intel XPU] Enable test/quantization UTs on XPU #3249DiweiSun wants to merge 15 commits intopytorch:mainfrom
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. ❌ 4 New Failures, 1 Cancelled JobAs of commit 8067bd6 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.
does this include cuda?
|
|
||
| torch.manual_seed(0) | ||
|
|
||
| _DEVICE = auto_detect_device() |
There was a problem hiding this comment.
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.
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.
just change this to torch.accelerator.is_available()?
|
|
||
|
|
||
| class TestMultiTensorFlow(TestCase): | ||
| @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") |
There was a problem hiding this comment.
we don't want to expand test to cpu I think
| 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.
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.
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.
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.
changed skip if no cuda to skip if not torch.accelerator.available().
There was a problem hiding this comment.
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.
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()
|
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. |
This PR is targeted to enable the CI for the test/quantization on XPU device.