[PR #1589] [CLOSED] sycl: keep the null-stream sentinel a sentinel in Verifier (#1555) #3547

Closed
opened 2026-11-07 14:42:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1589
Author: @nekomario28
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: fix-1555-sycl-stream-sentinel


📝 Commits (1)

  • c245661 sycl: keep the null-stream sentinel a sentinel in Verifier (#1555)

📊 Changes

2 files changed (+4 additions, -4 deletions)

View changed files

📝 sycl/include/strata/core/verify.hpp (+3 -3)
📝 sycl/src/core/verify.cpp (+1 -1)

📄 Description

Fixes #1555.

The dpct migration changed cudaStream_t ext_stream_ = nullptr into dpct::queue_ptr ext_stream_ = &dpct::get_in_order_queue(), evaluated at construction on whichever device is current then — not "no stream". With a stage constructed on device 0 and init'ed on device 1, the != &get_in_order_queue() test at init() compared a device-0 pointer against a device-1 queue, so cs_ took device 0's queue → Cannot submit to a queue with a dependency from a graph that is associated with a different context / UR_RESULT_ERROR_DEVICE_LOST.

Changes

  • sycl/include/strata/core/verify.hpp: ext_stream_ = nullptr — restores the CUDA sentinel contract (include/strata/core/verify.hpp:319).
  • sycl/src/core/verify.cpp: init() tests ext_stream_ != nullptr, matching the CUDA src/core/verify.cpp:604.

The teardown at line 377 (cs_ && cs_ != ext_stream_) and the create_queue fallback at line 619 already work under the restored sentinel: an unset ext_stream_ falls back to creating the stage's own queue; a set_stream'd one is never destroyed here.

Test plan

  • Verified against the CUDA original the migration came from: sentinel nullptr, init() nullptr-test, teardown ownership test — the SYCL side now matches all three.
  • git grep over sycl/ for other sites treating &get_in_order_queue() as an unset sentinel — none besides this one (the other captures are call-time locals/default args, evaluated in the right context).

Not tested: a SYCL compile or a multi-device run — no SYCL toolchain here; the fix is a semantic restore of the CUDA code it was migrated from, which the reporter's trace already diagnosed.


🔄 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/1589 **Author:** [@nekomario28](https://github.com/nekomario28) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-1555-sycl-stream-sentinel` --- ### 📝 Commits (1) - [`c245661`](https://github.com/Niko1221/Strata/commit/c24566169a281f96d51215e88e502e963c0d6460) sycl: keep the null-stream sentinel a sentinel in Verifier (#1555) ### 📊 Changes **2 files changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `sycl/include/strata/core/verify.hpp` (+3 -3) 📝 `sycl/src/core/verify.cpp` (+1 -1) </details> ### 📄 Description Fixes #1555. The dpct migration changed `cudaStream_t ext_stream_ = nullptr` into `dpct::queue_ptr ext_stream_ = &dpct::get_in_order_queue()`, evaluated at construction on whichever device is current then — not "no stream". With a stage constructed on device 0 and `init`'ed on device 1, the `!= &get_in_order_queue()` test at `init()` compared a device-0 pointer against a device-1 queue, so `cs_` took **device 0's queue** → `Cannot submit to a queue with a dependency from a graph that is associated with a different context` / `UR_RESULT_ERROR_DEVICE_LOST`. ## Changes - `sycl/include/strata/core/verify.hpp`: `ext_stream_ = nullptr` — restores the CUDA sentinel contract (`include/strata/core/verify.hpp:319`). - `sycl/src/core/verify.cpp`: `init()` tests `ext_stream_ != nullptr`, matching the CUDA `src/core/verify.cpp:604`. The teardown at line 377 (`cs_ && cs_ != ext_stream_`) and the create_queue fallback at line 619 already work under the restored sentinel: an unset `ext_stream_` falls back to creating the stage's own queue; a `set_stream`'d one is never destroyed here. ## Test plan - Verified against the CUDA original the migration came from: sentinel `nullptr`, `init()` nullptr-test, teardown ownership test — the SYCL side now matches all three. - `git grep` over `sycl/` for other sites treating `&get_in_order_queue()` as an unset sentinel — none besides this one (the other captures are call-time locals/default args, evaluated in the right context). Not tested: a SYCL compile or a multi-device run — no SYCL toolchain here; the fix is a semantic restore of the CUDA code it was migrated from, which the reporter's trace already diagnosed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:42:14 +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#3547
No description provided.