-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL][NewOffloadModel] Update SYCL device library generation for new offloading model #20512
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
Are you sure you want to change the base?
[SYCL][NewOffloadModel] Update SYCL device library generation for new offloading model #20512
Conversation
|
The modifications to set the new offloading model as default in this PR were directly copied from (#15121). These changes will be removed once CI confirms there are no regressions. |
8257fbd to
76e101f
Compare
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 the PR! one higher level comment below
| set(bc_device_compile_opts -fsycl-device-only -fsycl-device-obj=llvmir) | ||
| set(obj-new-offload_device_compile_opts -fsycl -c --offload-new-driver | ||
| set(obj-old-offload_device_compile_opts -fsycl -c ${sycl_targets_opt} --no-offload-new-driver) | ||
| set(obj_device_compile_opts -fsycl -c --offload-new-driver |
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.
my worry here is that it seems this PR enables the new offload model by default for some but not all compilation modes, and since we are setting the default device library files to be the new offloading model (since we pass --offload-new-driver), i am not sure of those compilation modes using the old offload model will be able to use libdevice. the new offload model supports using old libdevice files, but i had to explicitly implement that to get it working and i don't think anyone did the opposite case since it wasn't expected to be be needed, but it's possible it works automagically. can you make sure the cases using the old offload model still work?
This pull request refactors the SYCL device library build and end-to-end tests to support the new offloading model, while maintaining backward compatibility for the old offloading model, with the following key changes.
libsycl-itt-compiler-wrappers.o) is now compiled using the new offloading model, and the library ending with.new.o(such aslibsycl-itt-compiler-wrappers.new.o) has been renamed to.old.o(such aslibsycl-itt-compiler-wrappers.old.o), representing builds with the old offloading model. These changes are made inlibdevice/cmake/modules/SYCLLibdevice.cmake.sycl/test-e2e/Config/kernel_from_file.cppandsycl/test-e2e/SeparateCompile/test.cpphave been updated. The tests now validate both the new offloading model, and the backward compatibility for the old model (usingclang-offload-bundlerto extract device code from libraries).