-
Notifications
You must be signed in to change notification settings - Fork 201
cuD-PDLP #1391
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?
cuD-PDLP #1391
Changes from all commits
1e0bd53
978d17b
dd0c0ef
2037eca
0f62eff
d89c85a
5534ff0
dd935c5
09eb20b
b5ebfd2
0965a60
d4d1cab
6659dd9
b2ed271
50d16ce
359d9f4
910a49a
76c0b3f
5ec7138
1f02afd
de19f38
0030a6c
172ebc2
23d0798
30881ce
c33faf2
98e0ce6
84128bf
abe4dd2
5c41497
37b1fda
57c7061
9f78d05
c484485
fc46080
6538382
a88285a
b34c5f6
b784a44
ca7d7a9
0310d50
f811bc8
4d7e2fc
7ad4606
03d1259
cdc912b
04d22cf
b41df45
a1ffe1d
c9394d9
4faa7df
61acddb
b8b59bf
7d74e74
859a299
7daa740
8a39e8c
5a3b9ce
e4739b5
1903f4b
0aacb4f
6df8145
df9f793
4c8bcd1
a8a8054
5abcd2e
0b0ce2c
91b1ae5
caea509
c6c5940
3488874
bc1f87e
b28f07d
9ae23a0
818ffcd
d3dad66
74c2d8f
cfdacd4
0de9609
1d43e8a
f3b6343
c658769
38fffaf
eb08f11
0816778
9aca029
873d167
5c74a4d
e9cad7a
12edf2d
2a35703
f5ac616
40f7cf5
c4565d1
3acd4d3
cfbb27a
5855aa8
7917f66
a286381
fb3692d
6ebdcb9
d65fca5
197df24
ed4f9e1
c193656
c42f770
c551415
83668c0
558b90d
1223b4a
57c860a
349a127
f40bcfe
7103655
80fb188
e680422
6000b75
8c67f90
1f42904
30319a0
2a14a4d
9052e31
26d7f9e
733334e
56d5580
e2a36ab
45556da
d5f1ce0
9c1e345
34196b1
758c4ad
380fd26
d8a1fa8
a77d81b
cb55b7b
1a5b941
e267972
df59a3d
368b3b3
6948bc5
1563cdc
b14ffcc
d0de284
7bb6945
67648da
81aa234
58cb774
21cdccc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # cmake-format: off | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # cmake-format: on | ||
|
|
||
| # Multi-threaded graph partitioner for distributed PDLP. | ||
| # Uses rapids_cpm_find so a system / conda / .deb install of KaMinPar (which ships a | ||
| # CMake config package exporting KaMinPar::KaMinPar) is used when available, and | ||
| # otherwise the pinned source is cloned and built via CPM. KaMinPar depends on TBB, | ||
| # which cuOpt already requires (see find_package(TBB) for papilo). | ||
| function(find_and_configure_kaminpar) | ||
| set(oneValueArgs VERSION PINNED_TAG) | ||
| cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN}) | ||
|
|
||
| # NOTE: KaMinPar is intentionally NOT added to cuopt's BUILD/INSTALL export sets. | ||
| # It is a from-source static dependency that is fully embedded into libcuopt.so and | ||
| # never installed (INSTALL_KAMINPAR OFF below). Registering it in cuopt-exports would | ||
| # both break export generation ("target KaMinPar is not in any export set") and emit a | ||
| # bogus find_dependency(KaMinPar) into the installed cuopt config. It is linked by file | ||
| # in cpp/CMakeLists.txt (mirroring PSLP) so it stays out of cuopt's export interface. | ||
| rapids_cpm_find(KaMinPar ${PKG_VERSION} | ||
| GLOBAL_TARGETS KaMinPar::KaMinPar | ||
| CPM_ARGS | ||
| GIT_REPOSITORY https://github.com/KaHIP/KaMinPar.git | ||
| GIT_TAG ${PKG_PINNED_TAG} | ||
| EXCLUDE_FROM_ALL | ||
| OPTIONS | ||
| "KAMINPAR_BUILD_APPS OFF" | ||
| "KAMINPAR_BUILD_TOOLS OFF" | ||
| "KAMINPAR_BUILD_TESTS OFF" | ||
| "KAMINPAR_BUILD_BENCHMARKS OFF" | ||
| "KAMINPAR_BUILD_EXAMPLES OFF" | ||
| "KAMINPAR_BUILD_DISTRIBUTED OFF" | ||
| # KaMinPar defaults this to ON, which injects `-march=native -mtune=native` | ||
| # (and propagates the same flag to its bundled KaHyPar / KaGen via | ||
| # KAHYPAR_ENABLE_ARCH_COMPILE_OPTIMIZATIONS / KAGEN_USE_MARCH_NATIVE). | ||
| # That bakes in whatever ISA the build host happens to support | ||
| # (e.g. AVX-512 on Sapphire Rapids), which then SIGILLs on any test | ||
| # host with a leaner CPU. Force generic codegen instead. | ||
| "KAMINPAR_BUILD_WITH_MTUNE_NATIVE OFF" | ||
| # Timers use global state and force single-threaded use of the library | ||
| # interface; disable so cuOpt can call the partitioner freely. | ||
| "KAMINPAR_ENABLE_TIMERS OFF" | ||
| # Avoid an extra hard dependency on Google Sparsehash. | ||
| "KAMINPAR_BUILD_WITH_SPARSEHASH OFF" | ||
| # cuOpt's TBB is discovered via a legacy find that only exposes TBB::tbb | ||
| # (no TBB::tbbmalloc target); disable KaMinPar's optional tbbmalloc use. | ||
| "KAMINPAR_ENABLE_TBB_MALLOC OFF" | ||
| # Large LP constraint graphs can exceed 2^31 directed edges. | ||
| "KAMINPAR_64BIT_EDGE_IDS ON" | ||
| "INSTALL_KAMINPAR OFF" | ||
| # Build KaMinPar as a STATIC library that is embedded into libcuopt.so (linked | ||
| # by file in cpp/CMakeLists.txt). The wheel build configures with | ||
| # BUILD_SHARED_LIBS=ON; without this override KaMinPar would build a separate | ||
| # libKaMinPar.so that is neither embedded nor shipped in the wheel. Forcing PIC | ||
| # is required so the static objects can be linked into the shared libcuopt.so | ||
| # (KaMinPar's KaMinParCommon OBJECT lib otherwise lacks -fPIC). | ||
| "BUILD_SHARED_LIBS OFF" | ||
| "CMAKE_POSITION_INDEPENDENT_CODE ON" | ||
| ) | ||
|
|
||
| if(KaMinPar_ADDED) | ||
| message(VERBOSE "CUOPT: Using KaMinPar located in ${KaMinPar_SOURCE_DIR}") | ||
| # KaMinPar's public header pulls in <tbb/global_control.h>. On older TBB releases | ||
| # that header is gated behind TBB_PREVIEW_GLOBAL_CONTROL (KaMinPar upstream assumes a | ||
| # newer oneTBB and never defines it). Define it on KaMinParCommon PUBLIC so it | ||
| # propagates to all KaMinPar translation units (KaMinPar links KaMinParCommon PUBLIC). | ||
| # Harmless on newer oneTBB where global_control is no longer a preview feature. | ||
| # Also force PIC on every KaMinPar target (the KaMinParCommon OBJECT library does not | ||
| # reliably inherit CMAKE_POSITION_INDEPENDENT_CODE) so the static archive can be | ||
| # embedded into the shared libcuopt.so. | ||
| foreach(_kaminpar_tgt KaMinParCommon KaMinPar KaMinParIO) | ||
| if(TARGET ${_kaminpar_tgt}) | ||
| set_target_properties(${_kaminpar_tgt} PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
| endif() | ||
| endforeach() | ||
| if(TARGET KaMinParCommon) | ||
| target_compile_definitions(KaMinParCommon PUBLIC TBB_PREVIEW_GLOBAL_CONTROL) | ||
| endif() | ||
| else() | ||
| message(VERBOSE "CUOPT: Using KaMinPar located in ${KaMinPar_DIR}") | ||
| endif() | ||
| endfunction() | ||
|
|
||
| find_and_configure_kaminpar(VERSION 3.7.3 PINNED_TAG v3.7.3) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,6 +307,23 @@ class pdlp_solver_settings_t { | |
| presolver_t presolver{presolver_t::Default}; | ||
| bool dual_postsolve{true}; | ||
| int num_gpus{1}; | ||
| // Dispatch the LP to the multi-GPU distributed PDLP engine | ||
| bool use_distributed_pdlp{false}; | ||
| // Number of GPUs to use specifically for distributed PDLP (use_distributed_pdlp=true). | ||
| // -1 means auto-detect | ||
| int distributed_pdlp_num_gpus{-1}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this is the right parameter to use |
||
| std::string multi_gpu_partition_file{""}; | ||
| // If non-empty, the partition computed for distributed PDLP is written to this | ||
| // path (one part-id per line) right after partitioning. The file can be fed | ||
| // back via multi_gpu_partition_file. | ||
| std::string multi_gpu_export_partition_file{""}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would be the usage of such parameter for a user? I'm not sure I undestand |
||
| // Which graph partitioner distributed PDLP uses. One of: | ||
| // "auto" - 1 GPU => Dummy; otherwise KaMinPar | ||
| // "dummy" - round-robin, no graph (trivial) | ||
| // "kaminpar" - multi-threaded KaMinPar | ||
| std::string distributed_pdlp_partitioner{"auto"}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would make more sense for this to be an enum with specific values rather than a string |
||
| // Set to true inside the shards | ||
| bool is_distributed_sub_pdlp{false}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is more an internal parameter that user shouldn't touch and know about I think it should leave in the pdlp_solver_object and then you would do pdlp_solver_object.set_distributed_sub_pdlp() on it so that this pdlp_solver_object knows it's being called within a multi GPU context |
||
| method_t method{method_t::Concurrent}; | ||
| bool inside_mip{false}; | ||
| // For concurrent termination | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.