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:
claudeandClaude Opus 5.5 committed 2026-10-23 15:38:42 +02:00
1 parent 17524c95bd
commit 8addda231b
19 files changed
+1302 -39

No files matched your search

+24 -1
View File
@@ -1225,6 +1225,7 @@ int Engine::declare() {
{
std::vector<MissReport> rep;
for (auto& r : ranks_) rep.push_back(miss_report(r->program, device_is_host()));
const bool sycl = std::strcmp(device_backend_name(), "sycl") == 0;
bool same = true;
for (size_t i = 1; i < rep.size(); ++i) if (!(rep[i] == rep[0])) same = false;
@@ -1237,9 +1238,23 @@ int Engine::declare() {
"one of them cannot run:", who.c_str(), rep[i].device.size());
for (const std::string& l : rep[i].device) RAD_ERR(" %s", l.c_str());
}
if (!rep[i].host_only.empty()) RAD_INFO("%s", rep[i].host_only.c_str());
if (!rep[i].host_only.empty()) {
if (sycl) RAD_ERR("%s", rep[i].host_only.c_str());
else RAD_INFO("%s", rep[i].host_only.c_str());
}
if (!rep[i].host.empty()) RAD_INFO("%s", rep[i].host.c_str());
}
/* On the SYCL backend a host-only op is a hole, not a placement: the Intel backend runs
* its ops on the card or not at all, so a kernel it lacks stops the start by name rather
* than running that op on the CPU (docs/SYCL_PORTING.md §4.4). --debug-graph serves
* nothing and prints the graph regardless. */
if (sycl && !cfg_.debug_graph)
for (const MissReport& m : rep)
if (!m.host_only.empty()) {
RAD_ERR("not starting: on the SYCL backend every op runs on the card, and the "
"op(s) above have no device kernel in the loaded libraries");
return RAD_E_UNSUPPORTED;
}
/* A hole refuses startup: the bands come from this run's limits, so a request can land in
* one, and that step would fail at issue and stop the engine. --debug-graph serves nothing,
* so it continues to print the graph and reports the holes in its exit status
@@ -3306,6 +3321,14 @@ int Engine::start() {
devnote_ = devnote;
if (s < 0) { RAD_ERR("no usable device"); return s; }
/* One card on the SYCL backend (docs/SYCL_PORTING.md §4.7): it has no all-reduce kernels, and a
* second rank would wait on one. */
if (cfg_.tp > 1 && std::strcmp(device_backend_name(), "sycl") == 0) {
RAD_ERR("--tp %d: the SYCL (Intel GPU) backend serves one card; tensor parallelism needs "
"all-reduce kernels it does not have. Use --tp 1", cfg_.tp);
return RAD_E_UNSUPPORTED;
}
if ((int)devs.size() < cfg_.tp) {
RAD_ERR("--tp %d needs %d devices of one architecture; %zu are usable [%s]",
cfg_.tp, cfg_.tp, devs.size(), inventory.c_str());