-
Notifications
You must be signed in to change notification settings - Fork 13.4k
SYCL: Add support for FLOOR,CEIL,ROUND and TRUNC unary operators #16613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There's a bad merge or something, you are touching a lot of unrelated code. |
Thank you for the feedback! You're absolutely right — it looks like some
unrelated changes ended up in this PR, likely due to an incorrect merge or
leftover WIP.
I'll clean it up and rebase the branch to ensure it only includes the
intended SYCL support for floor, ceil, round, and trunc.
בתאריך יום ה׳, 16 באוק׳ 2025 ב-14:23 מאת Sigbjørn Skjæret <
***@***.***>:
… *CISC* left a comment (ggml-org/llama.cpp#16613)
<#16613 (comment)>
There's a bad merge or something, you are touching a lot of unrelated code.
—
Reply to this email directly, view it on GitHub
<#16613 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BT72BRODH2N23TYYM4LQIK33X552BAVCNFSM6AAAAACJLNIRJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMJQGM4TSNRXGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
3a3dd1d
to
d7ded21
Compare
I've cleaned up the unrelated changes — let me know if everything looks
good now or if there's anything else I should fix.
בתאריך יום ה׳, 16 באוק׳ 2025 ב-15:09 מאת Sigbjørn Skjæret <
***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In ggml/include/ggml.h
<#16613 (comment)>:
> @@ -1462,7 +1494,6 @@ extern "C" {
struct ggml_context * ctx,
struct ggml_tensor * a,
struct ggml_tensor * b);
-
and here
------------------------------
In ggml/include/ggml.h
<#16613 (comment)>:
> @@ -1941,7 +1972,6 @@ extern "C" {
int p1, // padding dimension 1
int d0, // dilation dimension 0
int d1); // dilation dimension 1
-
and here
------------------------------
In ggml/include/ggml.h
<#16613 (comment)>:
> @@ -1976,7 +2006,6 @@ extern "C" {
int d1, // dilation height
int d2 // dilation depth
);
-
and here
------------------------------
In ggml/include/ggml.h
<#16613 (comment)>:
> -
+
and here
—
Reply to this email directly, view it on GitHub
<#16613 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BT72BRPLMUUIAIBI425B4ED3X6DHFAVCNFSM6AAAAACJLNIRJ6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGNBUGQ4TCNRVG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more whitespace cleanups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try again. :)
Is everything in order now? Please let me know if any further changes are
needed.
בתאריך יום ה׳, 16 באוק׳ 2025 ב-15:41 מאת Sigbjørn Skjæret <
***@***.***>:
… ***@***.**** commented on this pull request.
Let's try again. :)
------------------------------
In ggml/include/ggml.h
<#16613 (comment)>:
> +
GGML_API struct ggml_tensor * ggml_pad_ext(
struct ggml_context * ctx,
struct ggml_tensor * a,
+
int lp0,
⬇️ Suggested change
-
- GGML_API struct ggml_tensor * ggml_pad_ext(
- struct ggml_context * ctx,
- struct ggml_tensor * a,
-
- int lp0,
+
+ GGML_API struct ggml_tensor * ggml_pad_ext(
+ struct ggml_context * ctx,
+ struct ggml_tensor * a,
+ int lp0,
—
Reply to this email directly, view it on GitHub
<#16613 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BT72BRKOZBOQ5JEFNJLGXYT3X6HAPAVCNFSM6AAAAACJLNIRJ6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGNBUGYZTSMZVG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Clean up unrelated changes from previous commit
c7e5d6e
to
cdbc950
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great work!
It's first time that SYCL backend support OP ahead of other backend.
Thank you!
GGML_API struct ggml_tensor * ggml_floor( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_floor_inplace( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_ceil( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_ceil_inplace( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_round( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_round_inplace( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_trunc( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
GGML_API struct ggml_tensor * ggml_trunc_inplace( | ||
struct ggml_context * ctx, | ||
struct ggml_tensor * a); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not needed - the declarations are already in the header a few lines further down.
This PR adds support for the following unary operators in the SYCL backend:
FLOOR, CEIL, ROUND, TRUNC.
Changes include:
Implementation in element_wise.cpp and element_wise.hpp
Header updates in ggml.h
Registration in SYCL.csv
Documentation updates in docs/ops.md
Test coverage in test-backend-ops.cpp
This SYCL implementation was added following the prior addition of the same operators in the CPU backend.