Skip to content

Commit adda2fc

Browse files
authored
Merge pull request #2 from GAMS-dev/cuopt-v25.10
Update link for cuOpt version 25.10
2 parents f81a454 + 4cfbefd commit adda2fc

4 files changed

Lines changed: 59 additions & 11 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
- name: Set up python virtual environment with NVIDIA dependencies
2525
run: |
2626
mkdir -p venvs
27-
python -m venv venvs/cu-opt
28-
bash -c "source venvs/cu-opt/bin/activate && \
27+
python -m venv venvs/cu12
28+
bash -c "source venvs/cu12/bin/activate && \
2929
pip install --upgrade pip -qq && \
30-
pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ cuopt-cu12==25.10.0a47 nvidia-cuda-runtime-cu12==12.8.* nvidia-nvjitlink-cu12 -qq"
30+
pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/ cuopt-cu12==25.10.0 nvidia-cuda-runtime-cu12==12.8.* nvidia-nvjitlink-cu12 -qq"
3131
3232
- name: Download and extract latest GAMS distribution
3333
run: |
@@ -39,9 +39,12 @@ jobs:
3939
- name: Compile gmscuopt
4040
run: |
4141
export GAMSCAPI="gamsdist/apifiles/C/api"
42-
export CUOPT="venvs/cu-opt/lib/python3.12/site-packages/libcuopt"
43-
export JITLINK="venvs/cu-opt/lib/python3.12/site-packages/nvidia/nvjitlink/lib"
42+
export CUOPT="venvs/cu12/lib/python3.12/site-packages/libcuopt"
43+
export JITLINK="venvs/cu12/lib/python3.12/site-packages/nvidia/nvjitlink/lib"
44+
export CUOPT_VERSION="`cat "$CUOPT/VERSION"`"
45+
export CUOPT_HASH="`cat "$CUOPT/GIT_COMMIT"`"
4446
gcc -Wall gmscuopt.c -o gmscuopt.out \
47+
-DCUOPT_VERSION=\"$CUOPT_VERSION\" -DCUOPT_HASH=\"$CUOPT_HASH\" \
4548
-I $GAMSCAPI $GAMSCAPI/gmomcc.c $GAMSCAPI/optcc.c $GAMSCAPI/gevmcc.c \
4649
-I $CUOPT/include $JITLINK/libnvJitLink.so.12 -L $CUOPT/lib64 -lcuopt
4750
patchelf --set-rpath \$ORIGIN gmscuopt.out
@@ -51,11 +54,19 @@ jobs:
5154
mkdir release
5255
cp gmscuopt.out release/
5356
cp assets/* release/
54-
cp venvs/cu-opt/lib/python3.12/site-packages/libcuopt/lib64/libcuopt.so release/
55-
cp venvs/cu-opt/lib/python3.12/site-packages/libcuopt/lib64/libmps_parser.so release/
56-
cp venvs/cu-opt/lib/python3.12/site-packages/libcuopt_cu12.libs/libgomp-5fc1ad8c.so.1.0.0 release/
57-
cp venvs/cu-opt/lib/python3.12/site-packages/rapids_logger/lib64/librapids_logger.so release/
58-
cp venvs/cu-opt/lib/python3.12/site-packages/librmm/lib64/librmm.so release/
57+
cp venvs/cu12/lib/python3.12/site-packages/libcuopt/lib64/libcuopt.so release/
58+
cp venvs/cu12/lib/python3.12/site-packages/libcuopt/lib64/libmps_parser.so release/
59+
cp venvs/cu12/lib/python3.12/site-packages/libcuopt_cu12.libs/libgomp-*.so.1.0.0 release/
60+
cp venvs/cu12/lib/python3.12/site-packages/rapids_logger/lib64/librapids_logger.so release/
61+
cp venvs/cu12/lib/python3.12/site-packages/librmm/lib64/librmm.so release/
62+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/cu12/lib/libcudss.so.0 release/
63+
cp venvs/cu12/lib/python3.12/site-packages/libcuopt_cu12.libs/libtbb-*.so.2 release/
64+
cp venvs/cu12/lib/python3.12/site-packages/libcuopt_cu12.libs/libtbbmalloc-*.so.2 release/
65+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/cusolver/lib/libcusolver.so.11 release/
66+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/cublas/lib/libcublas.so.12 release/
67+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/cublas/lib/libcublasLt.so.12 release/
68+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/nvjitlink/lib/libnvJitLink.so.12 release/
69+
cp venvs/cu12/lib/python3.12/site-packages/nvidia/curand/lib/libcurand.so.10 release/
5970
6071
- name: Upload artifact to GitHub Actions (always)
6172
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/venv/*
2+
/release/*
3+
trnsport.gms
4+
trnsport.lst
5+
gmscuopt.out
6+
cuopt.opt

assets/optcuopt.def

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
*
22
* optcuopt.def
33
*
4-
presolve boolean 0 0 1 1 Controls whether presolve is enabled. Presolve can reduce problem size and improve solve time. Enabled by default for MIP, disabled by default for LP.
4+
solution_file string 1 "" 1 1 Controls the name of a file where cuOpt should write the solution
5+
user_problem_file string 1 "" 1 1 Controls the name of a file where cuOpt should write the user problem
56
num_cpu_threads integer 0 -1 -1 maxint 1 1 Controls the number of CPU threads used in the LP and MIP solvers (default GAMS Threads)
67
time_limit integer 0 maxint 0 maxint 1 1 Controls the time limit in seconds after which the solver will stop and return the current solution (default GAMS ResLim)
78
prob_read string 1 "" 1 1 Reads a problem from an MPS file
@@ -10,10 +11,12 @@ pdlp_solver_mode enumint 0 1 1 2 Controls the mode under which PDLP should opera
1011
1 1 stable2
1112
2 1 methodical1
1213
3 1 fast1
14+
4 1 stable3
1315
method enumint 0 0 1 2 Controls the method to solve the linear programming problem
1416
0 1 concurrent
1517
1 1 pdlp
1618
2 1 dual_simplex
19+
3 1 method_barrier
1720
iteration_limit integer 0 maxint 0 maxint 1 2 Controls the iteration limit after which the solver will stop and return the current solution (default GAMS IterLim)
1821
absolute_dual_tolerance double 0 0.0001 0 maxdouble 1 2 Controls the absolute dual tolerance used in PDLP's dual feasibility check
1922
relative_dual_tolerance double 0 0.0001 0 maxdouble 1 2 Controls the relative dual tolerance used in PDLP's dual feasibility check
@@ -29,6 +32,30 @@ per_constraint_residual boolean 0 0 1 2 Controls whether PDLP should compute the
2932
save_best_primal_so_far boolean 0 0 1 2 Controls whether PDLP should save the best primal solution so far
3033
first_primal_feasible boolean 0 0 1 2 Controls whether PDLP should stop when the first primal feasible solution is found
3134
crossover boolean 0 0 1 2 Controls whether PDLP should crossover to a basic solution after an optimal solution is found
35+
folding enumint -1 1 1 2 Controls whether to fold the linear program. Folding can reduce problem size by exploiting symmetry in the problem
36+
-1 1 automatic (default) cuOpt decides whether to fold based on problem characteristics
37+
0 1 disable folding
38+
1 1 force folding to run
39+
augmented enumint -1 1 1 2 Controls which linear system to solve in the barrier method
40+
-1 1 automatic (default) cuOpt selects the best linear system to solve
41+
0 1 solve the ADAT system (normal equations)
42+
1 1 solve the augmented system
43+
dualize enumint -1 1 1 2 Controls whether to dualize the linear program in presolve. Dualizing can improve solve time for problems, with inequality constraints, where there are more constraints than variables.
44+
-1 1 automatic (default) cuOpt decides whether to dualize based on problem characteristics
45+
0 1 don't attempt to dualize
46+
1 1 force dualize
47+
ordering enumint -1 1 1 2 Controls the ordering algorithm used by cuDSS for sparse factorizations. The ordering can significantly impact solver run time
48+
-1 1 automatic (default) cuOpt selects the best ordering
49+
0 1 cuDSS default ordering
50+
1 1 AMD (approximate minimum degree) ordering
51+
barrier_dual_initial_point enumint -1 1 1 2 Controls the method used to compute the dual initial point for the barrier solver. The choice of initial point will affect the number of iterations performed by barrier
52+
-1 1 automatic (default) cuOpt selects the best method
53+
0 1 use an initial point from a heuristic approach based on the paper "On Implementing Mehrotra’s Predictor–Corrector Interior-Point Method for Linear Programming" (SIAM J. Optimization, 1992) by Lustig, Martsten, Shanno.
54+
1 1 use an initial point from solving a least squares problem that minimizes the norms of the dual variables and reduced costs while statisfying the dual equality constraints.
55+
eliminate_dense_columns boolean 1 0 1 2 Controls whether to eliminate dense columns from the constraint matrix before solving. Eliminating dense columns can improve performance by reducing fill-in during factorization. However, extra solves must be performed at each iteration
56+
cudss_deterministic boolean 0 0 1 2 Controls whether cuDSS operates in deterministic mode. Deterministic mode ensures reproducible results across runs but may be slower
57+
presolve boolean 0 0 1 1 Controls whether presolve is enabled. Presolve can reduce problem size and improve solve time. Enabled by default for MIP, disabled by default for LP.
58+
dual_postsolve boolean 1 0 1 2 Controls whether dual postsolve is enabled. Disabling dual postsolve can improve solve time at the expense of not having access to the dual solution. Enabled by default for LP when presolve is enabled. This is not relevant for MIP problems
3259
mip_absolute_tolerance double 0 0.0001 0 maxdouble 1 3 Controls the MIP absolute tolerance
3360
mip_relative_tolerance double 0 0.0001 0 maxdouble 1 3 Controls the MIP relative tolerance
3461
mip_integrality_tolerance double 0 1e-05 0 maxdouble 1 3 Controls the MIP integrality tolerance

gmscuopt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ main (int argc, char *argv[])
5151
goto GAMSDONE;
5252
}
5353

54+
#if defined(CUOPT_VERSION) && defined(CUOPT_HASH)
55+
printOut(gev, "GAMS/cuOpt link was built against cuOpt version: %s, git hash: %s\n", CUOPT_VERSION, CUOPT_HASH);
56+
#endif
57+
5458
status = gmoRegisterEnvironment(gmo, gev, msg);
5559
if (status) {
5660
printOut(gev, "Could not register GEV: %s\n", msg);

0 commit comments

Comments
 (0)