[Intel XPU] Add common code for UTs on XPU#3335
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3335
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit da10ddb with merge base ff0e461 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| pytest -v -s torchao/test/quantization/quantize_/workflows/int4/test_int4_plain_int32_tensor.py | ||
| pytest -v -s torchao/test/quantization/quantize_/workflows/int4/test_int4_plain_int32_tensor.py | ||
|
|
||
| pytest -v -s torchao/test/quantization/ |
There was a problem hiding this comment.
does these tests run on xpu?
There was a problem hiding this comment.
These UTs will be run on XPU finally. The current TorchAO CI should only cover the CUDA device and skip on XPU. We plan to firstly add these test folders into the XPU ci which is triggered by ciflow/xpu and then enabled the XPU UTs file by file to reduce the review effort.
|
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 decorator | ||
|
|
||
|
|
||
| def skip_if_no_xpu(message=None): |
There was a problem hiding this comment.
currently these things are a bit confusing I think, since I remember some of these work with unittests and others work with pytest. can you confirm what these are working with? I think ideally we should create two versions, one for unittests one for pytest
There was a problem hiding this comment.
Created two versions for both unittest and pytest
d828aec to
b4933ae
Compare
318c66b to
f4eed65
Compare
| return devices | ||
|
|
||
|
|
||
| def auto_detect_device(): |
There was a problem hiding this comment.
nit: it would be better to change this to something like get_current_accelerator_device to be clearer I think
There was a problem hiding this comment.
Make sense. This name is more reasonable. Refined.
jerryzh168
left a comment
There was a problem hiding this comment.
lg, see one comment inline
* add common code for xpu * fix format issue * remove case * refine the xpu skip func * change auto_device_check to get_current_accelerator_device --------- Co-authored-by: Zhang, Liangang <liangang.zhang@intel.com>
This PR is targeted to add common code for UTs on XPU