From 37fa9f7817dd0d1609792ec6a72cc54b8b142ff2 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Wed, 7 Oct 2026 20:56:08 +0200 Subject: [PATCH] sycl: the sampler's launchers no longer require FP64 (dpct left aspect::fp64 checks; samp_acc_t is float by default), so a sampled token no longer needs Intel's FP64 emulation on an A750 --- sycl/src/kernels/cuda/sampler.dp.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sycl/src/kernels/cuda/sampler.dp.cpp b/sycl/src/kernels/cuda/sampler.dp.cpp index e9206fdb..be751a4f 100644 --- a/sycl/src/kernels/cuda/sampler.dp.cpp +++ b/sycl/src/kernels/cuda/sampler.dp.cpp @@ -33,8 +33,18 @@ #include #include #include +#include #include +namespace { +// The sampler's accumulators are strata::samp_acc_t (float unless -DSTRATA_SYCL_SAMPLER_FP64=1), so its kernels need FP64 +// only in that build. dpct left an `aspect::fp64` check before every launch; on an Arc Alchemist (A750, no FP64) it +// threw "'double' is not supported" at the first sampled token unless Intel's FP64 emulation was switched on. +inline void sampler_require_fp64([[maybe_unused]] const sycl::device& d) { + if constexpr (std::is_same_v) dpct::has_capability_or_fail(d, {sycl::aspect::fp64}); +} +} // namespace + namespace strata::kernels { namespace { @@ -1530,9 +1540,7 @@ void sample_tokens(const float* logits, int n_tokens, int n_vocab, const int* hi */ auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; - dpct::has_capability_or_fail( - strata::q_of(stream)->get_device(), - {sycl::aspect::fp64}); + sampler_require_fp64(strata::q_of(stream)->get_device()); strata::q_of(stream) ->submit([&](sycl::handler &cgh) { @@ -1590,9 +1598,7 @@ void sample_tokens(const float* logits, int n_tokens, int n_vocab, const int* hi { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; - dpct::has_capability_or_fail( - strata::q_of(stream)->get_device(), - {sycl::aspect::fp64}); + sampler_require_fp64(strata::q_of(stream)->get_device()); strata::q_of(stream) ->parallel_forget_device(), - {sycl::aspect::fp64}); + sampler_require_fp64(strata::q_of(stream)->get_device()); strata::q_of(stream) ->submit([&](sycl::handler &cgh) { @@ -1756,7 +1760,7 @@ void coupled_draft_sample(float* logits, int nv, const int32_t* sub_to_id, const { auto exp_props = sycl::ext::oneapi::experimental::properties{ sycl::ext::oneapi::experimental::use_root_sync}; - dpct::has_capability_or_fail(s->get_device(), {sycl::aspect::fp64}); + sampler_require_fp64(s->get_device()); s->parallel_for>( sycl::nd_range<3>(sycl::range(1, 1, 32), sycl::range(1, 1, 32)),