Skip to content

[UR][Offload] Add initial Offload adapter #18271

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

Merged
merged 13 commits into from
May 27, 2025
Merged

Conversation

callumfare
Copy link
Contributor

Add the initial implementation of the Offload adapter for UR.

The adapter targets the new liboffload library in LLVM.

The adapter is experimental and is currently only maintained to drive development of liboffload by identifying and closing gaps with UR.

@RossBrunton
Copy link
Contributor

@intel/unified-runtime-reviewers Can I get this looked at when people get the chance?

Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 nit, otherwise LGTM

callumfare and others added 13 commits May 26, 2025 16:18
This makes the dependency on cudadrv optional and ifdefs away the cubin
workaround if it isn't. This isn't sufficient to have HIP devices
compile kernels, but does allow libur_adapter_offload to be built on
said hosts.

In addition, an unused variable error was fixed.
This adds "offload" to several locations, meaning that:
* It will be initialised by the loader and iterated like other adapters.
* ONEAPI_DEVICE_SELECTOR="offload:*" works (note that this is an
  extension to the ONEAPI_DEVICE_SELECTOR format).
* Platforms and adapters now report themselves as "OFFLOAD" rather than
  "CUDA" or "HIP".
It is non-trivial which binary format (spir, ptx, amdhsa) is accepted by
a given offload device. This should be fixed properly in the future, but
for now let the user specify it via an environment variable.
SYCL and the UR CTS produce HIP "offload bundles" when compiling for
AMDGPU, which cannot be accepted by the basic AMD offload plugin. This
change adds a simple offload bundle parser which extracts the
appropriate binary from the bundle, allowing it to be fed to liboffload.
@RossBrunton
Copy link
Contributor

@intel/llvm-gatekeepers Please merge.

@kbenzie kbenzie merged commit 809158f into intel:sycl May 27, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants