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

Open
wants to merge 11 commits into
base: sycl
Choose a base branch
from

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.

callumfare and others added 8 commits April 30, 2025 17:21
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.
@ayylol
Copy link
Contributor

ayylol commented May 1, 2025

Looks like the PVC E2E job was hanging (took more than 4h) https://github.com/intel/llvm/actions/runs/14776311985/job/41486266686?pr=18271, cancelled and re-triggered it.

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