How can I confirm that my program is actually running AOT kernels #15087
-
I'm working with Intel GPUs and find it's difficult to debug AOT/JIT problems. As kernels will run with JIT if there is no AOT exist for current runtime hardware, a program which intent to be AOT will run successfully anyway even if AOT settings are misconfigured (e.g. set target to PVC while intent to work on a DG2 platform). It is very hard to expose the problem as the performance difference is not all ways that obvious. The problem will be even more hard to located if in a project with multiple groups of kernels each with their own AOT settings. Therefore, I'm wondering if it's possible to confirm that a program is running AOT kernels. For example, it will be helpful if there is an option to disable the JIT capability so that the program can just failed given no AOT kernels available in a runtime environment. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Consider me as beginner with this topic, but if I understood correctly, the difference between AOT/JIT is that kernels are compiled directly to target architecture with AOT and to SPIR-V with JIT. If this is the case, maybe checking the target triple of dumped kernels would give you this information:
I think if the target of dumped kernel is spir64, it implies JIT (But not sure if this is the case). If target is something else you can't even translate it with llvm-spirv. |
Beta Was this translation helpful? Give feedback.
Using
SYCL_DUMP_IMAGES
is not a guarantee here. The thing is that even if you don't see a SPIR-V module dumped this way but some device-specific binary, there can still be a fallback to JIT compilation for Intel GPUs.The thing is that Intel GPU offline compiler (
ocloc
) silently embeds SPIR-V into binaries it produces so that when that binary is attempted to be used on a device it was not compiled for, a JIT compilation can be performed.That can be mitigated by passing
-exclude_ir
flag to device compiler (through-Xsycl-target-backend
flag if I'm not mistaken with its spelling). Note that SYCL RT itself does not have a capability to perform AOT -> JIT fallback and by applying this change…