From 614678f8e7388ef8dd862abe70ceb2db3cc4adba Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 6 Oct 2026 17:20:40 +0200 Subject: [PATCH] sycl: native_router_top10_multi launches the single-token route<512> per token block Same bits as upstream's one-warp-per-token route_multi (native_multi_parity compares them), and the same launch shape as the 256-expert multi router. --- sycl/src/kernels/cuda/native_router.dp.cpp | 23 +++++++--------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/sycl/src/kernels/cuda/native_router.dp.cpp b/sycl/src/kernels/cuda/native_router.dp.cpp index 9bbb52d0..e392b88a 100644 --- a/sycl/src/kernels/cuda/native_router.dp.cpp +++ b/sycl/src/kernels/cuda/native_router.dp.cpp @@ -270,22 +270,13 @@ void native_router_top10_multi(const float* logits, int32_t* ids, float* weights if (!stream || n_tok < 1 || !valid(logits, (size_t) n_tok * 512 * 4) || !valid(ids, (size_t) n_tok * 10 * 4) || !valid(weights, (size_t) n_tok * 10 * 4)) throw std::invalid_argument("native router (multi) requires a stream and aligned [n,512]/[n,10] buffers"); - { - auto exp_props = sycl::ext::oneapi::experimental::properties{ - sycl::ext::oneapi::experimental::use_root_sync}; - - ((sycl::queue *)(strata::q_of(stream))) - ->parallel_for>( - sycl::nd_range<3>( - sycl::range(1, 1, (unsigned)((n_tok + 7) / 8)) * - sycl::range(1, 8, 32), - sycl::range(1, 8, 32)), - exp_props, - [=](sycl::nd_item<3> item_ct1) - [[sycl::reqd_sub_group_size(32)]] { - route_multi(logits, ids, weights, n_tok); - }); - } + // SYCL port: one block per token running the single-token route<512> (the same kernel as the 256-expert multi + // launch below). Upstream's one-warp-per-token route_multi gives the same bits (native_multi_parity checks + // that) but hung an Arc A750 (Alchemist) on its first launch. + ((sycl::queue *)(strata::q_of(stream))) + ->parallel_for>( + sycl::nd_range<3>(sycl::range(1, 1, (unsigned) n_tok) * sycl::range(1, 8, 32), sycl::range(1, 8, 32)), + [=](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(32)]] { route<512>(logits, ids, weights); }); /* DPCT1010: SYCL uses exceptions to report errors and does not use the error codes. The cudaGetLastError function call was replaced with 0. You