Skip to content

Remove the unnecessary reshape during mapreduce. #2778

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

Merged
merged 1 commit into from
May 12, 2025

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented May 12, 2025

Fixes #2777

Copy link
Contributor

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/src/mapreduce.jl b/src/mapreduce.jl
index 5175a8060..24cb32317 100644
--- a/src/mapreduce.jl
+++ b/src/mapreduce.jl
@@ -226,7 +226,7 @@ function GPUArrays.mapreducedim!(f::F, op::OP, R::AnyCuArray{T},
     # we might not be able to launch all those threads to reduce each slice in one go.
     # that's why each threads also loops across their inputs, processing multiple values
     # so that we can span the entire reduction dimension using a single thread block.
-    kernel = @cuda launch=false partial_mapreduce_grid(f, op, init, Rreduce, Rother, Val(shuffle), R, A)
+    kernel = @cuda launch = false partial_mapreduce_grid(f, op, init, Rreduce, Rother, Val(shuffle), R, A)
     compute_shmem(threads) = shuffle ? 0 : threads*sizeof(T)
     kernel_config = launch_configuration(kernel.fun; shmem=compute_shmem∘compute_threads)
     reduce_threads = compute_threads(kernel_config.threads)
@@ -266,7 +266,7 @@ function GPUArrays.mapreducedim!(f::F, op::OP, R::AnyCuArray{T},
         @cuda(threads, blocks, shmem,
               partial_mapreduce_grid(f, op, init, Rreduce, Rother, Val(shuffle), partial, A))
 
-        GPUArrays.mapreducedim!(identity, op, R, partial; init=init)
+        GPUArrays.mapreducedim!(identity, op, R, partial; init = init)
     end
 
     return R

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.57%. Comparing base (bb8259f) to head (beb7d91).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2778      +/-   ##
==========================================
- Coverage   89.71%   89.57%   -0.15%     
==========================================
  Files         153      153              
  Lines       13228    13227       -1     
==========================================
- Hits        11868    11848      -20     
- Misses       1360     1379      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt merged commit 64f4a23 into master May 12, 2025
3 checks passed
@maleadt maleadt deleted the tb/mapreduce_reshape branch May 12, 2025 12:01
@kishore-nori
Copy link

Thank you very much again! Is it possible to do a release?

@maleadt
Copy link
Member Author

maleadt commented May 12, 2025

We typically don't do immediate releases for bug fixes like this (except for hotfix releases, so feel free to create a PR for that). A release is not far off, though.

@kishore-nori
Copy link

Good to know, I can wait. Will use the master till then. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sum! throws dispatch error beyond a threshold number of rows
2 participants