Conversation
This PR adds callbacks to C API. Users can now use C API to implement get_solution and set_solution callbacks. This PR is a breaking PR that changes callback input/output pointers from device memory to host memory. We are also adding a user_data pointer for user to be more flexible inside the callbacks as well as dual bound for the B&B tree. Previously callbacks were not enabled when third party presolved was enabled. Now we are able to handle uncrushing of solutions when third party presolve is enabled on get_solution callbacks. Registering a set_solution callback disables presolve as there is no way of crushing a solution in original space to reduced space when using third party presolve. The examples and tests are modified to reflect the change. ## Summary by CodeRabbit * **New Features** * MIP incumbent get/set callbacks with optional user_data and registration; server/client flag to enable set-callback behavior. * **Behavior** * Incumbent records now include bound and user_data; solution-bound handling made thread-safe. Registering a set-solution callback may disable presolve and enables host-side incumbent injection. * **Tests** * Added tests for get-only and get-and-set flows, user_data propagation, bound reporting, and presolve interactions. * **Documentation** * Examples and docs updated to show callbacks, user_data, bound reporting, and set-callback usage. Authors: - Akif ÇÖRDÜK (https://github.com/akifcorduk) - Alice Boucher (https://github.com/aliceb-nv) Approvers: - Ramakrishnap (https://github.com/rgsl888prabhu) - Nicolas L. Guidotti (https://github.com/nguidotti) URL: NVIDIA#779
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughIntroduces MIP solution callbacks with user_data support, including C/C++ API extensions, atomic solution bound tracking, Papilo presolve integration via presolve_data_t, and corresponding Python/server updates affecting callback signatures, problem construction, and solver state management. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. 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 |
For #825
Summary by CodeRabbit
New Features
Improvements