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

fix: switch to yastl thread pool #1483

Merged
merged 2 commits into from
Aug 10, 2021
Merged

fix: switch to yastl thread pool #1483

merged 2 commits into from
Aug 10, 2021

Conversation

dignifiedquire
Copy link
Contributor

This avoids all deadlocks as so far observed. Also uses a more flexible channel
for sync

Depends on filecoin-project/bellperson#204

@cryptonemo cryptonemo mentioned this pull request Jul 27, 2021
20 tasks
Copy link
Contributor

@DrPeterVanNostrand DrPeterVanNostrand left a comment

Choose a reason for hiding this comment

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

Looks good to me

@@ -59,6 +60,8 @@ lazy_static! {
/// It might be possible to relax this constraint, but in that case, only one builder
/// should actually be active at any given time, so the mutex should still be used.
static ref GPU_LOCK: Mutex<()> = Mutex::new(());

static ref THREAD_POOL: Pool = Pool::new(num_cpus::get());
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you are using num_cpus::get()whereas in bellperson you are using an env-var BELLMAN_NUM_CPUS to get the number of CPU's, should these two values always agree?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, I don't think so. The bellman var is bellman specific, and that's ok. If we had a proofs specific one, it might be different, but proofs generally targets max parallelism from the available cores.

dignifiedquire and others added 2 commits August 10, 2021 07:59
This avoids all deadlocks as so far observed. Also uses a more flexible channel
for sync
@cryptonemo
Copy link
Collaborator

Final testing is happening, but in fact, I have a machine that reliably hangs now during tests without this fix. Performance has so far been measured to be 'about the same' to 'a hair faster'. When my last test completes, assuming perf hasn't degraded after the rebases to latest, I'll merge.

@cryptonemo cryptonemo merged commit bde2c88 into master Aug 10, 2021
dignifiedquire added a commit that referenced this pull request Aug 26, 2021
dignifiedquire added a commit that referenced this pull request Aug 30, 2021
dignifiedquire added a commit that referenced this pull request Aug 30, 2021
cryptonemo pushed a commit that referenced this pull request Aug 30, 2021
* Revert "fix: switch to yastl thread pool (#1483)"

This reverts commit bde2c88.

* remove yastl in favor of rayon
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.

3 participants