sycl: MtpDrafter's queue defaults to nullptr, so a run without --mtp no longer crashes at exit

dpct turned `cudaStream_t cs_ = nullptr` into `&dpct::get_in_order_queue()`: a drafter that never loads keeps it, and
its destructor destroys the device's default queue (exit 139, sometimes UR_RESULT_ERROR_UNINITIALIZED, after the output).
Arc Pro B70 at fb58e0d without --mtp: 3 of 3 runs crashed before, 0 of 3 after; output unchanged with and without --mtp.
This commit is contained in:
Katsumi Takeuchi authored and Niko1221 committed 2026-10-09 15:14:19 +02:00
1 parent 04dbe56145
commit c98902a657
2 files changed
+7 -1

No files matched your search

+1 -1
View File
@@ -231,7 +231,7 @@ private:
float chain_prob_[8] = {};
int64_t n_vocab_ = 0;
uint64_t vram_ = 0;
dpct::queue_ptr cs_ = &dpct::get_in_order_queue();
dpct::queue_ptr cs_ = nullptr; // load() creates it; not the device's queue, which ~MtpDrafter would destroy
dpct::experimental::command_graph_exec_ptr prefill_exec_[9] = {};
dpct::experimental::command_graph_exec_ptr prefill_dev_exec_[9] = {};
int32_t* pf_dev_ = nullptr; ///< E-4: a prompt's rows' token / step / position records, uploaded at once
+6
View File
@@ -334,3 +334,9 @@ edit("src/program/generate.cpp", sub(
edit("src/kernels/cuda/native_router.dp.cpp", lambda s: s.replace(
" item_ct1.barrier(sycl::access::fence_space::local_space);",
" sycl::group_barrier(item_ct1.get_sub_group()); // only subgroup row zero participates"))
# MtpDrafter: CUDA's `cudaStream_t cs_ = nullptr` came out as the device's default in-order queue. A drafter that never
# loads (no --mtp) kept it, and its destructor waited on and destroyed that queue: exit 139 after the output.
edit("include/strata/core/mtp.hpp", lambda s: s.replace(
" dpct::queue_ptr cs_ = &dpct::get_in_order_queue();\n",
" dpct::queue_ptr cs_ = nullptr; // load() creates it; not the device's queue, which ~MtpDrafter would destroy\n"))