Update Metal reduce kernels to remove intermediate fill! - #429
PhilipFackler wants to merge 2 commits into
Conversation
|
Test this please |
|
@PhilipFackler I am checking the GPU CI for failures |
|
Test this please |
|
@PhilipFackler please check the CI failure on macOS. It's related to the number of threads. |
|
@PhilipFackler I did some digging,
|
|
Test this please |
0cfd4cc to
196b570
Compare
|
Test this please |
196b570 to
484b175
Compare
|
Test this please |
484b175 to
498dbe2
Compare
|
Test this please |
498dbe2 to
8ce391f
Compare
|
Test this please |
8ce391f to
b4c086c
Compare
|
Test this please |
b4c086c to
e1bb989
Compare
|
Test this please |
e1bb989 to
8944705
Compare
|
Test this please |
8944705 to
74181b6
Compare
|
Test this please |
2 similar comments
|
Test this please |
|
Test this please |
|
|
||
| @inline function _kernel_maxthreads(kernel_function, kargs, kname) | ||
| p_kernel = _make_kernel(kernel_function, kargs, kname) | ||
| return (p_kernel, p_kernel.maxthreads) |
There was a problem hiding this comment.
This is the correct way to do this since the maximum number of threads is set per pipeline, but you'll have to raise Metal.jl compat to 1.10.
You could also use p_kernel.pipeline.maxThreadsPerThreadgroup to avoid raising compat but that might add some overhead
1d381d4 to
22cc802
Compare
Update barrier call Fix Metal launch
22cc802 to
e7d5367
Compare
|
Test this please |
williamfgc
left a comment
There was a problem hiding this comment.
Nice job! Let's see what CI says. Just minor request to comment on oneAPI or do a separate PR. Up to you.
| max_pwr = JACC.ilog2(shmem_length) - 1 | ||
| for p in (max_pwr:-1:0) | ||
| threadgroup_barrier() | ||
| threadgroup_barrier(Metal.MemoryFlagThreadGroup) |
| kernel1 = _make_kernel(_make_kname(name, "block_reduce"), | ||
| _parallel_reduce_oneapi, Val(256), N, op, ret_inst, init, f, x...) | ||
| threads1 = oneAPI.launch_configuration(kernel1) | ||
|
|
There was a problem hiding this comment.
Either a separate PR or modify this PR's title :)
Closes #420