-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Fix image selection for AOT on intel_cpu_{spr, gnr} #15208
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
Conversation
((ArchName == "x86_64" || ArchName == "intel_cpu_spr" || | ||
ArchName == "intel_cpu_gnr") && | ||
CompileTarget == "spir64_x86_64")) { |
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 is not safe, we easily can forget to update this if
with more CPU architectures.
This API should be used here:
bool ext_oneapi_architecture_is( (2)
ext::oneapi::experimental::arch_category category);
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.
Ahh, we don't have intel_cpu
category yet.
@gmlueck, is it ok to update the device_architecture
spec and impl by extending arch_category
with intel_cpu
?
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.
Do we want a generic test for "Intel CPU" here? For example, if the device image is compiled for "intel_cpu_spr", we can only use it if the CPU really is Sapphire Rapids. Therefore, it seems like we might want a series of "if" statements here. Is there some other place in the code where we check more precisely whether the ArchName matches the CPU model? Should that logic be pushed down into the unified runtime?
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 is not safe, we easily can forget to update this if with more CPU architectures.
I would say this special handling in this if statement is mainly temporary, as we currently have no dedicated targets for cpu targets in the compiler, i.e. there is no -fsycl-targets=intel_cpu_spr
and -fsycl-targets=intel_cpu_gnr
(nor -fsycl-targets=x86_64
).
For example, if the device image is compiled for "intel_cpu_spr", we can only use it if the CPU really is Sapphire Rapids
Once again, this is what we want, however, as far as I am aware, there is no way to compile for specifically for intel_cpu_spr
; the generic spir64_x86_64
target is used, and there is no -fsycl-targets=intel_cpu_spr
.
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.
@jzc can you please update the comment to highlight that this is a temporary change until XXX is implemented?
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.
@dm-vodopyanov Added a TODO comment 7e5fa32
Dismissing my "Changes requested" label, but there is a question above.
When AOT compiling for cpu, the generic
spir64_x86_64
target is used with-fsycl-targets
. In #14909, functionality was added to select device images based on theircompile_target
property in the image. The selection mechanism had to consider CPU as a special case due to not having explicit targets. However, the mechanism only consideredx86_64
and notintel_cpu_spr
orintel_cpu_gnr
; therefore on aintel_cpu_spr
orintel_cpu_gnr
device, trying to launch a program compiled with-fsycl-targets=spir64_x86_64
, device image selection would fail to find an image (and thus fail to launch any kernels).This PR updates the logic to include
intel_cpu_spr
andintel_cpu_gnr
. Note: for tests, this functionality is checked by any test that AOT compiled for CPU and launches a kernel (includes AOT/cpu.cpp, AOT/double.cpp, AOT/half.cpp).