[RFC] Introducing `llvm-project/offload`

Johannes and I have discussed this a lot out of band now. We both agree llvm/offload should be a thing but do not agree about what it should contain.

There are things that are common to GPU offloading languages, their runtimes and the associated vendor libraries. This leads to duplicated work. GPU libc was partly built by copy&paste from openmp.

LLVM has an architectural strategy for deduplication which involves separate modules out of which user facing tools are built. I think that is the right way to build software.

OpenMP has a host language runtime named libomptarget and a device language runtime named DeviceRTL. The former is large, complicated and could do with some engineering attention. The latter is quite openmp-specific - and compiled using openmp - but does contain code that could be factored out for use by other language runtimes. Libomptarget was an import into llvm as a single block of code and is still internally quite alien to it. Licensing hazards prevented changing that until relatively recently.

Libomptarget is not a collection of reusable components. It could be refactored into such, incrementally extracting code useful beyond openmp from it, with the end state of a collection of libraries aesthetically indistinguishable from the rest of LLVM. That is the proper form for llvm/offload, not a copy of the existing openmp infrastructure.

Extending libomptarget for easier use from other language runtimes seems a good thing and totally feasible without renaming it. I don’t think we should claim the llvm/offload namespace to mean “openmp as-is plus stuff”, when it could mean “offloading libraries for llvm”.

3 Likes