-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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: Reduce most of the compiler warnings #10748
Conversation
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.
Thanks for the PR, I overall agree with the suggested changes. I would also be in favor of adding more warning flags.
Everything is finish I guess. I did not switch to tensor->buffer from tensor->backend for checking backend buffer type in this PR since I have no way to test multi GPU(I did switch to it locally and is working okay for single GPU), nor I fixed any of the SYCL deprecation warnings. SYCL's clang compiler is not liking anonymous structures inside anonymous unions in ggml-common.h which I have not fixed. Edit: At some point, I would like to enable |
Thanks @qnixsynapse for the cleanups. LGTM, |
Hopefully this can be addressed soon. |
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.
LGTM, thanks for the changes
I know. This PR is from an end user actually. I felt bad because this backend isn't receiving the love it deserves. |
* Try to reduce some unused and typecast warnings * Reduce compiler warnings step 2 * add a newline at the end of the file * Initialize nreduce as size_t * [SYCL] Remove pragma directives from mmq.cpp * SYCL: mmq add condition to prevent blocks_per_tile_x_row variable from becoming 0 * SYCL softmax: Initialize nreduce as size_t * ggml-sycl.cpp: fix some trailing whitespaces * SYCL: remove the unused variables instead of commenting it out * SYCL poo2d kernel: set NAN for invalid pooling op * SYCL gemm.hpp: remove pragma directives * SYCL gemm.hpp: use const cast to properly support dnnl::memory * SYCL: wkv6 remove a comment * SYCL: clean comments step 2 * SYCL: clean comments and variables step 3 * SYCL: Use GGML_UNUSED for unused variables * SYCL: remove extra empty lines and a comment * Remove TODO * cleanup spaces * add a stdout for unsupported op * use sycl printf over fprintf * remove prints for CI * SYCL ggml-sycl: pool2D use sycl::nan and remove if-else block --------- Co-authored-by: Abhilash Majumder <[email protected]>
Most of the warnings are from unused variables, incorrect typecasts and empty functions. I tried to fix them in this PR.
Also added code comments wherever necessary.
SYCL backend tests passing with this change.
I think it would be better if
-Werror
flag is enabled in CI which can improve the quality of code.cc: @airMeng @NeoZhangJianyu