Skip to content

Conversation

@safranowith
Copy link
Contributor

Summary

Add support for the FLOOR unary operator to ggml, with implementations for both CPU and SYCL backends.

Details

  • Added GGML_UNARY_OP_FLOOR to ggml_unary_op enum and updated operator name table.
  • Implemented CPU version in unary-ops.impl.h.
  • Implemented SYCL kernel in element_wise.cpp and dispatch in ggml-sycl.cpp.
  • Updated ggml_backend_sycl_device_supports_op to allow FLOOR.
  • Extended unit tests to validate the new op.

Testing

  • Built with -DGGML_SYCL=ON -DLLAMA_BUILD_TESTS=ON.
  • Ran ctest --output-on-failure: all relevant unary tests passed on CPU and SYCL (f32).
  • Verified correctness of FLOOR outputs vs. CPU reference implementation.

Notes

  • f16 support on SYCL GPUs may depend on driver/device capabilities (currently not supported on some Intel GPUs).
  • f32 works as expected across backends.

Implemented CPU + SYCL backends
@safranowith
Copy link
Contributor Author

// FLOOR: rounds each element down to the nearest integer.

@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 Sep 14, 2025
@jeffbolznv
Copy link
Collaborator

I don't see the changes to test-backend-ops.

@github-actions github-actions bot added the testing Everything test related label Sep 15, 2025
@safranowith
Copy link
Contributor Author

Tests have been added to the test-backend-ops file.

@CISC
Copy link
Collaborator

CISC commented Oct 16, 2025

#16613

@CISC CISC closed this Oct 16, 2025
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.

3 participants