Skip to content

Conversation

@yael-works
Copy link
Contributor

@yael-works yael-works commented Sep 14, 2025

Summary

This PR adds GGML_OP_COUNT_EQUAL support to the SYCL backend.

Changes

  • Implemented ggml_sycl_op_count_equal() and its wrapper ggml_sycl_count_equal()
  • Registered GGML_OP_COUNT_EQUAL in:
    • ggml_sycl_compute_forward()
    • ggml_backend_sycl_device_supports_op()
  • Updated docs/ops.md and regenerated docs/ops/SYCL.csv to reflect SYCL support
  • Added unit tests for COUNT_EQUAL:
    • Regular test case
    • Typed tests covering F32, F16, I32, and I16

Verification

  • Built successfully with cmake + make
  • Verified backend reports support:
    ./build/bin/test-backend-ops support -o COUNT_EQUAL -b sycl

@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
Copy link
Collaborator

@NeoZhangJianyu NeoZhangJianyu left a comment

Choose a reason for hiding this comment

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

  1. could you rebase the code since sycl_parallel_for() is reverted to stream->parallel_for() in base?
  2. same commit of #15937.

Thank you!


return a - b;

static __dpct_inline__ float op_count_equal(const float a, const float b) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove duplicated code in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!
I removed the duplicated op_count_equal definition from binbcast.hpp as requested.
The branch is now rebased on the latest master and clean.

Copy link
Collaborator

@NeoZhangJianyu NeoZhangJianyu left a comment

Choose a reason for hiding this comment

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

Thank you for great work!

@yael-works
Copy link
Contributor Author

The iOS CI job is failing due to a missing SDK on the runner (iOS 26.0 is not installed), which seems unrelated to this PR.
All other CI checks have passed successfully.
This PR has already been reviewed and approved by @NeoZhangJianyu, and the requested changes from @slaren were addressed.
Could you please rerun the iOS job or proceed with merging if this failure is expected?

@slaren slaren merged commit b907255 into ggml-org:master Sep 15, 2025
47 of 48 checks passed
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 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.

3 participants