-
Notifications
You must be signed in to change notification settings - Fork 12.2k
OpenCL: Add concat, tsembd, upscale, tanh, pad and repeat #13840
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
Conversation
Thank you @rmatif for the PR. I missed your previous one. Taking a looking into the PR now. |
y_val_ptr = (global float *)(dst_base + (ulong)current_i3*d_nb3 + (ulong)current_i2*d_nb2 + (ulong)current_i1*d_nb1 + (ulong)current_i0*d_nb0); | ||
*y_val_ptr = *x_val_ptr; | ||
} | ||
} |
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.
Can you add a newline at the end of the file?
current_dst_el_ptr[k] = current_src_el_ptr[k]; | ||
} | ||
} | ||
} |
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.
Can you add a newline at the end of the file?
local_arg = local_timestep_val * local_freq; | ||
local_embed_data_ptr[local_j] = cos(local_arg); | ||
local_embed_data_ptr[local_j + local_half_dim] = sin(local_arg); | ||
} |
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.
Can you add a newline at the end of the file?
*dst_val_ptr = tanh(*src_val_ptr); | ||
} | ||
} | ||
} |
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.
Can you add a newline at the end of the file?
val_d * dx * dy; | ||
|
||
dst_base[index] = result; | ||
} |
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.
Can you add a newline at the end of the file?
@@ -0,0 +1,63 @@ | |||
#pragma OPENCL EXTENSION cl_khr_fp16 : enable |
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.
Can you rename this file to tanh.cl
? We have been putting each unary op in separate files. This also should be more friendly to compilers on A6x.
ggml/src/ggml-opencl/ggml-opencl.cpp
Outdated
@@ -1988,6 +2150,17 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te | |||
case GGML_OP_NORM: | |||
case GGML_OP_RMS_NORM: | |||
return true; | |||
case GGML_OP_REPEAT: |
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.
The indention seems off for this case
.
@lhez Thanks for the review, can you check again now please ? |
I think it looks good. |
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.
Nice!. Thanks for adding more kernels!
…3840) * add concat, pad, repeat, tsembd, tanh, upscale * small fixes
The previous PR had a lot of conflicts since group norm was added in this commit: a3c3084, and I messed up some git commands.
The ops in the title are now added, and with these additions, OpenCL (hopefully) supports all the ops used in stable-diffusion.cpp.
All tests passed using test-backend-ops. Tested on: Adreno 750, 740, 730.
@lhez @max-krasnyansky