#6638 [Engine] sycl inkling: --selfcheck without --native crashed before printing a line
open · @kgmkm · 0 Kommentare · Auf GitHub
Server & APIAMD / HIPNVIDIA / CUDA
Beschreibung
## Problem
`strata-inkling --selfcheck` (without `--native`) dies with SIGSEGV before printing a line — on every release binary (0.1.65 sycl, verified here) and on main built locally, on either GPU.
`cmd_selfcheck` calls the backend with no model loaded (ink_main.cpp: the `model_path.empty()` case); the SYCL `selfcheck()` built a StepBatch against a default-constructed manifest and called `InkSyRunner::reset_slot(0)`. `reset_slot`'s only guard is `max_slots`, whose default is **1**, while the `sc_hist_*` device buffers it dereferences are **empty until alloc** — the empty vector's `operator[]` hands `dzero` a garbage pointer.
#0 ink_sycl::InkSyRunner::reset_slot(int)
#1 ink2::SyclInkBackend::selfcheck(std::string&)
`--selfcheck --native <model>` was always fine (init loads and allocs first), and the CPU backend passes without a model because it checks its own SIMD kernels instead — which is what `--selfcheck` (native optional, per the usage line) promises.
## Result
`--selfcheck` with no model prints `[selfcheck] PASS backend=sycl (<device> …, SG16)`: the device-side counterpart of the CPU backend's numerics checks. It runs one SG16 F32 linear kernel (`k_linear_f32_sg16`) on synthetic data and compares against the scalar reference — proving the runtime came up, USM allocates, kernels compile (AOT or JIT) and compute. `reset_slot` also tolerates the pre-alloc state now, so no future caller can resurrect the crash.
## Validation
**Passed** (Arc B580 12 GB + Arc Pro B70 32 GB, oneAPI DPC++ 2026.2.0, cmake `-DSTRATA_ENABLE_SYCL=ON -DSTRATA_SYCL_TARGETS=spir64,intel_gpu_bmg_g31`):
- unmodified main at `c6f6427d9`: `--selfcheck` → SIGSEGV, exit 139, zero output, on both GPUs (also true of the shipped 0.1.65 sycl package here); `--selfcheck --native SQ-20` → PASS.
- with this change: `--selfcheck` → PASS on the B580 (default) and on the B70 (`--gpu 1`, stacked on the `--gpu` PR); `--selfcheck --native Inkling-2-Mini-SQ-20.strata` → PASS, unchanged; a short serve session on SQ-20 unchanged.
- the repo's own e2e suite against the changed binary: `STRATA_INKLING_BIN=<build>/strata-inkling python -m unittest test_inkling_e2e` — 5/5 OK (the binary test builds a tiny .strata in-test and drives `--selfcheck`/`--info`/`--serve` at c=1..64 with Vision).
**Failed:** none on the hardware above.
**Not run:** CUDA/HIP builds (no toolchains here; their selfcheck paths are untouched), Metal, the fixture parity test `strata_v1_1_inkling2_test` (needs a fixture file this machine does not have).
Stacked on the `--gpu` PR: the first commit on this branch is that change; only the second commit is this one.
Mehr auf der Site
Links zu Install, Modellen, Releases.