Skip to content

Commit

Permalink
Merge pull request #143 from RomeoV/main
Browse files Browse the repository at this point in the history
Change default parallel executor to `ThreadedEx`
  • Loading branch information
darsnack committed Jun 12, 2023
2 parents 2677a73 + cc508f6 commit d06e191
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name = "MLUtils"
uuid = "f1d291b0-491e-4a28-83b9-f70985020b54"
authors = ["Carlo Lucibello <carlo.lucibello@gmail.com> and contributors"]
version = "0.4.2"
version = "0.4.3"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
FLoops = "cc61a311-1640-44b5-9fba-1b764f453329"
FoldsThreads = "9c68100b-dfe1-47cf-94c8-95104e173443"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ShowCases = "605ecd9f-84a6-4c9e-81e2-4798472b76a3"
Expand All @@ -25,7 +24,6 @@ Compat = "4.2"
DataAPI = "1.0"
DelimitedFiles = "1.0"
FLoops = "0.2"
FoldsThreads = "0.1"
NNlib = "0.8"
ShowCases = "0.1"
SimpleTraits = "0.9"
Expand Down
1 change: 0 additions & 1 deletion src/MLUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using Statistics
using ShowCases: ShowLimit
using FLoops: @floop
using FLoops.Transducers: Executor, ThreadedEx
using FoldsThreads: TaskPoolEx
import StatsBase: sample
using Transducers
using Tables
Expand Down
2 changes: 1 addition & 1 deletion src/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end
# since `ThreadedEx` has shown to be more performant. This may
# change in the future.
# See PR 33 https://github.com/JuliaML/MLUtils.jl/pull/33
_default_executor() = TaskPoolEx(basesize=1, background=Threads.nthreads() > 1)
_default_executor() = ThreadedEx()


# ## Internals
Expand Down
4 changes: 2 additions & 2 deletions test/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@test length(unique(X_)) == 10
end

@testset "With `TaskPoolEx`" begin
iter = eachobsparallel(collect(1:10); executor = TaskPoolEx())
@testset "With `ThreadedEx`" begin
iter = eachobsparallel(collect(1:10); executor = ThreadedEx())
@test_nowarn for i in iter end
X_ = collect(iter)
@test all(x 1:10 for x in X_)
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using SparseArrays
using Random, Statistics
using Test
using Transducers
using FoldsThreads: TaskPoolEx
using ChainRulesTestUtils: test_rrule
using Zygote: ZygoteRuleConfig
using ChainRulesCore: rrule_via_ad
Expand Down

0 comments on commit d06e191

Please sign in to comment.