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

add thread batch evaluator #569

Merged
merged 4 commits into from
Mar 19, 2025

Conversation

spline2hg
Copy link
Contributor

added batch evaluator that uses threading #565

@spline2hg
Copy link
Contributor Author

I have done a simple comparison between the three evaluators in thisnotebook I noticed that the thread evaluator runs comparatively faster than the process evaluators. Could this be due to lower computational demands? Additionally, is the faster re-running due to some form of caching?

@janosg
Copy link
Member

janosg commented Mar 15, 2025

Hi @spline2hg which one runs faster depends on the application. A thread based batch evaluator will be faster for IO bounds functions or very fast functions due to its lower overhead. Process based batch evaluators will be good for CPU bound long running functions. But that's the whole reason why we offer multiple batch evaluators, so everyone can pick the best for their problem 🙂

@janosg
Copy link
Member

janosg commented Mar 15, 2025

Please also add tests for your new batch evaluator. Since the tests are already parametrized this should be as simple as adding "threading" to the list here.

@spline2hg
Copy link
Contributor Author

just a small note the pathos batch evaluator is not added in the testing batch evaluator here, we could keep it this way if thats what we wanted, i have made the said changes, let me know if any more changes are required

@janosg
Copy link
Member

janosg commented Mar 17, 2025

Hi @spline2hg, thanks for the updates. I think we can leave pathos out of the tests and are going to deprecate it soon.

I enabled the CI run for your PR and there are a few failing tests. Can you look into them?

@spline2hg
Copy link
Contributor Author

hi @janosg , sorry, i might have overlooked something. i have fixed it, and it should most likely pass the ci run.

Copy link

codecov bot commented Mar 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/optimagic/batch_evaluators.py 73.52% <100.00%> (+12.65%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@janosg janosg left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@janosg janosg merged commit 02c14cd into optimagic-dev:main Mar 19, 2025
21 checks passed
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.

2 participants