Repository navigation
Sweep reduction shapes for one real and one complex element type - #810
Merged
Merged
Conversation
The reduction testsets reduce every element type in every shape, with every operator. Each new combination of element type, operator and shape compiles its own kernel and host code, which dominates the time of these testsets on back-ends where compilation is slow. The shapes choose code paths independently of the element type, so run the full list of shapes for Float32 and ComplexF32 only, and a whole-array, a dims and an empty reduction for the other element types, still with every operator. On Metal (with AcceleratedKernels#153), the mapreducedim!, mapreduce, sum prod and minimum maximum extrema testsets take 233 s instead of 372 s.
Member
Author
|
A bit ad hoc, I think @kshyatt is working on a larger redesign, but let's do the quick fix for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reduction testsets reduce every element type in every shape with every operator. Each new combination compiles its own kernels and host code, and that compilation is most of these testsets' time on back-ends where it's slow: Metal's and pocl's CI currently exceed their timeout, mostly because of a regression fixed in JuliaGPU/AcceleratedKernels.jl#153, but even with that fixed these testsets remain among the slowest.
The shapes select code paths independently of the element type (a whole-array reduction, one along some dimensions keeping others, one without reduced dimensions, an empty one), so this runs the full shape lists for Float32 and ComplexF32 only. The other element types are reduced in a whole-array, a
dimsand an empty shape, still with every operator, so per-type arithmetic keeps its coverage. The largemapreducedim!_largecases, which reach the vectorized by-block path, are unchanged.On Metal (M1, Julia 1.12, with AcceleratedKernels.jl#153), wall time in seconds:
reductions/mapreducedim!reductions/mapreducereductions/sum prodreductions/minimum maximum extrema