Skip to content

Conversation

GittyBurstein
Copy link

Motivation

This PR adds full support for the ARANGE operator to the SYCL backend, bringing feature parity with the CPU backend for range creation.
The goal is to allow consistent tensor initialization across devices, ensure correctness, and improve usability when running llama.cpp with GPU acceleration via SYCL.


Changes in this PR

  • Kernel Implementation

    • Added a dedicated SYCL kernel for ARANGE in element_wise.cpp.
    • Dispatch and integration logic added to ggml-sycl.cpp.
  • Helper Functions

    • Introduced robust sycl_launch and sycl_parallel_for overloads to handle sycl::queue* and dpct::queue_ptr seamlessly.
    • Ensured compatibility with DPC++/oneAPI builds.
  • Documentation

    • Updated docs/ops/SYCL.csv to mark ARANGE as supported.
    • Regenerated docs/ops.md with the updated operator support table.
  • Testing

    • Added coverage for ARANGE in test-backend-ops.
    • Verified identical results between SYCL GPU and CPU backends.

Testing Details

Commands used to validate this PR:

# GPU (SYCL)
./bin/test-backend-ops test -b SYCL0 -o ARANGE -p "type=f32,start=0,stop=10,step=1"

# CPU
./bin/test-backend-ops test -b CPU -o ARANGE -p "type=f32,start=0,stop=10,step=1"

@github-actions github-actions bot added documentation Improvements or additions to documentation 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 Sep 14, 2025
@github-actions github-actions bot added the Nvidia GPU Issues specific to Nvidia GPUs label Sep 14, 2025
@GittyBurstein
Copy link
Author

@ggml-maintainers @ggerganov
I’d greatly appreciate your review of this PR.
It adds SYCL support for the ARANGE operator.
The implementation includes full functionality, tests, and updated documentation.
Any feedback on the implementation, code structure, or required adjustments to meet project standards would be very helpful. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning Nvidia GPU Issues specific to Nvidia GPUs 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.

1 participant