Skip to content

sycl: bound CONV_TRANSPOSE_1D input iteration - #31109

Open
newjordan wants to merge 1 commit into
ggml-org:masterfrom
newjordan:sycl/conv-transpose-1d-window-20261024
Open

newjordan wants to merge 1 commit into
ggml-org:masterfrom
newjordan:sycl/conv-transpose-1d-window-20261024

Conversation

@newjordan

Copy link
Copy Markdown
Contributor

Overview

Used angelX to optimize SYCL/drama 3 coordination, results are as follows

Each output reads only inputs with is0 <= idx < is0 + K, in the same ascending order as before.

Arc Pro B70, oneAPI 2026.1, test-backend-ops perf, base 9b56ccf vs patch, median of 3 same-boot A/B/A rounds, A/A 1.000-1.001:

input [ne0, ne1] kernel [K, OC, IC] s0 base us patch us speedup
[16, 1536] [16, 768, 1536] 8 3910.57 1348.59 2.90x
[128, 768] [16, 384, 768] 8 37735.00 1665.26 22.66x
[1024, 384] [8, 192, 384] 4 270371.75 1471.74 183.71x
[4096, 192] [4, 96, 192] 2 534614.63 752.74 710.23x

Shapes are the drama 3 codec decoder upsampling stack, added as perf cases. Chained 4-layer stack at 1/4/24 input frames: base 66.3/847.4/28638.5 ms, patch 2.3/6.7/30.7 ms. Kernel numbers, not end-to-end TTS latency.

Correctness: test-backend-ops -o CONV_TRANSPOSE_1D 116/116 on base and patch, and 116/116 rebased on 3f03b17. Seeded output dump (7.46 MB) byte-identical to base.

Full test-backend-ops aborts on base and patch alike at the non-F32 SWIGLU_OAI assert (element_wise.cpp:1187, see #30857). With only those cases excluded: 20145/20173 on base and patch, and every patch-run failure also fails on base.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - angelX for the optimization work; Claude Opus 5.5 for the rebase, validation, commit and opening this PR.

@newjordan
newjordan requested review from a team and ggerganov as code owners October 24, 2026 17:09
@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Oct 24, 2026
@anantshri

Copy link
Copy Markdown
Contributor

Device: Arc Pro B70 (oneAPI 2026.1.1)

I checked the bound algebra against the old continue filter: for s0 ≥ 1, [i_begin, i_end) selects precisely the same contributing inputs in the same ascending order, so accumulation order is unchanged - which is why byte-identical output is expected, not just close.
Confirmed empirically: outputs are bit-identical to base across 16 shapes (including gap shapes where an output legitimately gets zero contributions, and K<s0 / K=s0 / K>s0 corners) and across a chained 4-layer DAC-style stack at several latent lengths.

Perf: your table reproduces. Op-level test-backend-ops perf matches within noise on all four shapes; end-to-end on the 4-layer chain at your 24-frame point I measure 29.33 s (base) → 32.4 ms (patch), vs your 28.64 s → 30.7 ms. CONV_TRANSPOSE_1D suite 116/116 on base and patch; the rest of my 110-op suite is unchanged vs base.

One small ask: nothing upstream asserts s0 > 0 — ggml_conv_transpose_1d() checks p0 == 0 and d0 == 1 only. The old kernel happened to tolerate degenerate s0; the new one divides by it, so a graph built with s0 ≤ 0 is now UB. A one-line GGML_ASSERT(s0 > 0) (in ggml_sycl_op_conv_transpose_1d, or in ggml_conv_transpose_1d() so every backend benefits) would close that. Non-blocking - no in-tree caller uses s0 < 1.

Comment thread tests/test-backend-ops.cpp Outdated
test_cases.emplace_back(new test_argsort(GGML_TYPE_F32, {200000, 1, 1, 1}));
test_cases.emplace_back(new test_argsort(GGML_TYPE_F32, {200000, 16, 1, 1}));

// audio codec decoder upsampling stack (DAC-style, 4 latent frames in)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "stack" mean in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drama 3 audio decoder stack, nothing of mine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear I think. Maybe put more context in the comment as to what the test data is from. The comment doesn't make much sense in its current form.

@arthw arthw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good job!
I tested on B60.
Related UT cases are passed and the performance increased +170%.

Thank you!

@Titaniumtown

Copy link
Copy Markdown
Contributor

@anantshri Please do not copy-paste post AI slop in PR comments. It is quite rude and also goes against our Contribution Guidelines https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md#ai-usage-policy

Used angelX to optimize SYCL/drama 3 coordination, results are as follows

Each output reads only inputs with i*s0 <= idx < i*s0 + K, in the same ascending order as before.

Arc Pro B70, oneAPI 2026.1, test-backend-ops perf, base 9b56ccf vs patch, median of 3 same-boot A/B/A rounds, A/A 1.000-1.001:

| input [ne0, ne1] | kernel [K, OC, IC] | s0 | base us | patch us | speedup |
|---|---|---|---|---|---|
| [16, 1536] | [16, 768, 1536] | 8 | 3910.57 | 1348.59 | 2.90x |
| [128, 768] | [16, 384, 768] | 8 | 37735.00 | 1665.26 | 22.66x |
| [1024, 384] | [8, 192, 384] | 4 | 270371.75 | 1471.74 | 183.71x |
| [4096, 192] | [4, 96, 192] | 2 | 534614.63 | 752.74 | 710.23x |

Shapes are the drama 3 codec decoder upsampling stack, added as perf cases. Chained 4-layer stack at 1/4/24 input frames: base 66.3/847.4/28638.5 ms, patch 2.3/6.7/30.7 ms. Kernel numbers, not end-to-end TTS latency.

Correctness: test-backend-ops -o CONV_TRANSPOSE_1D 116/116 on base and patch, and 116/116 rebased on 3f03b17. Seeded output dump (7.46 MB) byte-identical to base.

Full test-backend-ops aborts on base and patch alike at the non-F32 SWIGLU_OAI assert (element_wise.cpp:1187, see ggml-org#30857). With only those cases excluded: 20145/20173 on base and patch, and every patch-run failure also fails on base.
@newjordan
newjordan force-pushed the sycl/conv-transpose-1d-window-20261024 branch from bd3ec67 to 2a2e0fa Compare October 29, 2026 14:27
test_cases.emplace_back(new test_conv_transpose_1d({16, 1536, 1, 1}, {16, 768, 1536, 1}, 8, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({128, 768, 1, 1}, {16, 384, 768, 1}, 8, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({1024, 384, 1, 1}, {8, 192, 384, 1}, 4, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({4096, 192, 1, 1}, {4, 96, 192, 1}, 2, 0, 1));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggerganov Does this look good to you?

This branch has not been deployed

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

Labels

ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants