Skip to content

Conversation

@shani-f
Copy link

@shani-f shani-f commented Oct 23, 2025

Summary

Implements the REPEAT_BACK operator for the SYCL backend, enabling mirrored repetition of tensor data on SYCL devices.
The implementation matches the behavior of the existing CPU version.

Changes

  • Added repeat_back.cpp with SYCL kernel implementation
  • Added dispatch in ggml-sycl.cpp under GGML_OP_REPEAT_BACK
  • Integrated into the SYCL compute pipeline

Implementation

  • Supports tensors up to 4 dimensions
  • Performs reflection-based repetition using modular indexing
  • Parallelized with parallel_for using range<3>
  • Efficient indexing for mirrored boundaries
  • Zero-overhead path for non-repeated cases

Testing

  • Verified results match the CPU implementation
  • Checked correctness on multi-dimensional tensors
  • Tested reflection accuracy on all tensor edges

Performance

  • Optimized index computation (no redundant divisions)
  • Memory accesses follow contiguous layout
  • Minimal kernel footprint and register usage

Compatibility

  • Supports F32 tensors
  • Works with Level Zero and OpenCL backends
  • Follows existing SYCL backend design conventions

@github-actions github-actions bot added ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Oct 23, 2025
@shani-f shani-f force-pushed the feature/sycl-repeat-back branch from b80dce9 to d3e88bc Compare October 23, 2025 10:12
@shani-f
Copy link
Author

shani-f commented Oct 23, 2025

@CISC @NeoZhangJianyu
this PR adds SYCL backend support for GGML_OP_REPEAT_BACK.
All tests pass locally and the implementation currently supports F32 tensors.

@CISC CISC requested a review from NeoZhangJianyu October 26, 2025 10:19
shani-f and others added 3 commits October 26, 2025 12:37
@shani-f
Copy link
Author

shani-f commented Oct 26, 2025

Hello @CISC @NeoZhangJianyu,
I noticed that the two failing checks are WebGPU and WebUI tests, which seem unrelated to my changes.
I’d appreciate it if you could let me know what the next step is toward merging.
Thank you!

@CISC
Copy link
Collaborator

CISC commented Oct 26, 2025

I noticed that the two failing checks are WebGPU and WebUI tests, which seem unrelated to my changes. I’d appreciate it if you could let me know what the next step is toward merging. Thank you!

It happens sometimes, I've re-run them, but don't worry about it. @NeoZhangJianyu will review when time permits.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants