On kernel 7.0 the xe driver can oops (drm_pagemap_zdd_destroy from
__drm_pagemap_migrate_to_ram) when the CPU faults on a page its shared
virtual memory had migrated into VRAM. The backend reached plain system
memory in several ways; each now uses USM the runtime knows:
- RAD_MEM_HOST_PINNED/_MAPPED are sycl::aligned_alloc_host, not
posix_memalign + prepare_for_device_copy. O_DIRECT cannot target those
pages (EFAULT), so DirectFile bounces such transfers through an 8 MiB
buffer. The 27B load is not slower (10.8 s read, disk-bound).
- Copies with a pageable side are staged through a host-USM bounce,
synchronously (rare: startup and tests). The ranged copy stages a host
range list even when its source is on the card, and refuses a pageable
destination, which its kernel would write.
- scatter_rows' bad-index flag is host USM, not shared.
- Gates are gone (the documented state): a spinning kernel never sees a
host store to host USM, and a device flag opened by a copy from another
queue deadlocks behind copies queued past the gate. rad-kbench times
ungated; the gate tests skip on backends without gates.
Checked: device_test (sycl) 70 cases, 0 failed; rad-kbench fixture
1989/1989; 27B int4 chat output byte-identical (c4c5ba5e727c) at
30.6 tok/s; no xe messages in the kernel log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The step upload's range kernel read its range list and sources from pinned host memory, a link
round trip a load (PCIe x1 on the B65): 3 calls a speculative round at 650 us. Their span and the
list now cross in one transfer each into a per-stream device buffer. device_test_sycl passes;
greedy output identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
The SYCL backend read the list on the host at the call. device.h says the kernel reads it when it
runs, so it may live in device memory or be written by earlier work on the stream; rad-kbench's
timer keeps it on the card, and --bench / --timing-only segfaulted in calibration. The prefix is
now one copy and the ranges one kernel after it (a work-group a range, 4-byte words, as the HIP
card's aql_copy_ranges), so a range over the prefix still lands last. device_test_sycl passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018EpFgqQidSnH8zo7boVZC1
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