-
Notifications
You must be signed in to change notification settings - Fork 12
Parallel #167
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
Parallel #167
Conversation
Thank you @farhadrclass, this will be very helpful for me. SolverBenchmark.jl/src/bmark_solvers.jl Line 20 in 360eb42
with
We could also modify SolverBenchmark.jl/src/run_solver.jl Line 96 in 360eb42
with
although the second option might require a little more care on |
@MaxenceGollier |
@dpo and @MaxenceGollier the code has been updated |
@dpo the checks keep failing and says can not find cons_nln method, not sure why |
I don't see that error. Where is it? You can drop Julia 1.6 and replace it with 1.10. |
Co-authored-by: Dominique <dominique.orban@gmail.com>
The issue is the night build |
do you want me to do it in this PR or create a new one |
Hi guys! I tried to explain here #172 why the Examples fails. |
@farhadrclass
produces exceptions
I am trying to investigate what is going on here. Could you try to see if the error reproduces on your machine ?
|
@MaxenceGollier I ran the test on my machine, it passed, however some of the solvers were skipped due to some catch and expect logic, something along the line of the Hessian is not available. |
Yes all dummy solvers will fail on cutest models this is normal.
This is weird my initial guess whas that CUTEst had issued with different models being used at once (i.e decoding multiple sifs at once) I guess this is not the case if it passes on your machine. Could you send me your versioninfo ? |
@MaxenceGollier sorry for delay, didn't see the notification, julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa29 (2023-11-14 08:46 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 4 on 8 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS = 4 |
Update bmark_solvers.jl Update bmark_solvers.jl
Update test_bmark.jl Update test_bmark.jl Update test_bmark.jl
YES!
Update runtests.jl Update runtests.jl Update run_solver.jl Update run_solver.jl
@farhadrclass Please remove merge commits from here and rebase your branch to use Julia 1.10 on GitHub CI. |
Summary
The function bmark_solvers_parallel is designed to benchmark a set of solvers on a set of problems in parallel, leveraging multi-core CPUs for performance improvements on large sets of problems or computationally intensive solvers. By running in parallel, it aims to significantly reduce runtime.
Key Functionality
Parallel Execution: Running solvers concurrently across multiple threads to enhance benchmarking speed.
CPU Utilization: This function is optimized for multi-core CPUs, and users should configure the number of threads based on their machine’s capabilities. If not specified, it defaults to single-threaded execution, similar to bmark_solver().
To specify the number of threads, users can set the JULIA_NUM_THREADS environment variable before starting Julia:
Then, within the session, verify the number of threads with:
Questions and Considerations
The following are my concerns and Questions:
Examples for Documentation:
Examples should include a comparison of single-threaded versus multi-threaded runs, showing how to use bmark_solvers_parallel with different thread configurations.
Consider an example with varying numbers of solvers and problems to illustrate performance benefits.
Combining bmark_solvers_parallel and bmark_solvers:
Combining both functions could streamline the API. Adding a threads=4 default argument (with threads=1 for sequential execution) would allow users to control threading from within the function, reducing the need for environment variable configuration and simplifying usage.
Parallelizing Problems vs. Solvers:
For now, parallelizing the solvers is a good first step. In the future, should we consider parallelizing over both solvers and problems to maximize performance on systems with many cores.
Multi-CPU or Single Multi-Core CPU:
This implementation is best suited to single CPUs with multiple cores (e.g., 4-8 cores typical for desktop CPUs). Supporting multi-CPU systems would require additional architecture-specific optimizations and may be better handled as a future extension if user demand and workload complexity increase.