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

Allow NN ensemble to be used for parallel eval #515

Merged
merged 4 commits into from
Aug 17, 2021

Conversation

osma
Copy link
Member

@osma osma commented Aug 17, 2021

Fixes #453 by introducing a parallel parameter to project.initialize() and backend.initialize() methods. Setting it to True warns the project/backend that it will be used for parallel execution. The NN ensemble heeds this warning and delays loading the TensorFlow model until later, avoiding the lockup that otherwise happens.

Some unscientific benchmark results for the eval command examples in #453 using i5-7200U:

- user time (s) wall time (m:s)
Before PR 279 4:42
jobs=1 251 4:11
jobs=2 329 2:47
jobs=0 413 2:04

Opening draft PR for QA tool results.

@osma osma added the bug label Aug 17, 2021
@osma osma added this to the 0.54 milestone Aug 17, 2021
@osma osma self-assigned this Aug 17, 2021
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #515 (e47d1c7) into master (845985a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #515      +/-   ##
==========================================
+ Coverage   99.51%   99.53%   +0.01%     
==========================================
  Files          82       82              
  Lines        5822     5831       +9     
==========================================
+ Hits         5794     5804      +10     
+ Misses         28       27       -1     
Impacted Files Coverage Δ
annif/backend/backend.py 100.00% <100.00%> (ø)
annif/backend/dummy.py 100.00% <100.00%> (ø)
annif/backend/ensemble.py 100.00% <100.00%> (ø)
annif/backend/fasttext.py 97.82% <100.00%> (ø)
annif/backend/mllm.py 100.00% <100.00%> (ø)
annif/backend/nn_ensemble.py 99.25% <100.00%> (+0.01%) ⬆️
annif/backend/omikuji.py 98.76% <100.00%> (ø)
annif/backend/pav.py 98.90% <100.00%> (ø)
annif/backend/stwfsa.py 100.00% <100.00%> (+1.56%) ⬆️
annif/backend/svc.py 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 845985a...e47d1c7. Read the comment docs.

@osma osma marked this pull request as draft August 17, 2021 13:21
@sonarcloud
Copy link

sonarcloud bot commented Aug 17, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma marked this pull request as ready for review August 17, 2021 13:30
@osma osma requested a review from juhoinkinen August 17, 2021 13:31
Copy link
Member

@juhoinkinen juhoinkinen left a comment

Choose a reason for hiding this comment

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

Good to have this fixed so nicely :)

@osma osma merged commit 2dc30d3 into master Aug 17, 2021
@osma osma deleted the issue453-fix-parallel-nn-ensemble branch August 17, 2021 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallelized eval of nn_ensemble projects hangs
2 participants