[XPU] fix device version in unittests #64414
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Custom Device
PR Types
Bug fixes
Description
在XPU的现有单测中,有一些地方固定了XPU1和XPU2的“二选一”,因此会造成一些诡异的现象。例如,在
get_type_white_list
函数中,有这样的语句:它会把所有的非XPU2设备,都认成是XPU1。
同时,
xpu_test_device_type_white_list = ['xpu1_float64']
这一句,目的是“在XPU1上面不要跑float64类型的单测”。那么在“非XPU2且非XPU1”的设备上会生效,就会把float64给过滤掉。导致的结果是,即使某个算子注册了float64类型,也不会被单测执行,出现漏测。本PR修复了此问题。