Skip to content

Run YuE2 on the SYCL backend - #1243

Merged
0xShug0 merged 2 commits into
0xShug0:mainfrom
newjordan:pr/yue2-sycl-champion
Nov 9, 2026
Merged

0xShug0 merged 2 commits into
0xShug0:mainfrom
newjordan:pr/yue2-sycl-champion

Conversation

@newjordan

@newjordan newjordan commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

YuE2 at 2.98x realtime on an Arc Pro B70, up from 1.75x with enablement alone, with no flags or environment variables. 3.02x with the opt-in weight cache.

Runs YuE2 on --backend sycl. On SYCL, YuE2 defaults to a new sycl_perf preset. Other backends keep their existing defaults.

  • SYCL-gated graph changes: the NAR timestep goes through ADD broadcasting, strided Q for flash attention, pre-padded stride-1 depthwise conv as SSM_CONV, and F16 AR KV as on CUDA, HIP and Vulkan.
  • yue2.nar_window_frames and yue2.nar_overlap_frames cap the NAR chunk length, since attention cost grows with its square, and crossfade consecutive chunks in latent space. Windowing changes the output.
  • yue2.nar_prefix_cache computes the AR state of the prompt once instead of once per chunk.
  • yue2.compact_kv sizes the AR KV to the stage instead of 5120 tokens, because decode attention scans the whole capacity. Longer songs refill.
  • yue2.perf_mode=sycl_perf enables them together. yue2.perf_mode=off runs without it, and each control can be set on its own.
  • Unit tests for the new helpers, and docs for every option and for the SYCL runtime controls.

Measurements

Arc Pro B70, oneAPI 2026.1, Linux, yue2-3b-q8_0.gguf and yue2-vae-f16.gguf. city_lights, seed 831001, 8 NAR steps, cot=full, one warmup then 3 measured takes. All rows are built with GGML_SYCL_F16=ON.

Config Realtime Session Semantic decode NAR VAE Peak VRAM
Enablement only, cuda_perf, without the ggml-sycl kernels or this tuning 1.75x 33.4 s 101 tok/s 8.2 s 1.9 s not measured
This PR, perf_mode=off 1.68x 40.3 s 73 tok/s 3.0 s 2.1 s 12.7 GiB
This PR, perf_mode=cuda_perf 2.61x 25.9 s 140 tok/s 3.0 s 2.2 s not measured
This PR, default (sycl_perf) 2.98x 22.8 s 170 tok/s 3.2 s 2.2 s 8.6 GiB
This PR, default plus GGML_SYCL_WEIGHT_F16_CACHE=1 3.02x 22.4 s 169 tok/s 2.9 s 2.1 s 16.5 GiB

Each row is the median of 3 takes after one warmup, on an otherwise idle machine.

source /opt/intel/oneapi/setvars.sh
cmake -S . -B build/sycl -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DENGINE_ENABLE_SYCL=ON \
  -DAUDIOCPP_MODEL_SET=custom -DAUDIOCPP_MODELS=yue2 -DENGINE_BUILD_TESTS=ON
cmake --build build/sycl --target audiocpp_cli -j 16
ONEAPI_DEVICE_SELECTOR=level_zero:gpu build/sycl/bin/audiocpp_cli --task gen --family yue2 \
  --model <Yue2-3B-GGUF> --backend sycl --threads 8 --lyrics "$LYRICS" \
  --request-option "style=$STYLE" --request-option cot=full --request-option guidance_scale=1.0 \
  --request-option num_inference_steps=8 --request-option semantic_max_tokens=6500 --seed 831001 --out out.wav --log

Validation

  • Output levels over 8 takes with the weight cache on: median peak 0.80 and no clipped samples.
  • Prefix cache exactness: with identical semantic tokens and noise, cache on and off differ by -60.8 dB. The run-to-run floor is -66.3 dB.
  • Completed with no NaNs: a forced 136 s song (4 NAR windows, 1 KV refill), CFG, perf_mode=off, perf_mode=cuda_perf, and the graph, oneDNN attention and weight-cache opt-outs.
  • Arc Pro B70, ctest: passes except kaldi_fbank_sparse_test and mel_spectrogram_frontend_test, which fail the same way on unmodified main built with icx and pass with gcc.
  • RTX 4080, CUDA 13: YuE2 PCM is byte-identical to main with perf off and with cuda_perf. The full model set builds and ctest is 108/108 with 1 skip (torch_random_cuda_multi_device_test).

Limitations

Tested on one Intel GPU, the Arc Pro B70, on Linux. Peak VRAM is 8.6 GiB there by default.

@0xShug0

0xShug0 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@newjordan Will review tomorrow. Could you rebase?

- NAR: add the timestep vector with ADD broadcasting on SYCL instead of
  materializing it with REPEAT first. Other backends keep repeat + add.
- NAR attention: SYCL flash attention reads Q through its strides, so skip
  the Q ggml_cont there. Other backends are unchanged.
- DepthwiseConv1dModule: SYCL has no CONV_2D_DW kernel. A pre-padded
  stride-1 depthwise conv is the same per-channel correlation as SSM_CONV,
  so use that on SYCL.
- AR: F16 KV storage on SYCL, as on CUDA, HIP and Vulkan.
- Unit tests for the NAR conditioning and attention layout helpers.

Every change is gated to BackendType::Sycl; CUDA output is byte-identical
before and after. The cuda_perf preset is not backend-gated and applies on
SYCL unchanged.
Attention over a whole song is what makes NAR slow, and the prompt state is
recomputed for every chunk. These controls bring YuE2 on SYCL to the speed
of its best measured configuration:

- yue2.nar_window_frames / yue2.nar_overlap_frames cap the NAR chunk length
  and crossfade consecutive chunks in latent space.
- yue2.nar_prefix_cache computes the AR state of the prompt once and reuses
  it, unrounded, for every chunk.
- yue2.compact_kv starts with a KV capacity that fits the stage instead of
  5120 tokens, since decode attention scans the whole capacity.
- yue2.perf_mode=sycl_perf enables them together and is the SYCL default.

Other backends keep their existing defaults.
@newjordan

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 7d20b414. It is now just the two YuE2 commits, and the code is unchanged from the previous head.

@0xShug0
0xShug0 merged commit 047fb42 into 0xShug0:main Nov 9, 2026
7 checks passed
@0xShug0

0xShug0 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@newjordan PR merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants