-
Notifications
You must be signed in to change notification settings - Fork 29
Switch to SPIRV APIs from internal built-in APIs #255
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
base: sycl-develop
Are you sure you want to change the base?
Switch to SPIRV APIs from internal built-in APIs #255
Conversation
Are these the same functions as the ones defined in https://github.khronos.org/SPIRV-Registry/extensions/INTEL/SPV_INTEL_2d_block_io.html ? |
Yes |
Maybe I'm missing something but the functions in the link use template parameters to define the 2D copy block dimensions, allowing the selection of the internal copy builtin at compile time. The functions in the PR, however, use runtime variables for this, meaning the selection happens at runtime. This could explain the drop in performance. |
In the spec, it is just an example to show the semantics, but it is not an API definition. Spec defines only SPIRV API. And I find prefetch functionality is the root cause, which seems not working well. |
@jiyang1011 Could you try adding something like 36aa2d4 to use SPIRV or the builtins depending on the compiler version? We might need to disable SPIRV before merging until we can update CI with an IGC version that includes the SPIRV definitions. |
OK |
729e553
to
aa532b3
Compare
Hey @jiyang1011 👋 I'm struggling to compile e.g. |
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.
Thanks for this PR! I have a few suggestions for improvements 👍
I made some changes in https://github.com/aacostadiaz/cutlass-fork/tree/aacosta/spirv_api to make the code compile and run with IGC 28698. There is an issue with the SPIRV functions for MMA, so I had to disable them. I also enabled prefetch to always use the builtins, which restored the performance of the GEMM example. I haven't checked all configurations in the benchmark. @jiyang1011 Could you take a look and consider adding these changes to this PR? Do you know what the issue is with the SPIRV functions for MMA? Do we need a different version of IGC for it to work? |
d9b8248
to
0cdbb6a
Compare
I think the include chain makes the compilation failure maybe. I reorged it following @joeatodd 's suggestion. |
0cdbb6a
to
0c2fc94
Compare
0c2fc94
to
833bf00
Compare
833bf00
to
07e0632
Compare
07e0632
to
da69fe7
Compare
969eafe
to
f57f308
Compare
hi @aacostadiaz Could you help me debug the CI. I have looked into the info of CI, but I have no clue where the error is |
It looks like the current version of IGC still doesn't have the SPIRV functions. We will need to disable SPIRV until it is available. This is IGC version 1.6.32224+14 in CI. |
795f6ca
to
dd576ec
Compare
dd576ec
to
5c8faa8
Compare
5c8faa8
to
73bef6e
Compare
sycl_compiler_path=/opt/cutlass/compiler/20250304/
gpu_driver_path=/opt/cutlass/gpu_driver/gfx-driver-ci-comp_igc-28698/extract
This PR is a draft. There is something wrong with SHAPE.
The example pvc_gemm performance dropped a lot.
I will check it
@rolandschulz @mehdi-goli @tdeng5 please take a look