-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ggml: fix cuda kernel launch configuration for k_compute_batched_ptrs to support large batch #16744
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
|
Same comment for this one. Please add a backend test that hits this case. The bug may exist in other backends, too. |
|
The backend test has been added. |
tests/test-backend-ops.cpp
Outdated
|
|
||
| // test cases with large batch size | ||
| test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16, 8, 256, {1024, 2}, {1, 1})); | ||
| test_cases.emplace_back(new test_mul_mat(type_a, type_b, 16, 8, 256, {4096, 1}, {1, 1})); |
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.
Wouldn't a batch size of 1024 be enough to test this?
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.
1024 happens to be the maximum number of threads, so it won’t trigger any issues. I’ve now changed the batch size to 1536, which is smaller than before.
Co-authored-by: Johannes Gäßler <[email protected]>
|
@JohannesGaessler merge? |
This PR fixes an invalid CUDA kernel launch issue for
k_compute_batched_ptrswhenne12orne13is large.dim3 block(ne13, ne12), which can exceed the maximum threads per block (1024) and triggercudaErrorInvalidConfiguration.