Skip to content
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

SYCL: Remove misleading ggml_sycl_op_flatten function #12387

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qnixsynapse
Copy link
Contributor

@qnixsynapse qnixsynapse commented Mar 14, 2025

Original work of #11515. Tried to submit smaller change this time.

@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 Mar 14, 2025
// dd = data device
float * src0_ddf = (float *) src0->data;
float * src1_ddf = use_src1 ? (float *) src1->data : nullptr;
float * dst_ddf = (float *) dst->data;
Copy link
Contributor Author

@qnixsynapse qnixsynapse Mar 14, 2025

Choose a reason for hiding this comment

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

This function typecasted src0, src1 and dst tensors to float regardless of whatever types they were. I think we don't want this behaviour in the long run.

Copy link

@acbits acbits Mar 14, 2025

Choose a reason for hiding this comment

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

Just curious, why we don't use auto? You could avoid the casting and if the datatype changes in future, you don't have to rework it again?

Modern C++ code should use auto where ever it is possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need to create a separate pointer variable when we are passing the ggml_tensor itself anyways to the kernel OP function which contains everything needed to perform the OP?

This comment was marked as spam.

@qnixsynapse qnixsynapse force-pushed the remove_op_flatten_fn branch from f42c7bb to 73f1849 Compare March 14, 2025 12:11
@qnixsynapse qnixsynapse marked this pull request as draft March 14, 2025 12:27
@qnixsynapse qnixsynapse marked this pull request as ready for review March 14, 2025 13:19
@zunigasllc

This comment was marked as spam.

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.

3 participants