ggml-webgpu: fix supports_op condition for GET_ROWS - #28978
Conversation
|
@ServeurpersoCom Can you take a quick look at this when you have time? thanks! |
ServeurpersoCom
left a comment
There was a problem hiding this comment.
LGTM on the direction, the guard from #28253 is no longer needed after #28382 and falling back to the scalar path on GPU is better than CPU.
One remaining hole in the vectorized path: vec4_aligned only checks the offsets, but the shader also divides the src strides by 4, so a F32 view whose row stride is wider than ne0 still takes the vec4 path and reads wrong data. Checking the src strides in vec4_aligned as well fixes it, tested locally on Dawn. This predates the PR, the old guard only checked the offset too.
The existing vs0 tests only use whole row offsets on vec4 friendly shapes, so they never reach the non aligned path.
ggerganov
left a comment
There was a problem hiding this comment.
The test-backend-ops.cpp changes are OK
|
@ServeurpersoCom I also added a new |
Overview
This PR removes the temporary
supports_oplogic for GET_ROWS in the WebGPU backend, which was needed for #28253 to pass the ops test.PR #28382 adds the actual kernel change for that, so the temporary logic can now be removed. But vectorized alignment is not guaranteed by
ggml_webgpu_tensor_align_offset, so this PR also adds an alignment check to the condition for the vectorized path.The get_rows test coverage of test-backend-ops is not changed (207/207 passed)
Requirements