Merge upstream main (v1.12 -> v1.15.1, 408 commits) into the SYCL port

Conflicts from the old m2xfp branch take upstream's version. Two libxe2 fixes the merge needs:
- rad_plugin_abi_layout: the plugin now exports the ABI layout hash the loader checks.
- gemm_nt_q_w4a16: upstream 492d33c sends bf16 activations to the w4a16 GEMM (the separate cast
  is gone); the fast kernel took only f16, so every call fell back to the exact path (decode
  ~2.5 tok/s). A bf16 activation is narrowed to f16 (round to nearest even) into a workspace first,
  the dropped cast bit for bit; decode back to ~57 tok/s on one request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-11-02 00:25:57 +01:00
commit 7580ec3d17
937 files changed
+285776 -8914

No files matched your search

+30 -2
View File
@@ -538,6 +538,10 @@ std::string dev_pci_address(int device) {
if (!dev()->pci_address) return std::string();
return dev_string(64, [&](char* b, int n) { return dev()->pci_address(device, b, n); });
}
int64_t dev_stuck_ms() {
const auto f = dev()->stuck_ms;
return f ? f() : 0;
}
std::string dev_dma_lane(int device) {
if (!dev()->dma_lane) return std::string();
return dev_string(256, [&](char* b, int n) { return dev()->dma_lane(device, b, n); });
@@ -564,6 +568,7 @@ int dev_code_runs(size_t from, size_t to, int device, std::string* why) {
extern "C" {
int rad_dev_peer_access(int self, int peer) { return rad::dev_peer_access(self, peer); }
int rad_event_create_as(RadEvent* out, unsigned flags) {
const int s = dev()->event_create(out, flags);
@@ -578,6 +583,11 @@ void rad_event_destroy(RadEvent e) {
dev()->event_destroy(e);
}
int rad_event_record(RadEvent e, RadStream s) { return dev()->event_record(e, s); }
int rad_event_dma(RadEvent e, RadStream s, uint32_t** w) {
if (const auto f = dev()->event_dma) return f(e, s, w);
rad::device_set_error("rad_event_dma: the device backend has no DMA queue to complete an event");
return RAD_E_UNSUPPORTED;
}
int rad_event_wait(RadStream s, RadEvent e) { return dev()->event_wait(s, e); }
int rad_event_query(RadEvent e) { return dev()->event_query(e); }
int rad_event_sync(RadEvent e) {
@@ -612,10 +622,14 @@ int rad_event_elapsed_ms(RadEvent a, RadEvent b, float* out) {
}
int rad_memcpy_async(void* dst, const void* src, int64_t bytes, RadStream s) {
/* One address space (unified memory, or a host view of a device allocation): a copy
* onto itself is already done. */
if (dst == src) return RAD_OK;
return dev()->memcpy_async(dst, src, bytes, s);
}
int rad_memcpy_2d_async(void* dst, int64_t dpitch, const void* src, int64_t spitch,
int64_t width, int64_t height, RadStream s) {
if (dst == src && dpitch == spitch) return RAD_OK;
return dev()->memcpy_2d_async(dst, dpitch, src, spitch, width, height, s);
}
int rad_memset_async(void* dst, int value, int64_t bytes, RadStream s) {
@@ -659,8 +673,8 @@ void rad_ride_release(void* token, RadStream after, int64_t packets) {
if (const auto f = dev()->ride_release) f(token, after, packets);
}
int rad_xp_list(int device, void* mark, int n, const uint64_t* src, const uint64_t* dst, const uint64_t* bytes,
uint32_t* done, uint32_t done_val) {
if (const auto f = dev()->xp_list) return f(device, mark, n, src, dst, bytes, done, done_val);
uint32_t* done, uint32_t done_val, unsigned flags) {
if (const auto f = dev()->xp_list) return f(device, mark, n, src, dst, bytes, done, done_val, flags);
return RAD_E_UNSUPPORTED;
}
int64_t rad_xp_behind(int device) {
@@ -671,6 +685,20 @@ void* rad_dev_alloc_uncached(int64_t bytes) {
if (const auto f = dev()->alloc_uncached) return f(bytes);
return nullptr;
}
void* rad_dev_map_file(int fd, int64_t foff, int64_t bytes) {
const auto f = dev()->map_file;
if (!f) {
rad::device_set_error("rad_dev_map_file: the %s backend has no pinned host memory to map a "
"file into", dev()->name);
return nullptr;
}
void* p = f(fd, foff, bytes);
if (p) {
rad::g_ledger[RAD_MEM_HOST_MAPPED].bytes.fetch_add(bytes, std::memory_order_relaxed);
rad::g_ledger[RAD_MEM_HOST_MAPPED].count.fetch_add(1, std::memory_order_relaxed);
}
return p;
}
void rad_dev_free_uncached(void* p) {
if (const auto f = dev()->free_uncached) f(p);
}