Skip to content
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

Change default parallel executor to ThreadedEx #143

Merged
merged 3 commits into from
Jun 12, 2023
Merged

Conversation

RomeoV
Copy link
Contributor

@RomeoV RomeoV commented Feb 8, 2023

Closes #142

@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2023

Codecov Report

Merging #143 (cc508f6) into main (ff2fcc1) will increase coverage by 0.21%.
The diff coverage is 68.42%.

❗ Current head cc508f6 differs from pull request most recent head 112315d. Consider uploading reports for the commit 112315d to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   88.28%   88.50%   +0.21%     
==========================================
  Files          15       15              
  Lines         589      600      +11     
==========================================
+ Hits          520      531      +11     
  Misses         69       69              
Impacted Files Coverage Δ
src/MLUtils.jl 100.00% <ø> (+100.00%) ⬆️
src/obstransform.jl 82.69% <57.14%> (-1.40%) ⬇️
src/parallel.jl 94.82% <100.00%> (ø)
src/utils.jl 90.27% <100.00%> (+0.20%) ⬆️

... and 1 file with indirect coverage changes

@ToucheSir
Copy link
Contributor

We would need to make sure this doesn't reintroduce the problem #80 was trying to address.

@lorenzoh
Copy link
Contributor

As mentioned in #142, let's do this.

Before merging, I'd like to add the following comments:

  • Since ThreadedEx is part of Transducers itself, we could drop the dependency on FoldsThreads.jl
  • Have you played around with basesize? My experience was that not setting basesize leads to some threads some being starved in the end as the work is split up evenly between threads, but am not sure how this applies to ThreadedEx

In any case, some up-to-date benchmarks comparing the two would be nice, but seeing the mounting issues with TaskPoolEx, we can leave these points to a future PR.

@RomeoV
Copy link
Contributor Author

RomeoV commented Jun 12, 2023

Sorry, didn't realize this was waiting for my input.

  1. I removed the dependency on FoldsThreads.jl
  2. I haven't played around with the basesize, but the default choice of num_elements / num_threads seems very reasonable for largers datasets where each workload is pretty much equal.

My experience was that not setting basesize leads to some threads some being starved in the end as the work is split up evenly between threads, but am not sure how this applies to ThreadedEx.

I haven't seen that personally. Perhaps for specific workloads one can come up with a more optimized basesize, but I don't think we can come up with a better default than what is currently the default.

@RomeoV
Copy link
Contributor Author

RomeoV commented Jun 12, 2023

Some checks related to printing fail on julia-nightly on Ubuntu. I'm going to go out on a limb and say that's due to something in Julia and not in the PR.

Copy link
Member

@darsnack darsnack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you adjust the version?

@RomeoV RomeoV force-pushed the main branch 2 times, most recently from cc508f6 to 112315d Compare June 12, 2023 12:41
@RomeoV
Copy link
Contributor Author

RomeoV commented Jun 12, 2023

Done. However, I'm a bit confused why the git diff here on github shows going from version 0.4.0 to 0.4.3, even though the master branch is already on 0.4.2 (?).
Anyways, I think it should be correct now.

@darsnack
Copy link
Member

Okay now it is showing conflicts (presumably because you touched a file changed on main). Can you rebase?

@RomeoV
Copy link
Contributor Author

RomeoV commented Jun 12, 2023

Done. Thanks for bearing with me!

@darsnack darsnack merged commit d06e191 into JuliaML:main Jun 12, 2023
12 of 14 checks passed
@darsnack
Copy link
Member

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.

TaskPoolEx leads to unreliable Dataloaders
5 participants