Archived
device: the SYCL backend -- Intel GPUs through oneAPI over Level Zero
A fourth DeviceBackend, in librad_sycl.so: in-order sycl::queues on one context, events as barriers, copies and fills on the queue, gates as a spin kernel on a pinned flag, and the core's advance and weight-table kernels as SYCL twins of their .hip files. RadStreams are RadSyclStreams (abi/rad_sycl.h). Pinned host memory is page-aligned memory registered for device copies, since O_DIRECT cannot read into SYCL's malloc_host pages; event timing is opt-in (RADIANCE_SYCL_TIMING=1) because profiling queues cost ~20 us of host time a submission. The SYCL code is its own CMake project, sycl/, configured with icpx through ExternalProject, so the engine and every host plugin stay on the main compiler: a SYCL build's host code is the default build's. RAD_SYCL (default OFF), build.sh --sycl, the sycl presets; HIP and SYCL in one build are refused at configure. On the SYCL backend --tp > 1 and ops resolved only to host kernels stop the start, since the Intel backend runs on one card and never puts an op on the CPU. A SYCL build that sees no GPU warns that it runs on the CPU and names the missing oneAPI environment. device_test runs on the Arc Pro B65 as device_test_sycl (label sycl): 36 cases pass, 12 skip (elastic memory, not provided; host-backend-only cases). Host tests hide Level Zero GPUs with ONEAPI_DEVICE_SELECTOR. The host tier is the baseline's in both the default and the SYCL build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
This commit is contained in:
1 parent
17524c95bd
commit
8addda231b
19 files changed
+1302
-39
No files matched your search
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
#include "device.h"
|
||||
#include "../rad_internal.h"
|
||||
#if defined(RAD_HAVE_SYCL) && RAD_HAVE_SYCL
|
||||
#include "sycl_host.h"
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdarg>
|
||||
@@ -84,7 +87,33 @@ static void warn_cwsr_off() {
|
||||
static DeviceBackend g_host_beside_hip;
|
||||
#endif
|
||||
|
||||
#if defined(RAD_HAVE_SYCL) && RAD_HAVE_SYCL
|
||||
/* What librad_sycl.so reaches of the engine (sycl_host.h). */
|
||||
static const SyclHost g_sycl_host = {
|
||||
kSyclHostVersion,
|
||||
[] { return (int)log_level(); },
|
||||
[](int level, const char* file, int line, const char* msg) {
|
||||
log_emit((Log)level, file, line, "%s", msg);
|
||||
},
|
||||
[](const char* msg) { device_set_error("%s", msg); },
|
||||
};
|
||||
#endif
|
||||
|
||||
static const DeviceBackend* select_backend() {
|
||||
#if defined(RAD_HAVE_SYCL) && RAD_HAVE_SYCL
|
||||
/* A SYCL build has no HIP (configure refuses both, docs/SYCL_PORTING.md §4.5). */
|
||||
if (const DeviceBackend* b = rad_sycl_backend(&g_sycl_host)) {
|
||||
RAD_INFO("device: SYCL backend, %d device(s) [%s]", b->count(),
|
||||
device_inventory(b).c_str());
|
||||
return b;
|
||||
}
|
||||
/* A warning, not Info: on a machine whose card is there, this is the GPU being skipped. The
|
||||
* usual cause is a missing oneAPI environment, since the runtime loads its Level Zero adapter
|
||||
* and that adapter's libraries (libumf) from the oneAPI tree at run time. */
|
||||
RAD_WARN("device: built with SYCL but no Level Zero GPU is visible -- using the host backend "
|
||||
"(CPU). If this machine has an Intel GPU, load the oneAPI environment first "
|
||||
"(. /opt/intel/oneapi/setvars.sh); ONEAPI_DEVICE_SELECTOR may also be hiding it");
|
||||
#endif
|
||||
#if defined(RAD_HAVE_HIP) && RAD_HAVE_HIP
|
||||
if (const DeviceBackend* b = aql_backend_if_present()) {
|
||||
RAD_INFO("device: AQL backend, %d device(s) [%s]", b->count(),
|
||||
|
||||
Reference in new issue
Block a user