[PR #1642] [CLOSED] sycl: MtpDrafter's queue defaults to nullptr, so a run without --mtp no longer crashes at exit #3579

Closed
opened 2026-11-07 15:29:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1642
Author: @recutita
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: sycl-mtp-queue-null


📝 Commits (1)

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

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 sycl/include/strata/core/mtp.hpp (+1 -1)
📝 sycl/tools/fixups.py (+6 -0)

📄 Description

Title

Issue: none for this site. Same dpct translation as #1555 (Verifier::ext_stream_, PR #1589); that PR's search found no other site, this is one.

Summary

A run without --mtp crashes after printing its output on the SYCL port: MtpDrafter's destructor waits on and destroys the device's default in-order queue. cs_ now starts as nullptr, as in the CUDA source (include/strata/core/mtp.h: cudaStream_t cs_ = nullptr).

What changed

  • sycl/include/strata/core/mtp.hpp: dpct::queue_ptr cs_ = &dpct::get_in_order_queue() -> nullptr. load() creates the drafter's own queue (the high-priority one, or create_queue(true)), so every path that uses cs_ runs after load(). The destructor already tests if (cs_) before wait() and destroy_queue().
  • sycl/tools/fixups.py: the same replacement as an entry, so a re-migrated tree keeps it. Checked on fb58e0d's mtp.hpp: one run gives the committed line, a second run changes nothing.

Nothing else changes: with --mtp the queue is created in load() exactly as before.

How it was checked

Arc Pro B70 (xe, Linux), main fb58e0d, AOT bmg-g31, Flash-Next IQ3_XXS, one card with the RAM mirror, --tokens, the same 40-token prompt:

without --mtp (--spec 2 --mtp-max-t 1 --suffix-draft 0), 3 runs with --mtp, 1 run
main fb58e0d 3 of 3 exit 139 after the output (one printed level_zero backend failed with error: 37 (UR_RESULT_ERROR_UNINITIALIZED), two printed nothing) exit 0
this change 3 of 3 exit 0 exit 0

The decoded tokens are the same before and after in both columns (identical output hashes), and so is the speed (32.4 tok/s without MTP, 54.4 with).

gdb (gdb-oneapi, break std::terminate, on the 0.1.40.4 base where it also happens) put the throw in MtpDrafter::~MtpDrafter(), from queue_impl::wait.

Extra Notes

Only the SYCL port is touched (CUDA and HIP already use nullptr). Tested only on a B-series card by B70 under the xe driver on Linux; not tested on an Arc A-series card (i915) or on Windows.

Assisted-by: Claude Code with Opus 5.5 medium


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1642 **Author:** [@recutita](https://github.com/recutita) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `sycl-mtp-queue-null` --- ### 📝 Commits (1) - [`881ce9a`](https://github.com/Niko1221/Strata/commit/881ce9a7a323737a422bb1b20581e15fbfcba14e) sycl: MtpDrafter's queue defaults to nullptr, so a run without --mtp no longer crashes at exit ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `sycl/include/strata/core/mtp.hpp` (+1 -1) 📝 `sycl/tools/fixups.py` (+6 -0) </details> ### 📄 Description ## Title Issue: none for this site. Same dpct translation as #1555 (`Verifier::ext_stream_`, PR #1589); that PR's search found no other site, this is one. ## Summary A run without `--mtp` crashes after printing its output on the SYCL port: `MtpDrafter`'s destructor waits on and destroys the device's default in-order queue. `cs_` now starts as `nullptr`, as in the CUDA source (`include/strata/core/mtp.h`: `cudaStream_t cs_ = nullptr`). ## What changed - `sycl/include/strata/core/mtp.hpp`: `dpct::queue_ptr cs_ = &dpct::get_in_order_queue()` -> `nullptr`. `load()` creates the drafter's own queue (the high-priority one, or `create_queue(true)`), so every path that uses `cs_` runs after `load()`. The destructor already tests `if (cs_)` before `wait()` and `destroy_queue()`. - `sycl/tools/fixups.py`: the same replacement as an entry, so a re-migrated tree keeps it. Checked on `fb58e0d`'s `mtp.hpp`: one run gives the committed line, a second run changes nothing. Nothing else changes: with `--mtp` the queue is created in `load()` exactly as before. ## How it was checked Arc Pro B70 (xe, Linux), main `fb58e0d`, AOT `bmg-g31`, Flash-Next IQ3_XXS, one card with the RAM mirror, `--tokens`, the same 40-token prompt: | | without `--mtp` (`--spec 2 --mtp-max-t 1 --suffix-draft 0`), 3 runs | with `--mtp`, 1 run | |---|---|---| | main `fb58e0d` | 3 of 3 exit 139 after the output (one printed `level_zero backend failed with error: 37 (UR_RESULT_ERROR_UNINITIALIZED)`, two printed nothing) | exit 0 | | this change | 3 of 3 exit 0 | exit 0 | The decoded tokens are the same before and after in both columns (identical output hashes), and so is the speed (32.4 tok/s without MTP, 54.4 with). gdb (`gdb-oneapi`, `break std::terminate`, on the 0.1.40.4 base where it also happens) put the throw in `MtpDrafter::~MtpDrafter()`, from `queue_impl::wait`. ## Extra Notes Only the SYCL port is touched (CUDA and HIP already use `nullptr`). Tested only on a B-series card by B70 under the xe driver on Linux; not tested on an Arc A-series card (i915) or on Windows. Assisted-by: Claude Code with Opus 5.5 medium --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3579
No description provided.