-
Notifications
You must be signed in to change notification settings - Fork 25
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
Generic Reduced
handling in parallel reduce
#172
Conversation
Given a semigroup `*(::T, ::T) :: T` where `!(Reduced <: T)`, fold functions in Transducers.jl act on an "augmented" semigroup `*′(::T′, ::T′) :: T′` defined by *′(a::Reduced, _) = a *′(a::T, b::Reduced) = Reduced(a * unreduced(b)) *′(a::T, b::T) = a * b
Multi-thread benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Multi-thread benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Codecov Report
@@ Coverage Diff @@
## master #172 +/- ##
==========================================
+ Coverage 93.67% 93.75% +0.08%
==========================================
Files 19 19
Lines 1264 1265 +1
==========================================
+ Hits 1184 1186 +2
+ Misses 80 79 -1
Continue to review full report at Codecov.
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
This is not respected always; e.g., hence the commit 7a6d8ad. (But maybe it's worth reverting it in v0.5?) |
Multi-thread benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Transducers.jl/Transducers.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Reduced
handling in parallel reduce
@jw3126 Hi, just pining as I have a hunch that you might enjoy this PR :) Also, let me know if you noticed something I missed. FYI, an implementation of the "augmentation" I mentioned in the OP is this: |
@tkf your hunch was right, this looks pretty cool! BTW, are you happy with the benchmark action? Are these benchmarks "stable" or is there a lot of noise? When I tried last time (using travis) benchmarks results were not really useful. |
I think single-thread benchmarks are somewhat useful (though I agree it's still noisy). For example, it helped me find a regression here #153 (comment) and confirm that improvement works here JuliaFolds/BangBang.jl#96 (comment). Multi-thread benchmarks are much noisier especially the "findfirst" ones as their computation time is non-deterministic. They are at least useful as additional smoke tests to make it always runnable. If you are thinking about the perf tests in Setfield.jl, I think the noisiness of that one was due to the coverage and noinline flags. If you are interested in the setup of the benchmarks, see: |
This is a bug introduced while implementing generic `Reduced` handling #172. If `b` is `Reduced`, all the "private" states of transducers are stripped off. So, `combine` should be called only for the bottom reducing function. This is implemented in `combine_right_reduced`.
Mhh from what I remember, Setfield.jl benchmarks were less noisy locally then on travis. But it is a good point that flags can make benchmarks useless anyway. I am setting things up for ImageFiltering, following your instructions JuliaImages/ImageFiltering.jl#148 thanks a lot! |
Commit Message
Generic
Reduced
handling in parallel reduce (#172)Previously,
Reduced
did not have a meaningful behavior in parallelreduce
when the reducing function is notright
:This PR fixes it by properly formulating how to execute the reducing
function when combined with
Reduced
. This is done by "augmenting"the reducing function
*
:Given a semigroup
*(::T, ::T) :: T
where!(Reduced <: T)
, foldfunctions in Transducers.jl act on an "augmented" semigroup
*′(::T′, ::T′) :: T′
whereT′ = Union{T, Reduced{T}}
defined byIf
*
is a monoid with the identity elemente
, the "augmented"semigroup
*′
is also a monoid with the identity elemente′
.