-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Metal Pool 1D Kernel #16429
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?
Metal Pool 1D Kernel #16429
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.
- Need to add tests
- The implementation assumes contiguous data - either require this to be true, or extend the implementation to support non-cont data
int np; | ||
int k0; | ||
int s0; | ||
int p0; |
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 order of the arguments does not match the initialization in ggml-metal-ops.cpp
.
Also, some of these arguments like np
need to be 64-bit integers.
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. It's resolved and added tests for 1D pooling in ./test-backend-ops
which should now pass for cpu and metal
This PR adds Metal backend support for
POOL_1D
operators.Until now, only the
POOL_2D
was implemented for Metal.With this change, models relying on 1D pooling can now run fully accelerated on Apple GPUs through Metal in an analog way.
Implementation Details
Added new Metal compute kernels in
ggml-metal.metal
:kernel_pool_1d_max_f32
kernel_pool_1d_avg_f32
Implemented
ggml_metal_op_pool_1d
analogous toggml_metal_op_pool_2d
, including:ggml_metal_kargs_pool_1d
)x