-
Notifications
You must be signed in to change notification settings - Fork 115
Fixed early termination in CMS750_4 + Fixed hard-coded number of threads
#786
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughReads PDLP objective as solver-space and derives user-space for callbacks; adds user→solver objective conversion API; makes presolve thread count configurable with OpenMP and binds per-thread pools to that count; guards B&B root assignment during runs; conditionally suppresses LP solver logs during MIP solves. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| auto user_obj = problem_ptr->get_user_obj_from_solver_obj(lp_result.get_objective_value()); | ||
| // PDLP returns user-space objective (it applies objective_scaling_factor internally) | ||
| auto user_obj = lp_result.get_objective_value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this uniform across the solvers? Or just PDLP behaves differently than others? We need to standardize this.
…ed concurrent solution when the B&B is already running. moved number of threads in the probing cache to the setting struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cpp/src/mip/presolve/probing_cache.cu (1)
859-910: Add defensive validation fornum_threadsbefore pool sizing and parallel launchThe code assumes
settings.num_threadsis always positive, but sincesettings_tis a public struct, external code can setnum_threadsto 0 (or modify it between initialization and use). If 0 is assigned:
modification_vector_poolandsubstitution_vector_poolwould have size 0#pragma omp parallel num_threads(0)produces undefined behavior (OpenMP spec)- If threads spawn despite 0,
thread_idxfromomp_get_thread_num()will exceed pool bounds, causing out-of-bounds accessAdd a defensive clamp before sizing the pools:
Proposed fix
- const size_t num_threads = bound_presolve.settings.num_threads; + const i_t requested_threads = bound_presolve.settings.num_threads; + size_t num_threads = + requested_threads > 0 ? static_cast<size_t>(requested_threads) + : static_cast<size_t>(omp_get_max_threads()); + if (num_threads == 0) { num_threads = 1; }Aligns with multithreading safety guidelines to prevent resource exhaustion and thread safety violations.
CMS750_4due to an incorrect root objective from the PDLP. It provides an objective in user space and B&B expects the objective in the solver space.cuopt_cli. Now the number of threads in the probing cache can be controlled by thebounds_update::settings_t.Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.