Skip to content

Faster engine compile time - #316

Merged
rapids-bot[bot] merged 11 commits into
branch-25.10from
faster-build
Sep 3, 2025
Merged

Faster engine compile time#316
rapids-bot[bot] merged 11 commits into
branch-25.10from
faster-build

Conversation

@Kh4ster

@Kh4ster Kh4ster commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

This PR aims at making the compile time faster by adding several options:

  • build lp only (extracted MIP files necessary in LP), also meant we needed a skip c and python adapter option
  • put back no fetch rapids
  • put back not building test option
  • added skip routing
  • added skip write of fatbin
  • adding ccache to libcuopt target
  • added two benchmarking targets, one for LP and for MIP

@Kh4ster
Kh4ster requested review from a team as code owners August 18, 2025 15:07
@Kh4ster
Kh4ster requested review from akifcorduk, jakirkham, ramakrishnap-nv and rg20 and removed request for jakirkham August 18, 2025 15:07
@Kh4ster Kh4ster added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Aug 18, 2025
@anandhkb anandhkb added this to the 25.10 milestone Aug 18, 2025

@ramakrishnap-nv ramakrishnap-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Kh4ster for the PR, I have requested few changes and clarification.

Comment thread build.sh Outdated
SKIP_C_PYTHON_ADAPTERS=0
SKIP_TESTS_BUILD=0
SKIP_ROUTING_BUILD=0
WRITE_FATBIN=0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRITE FATBIN should be by default enabled, and disabled with option

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed!

Comment thread cpp/CMakeLists.txt
option(BUILD_TESTS "Configure CMake to build tests" ON)
option(DISABLE_OPENMP "Disable OpenMP" OFF)
option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF)
option(BUILD_LP_ONLY "Build only linear programming components, exclude routing and MIP-specific files" OFF)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing BUILD_TESTS
WRITE_FATBIN and BUILD_FATBIN is being used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build test is above. We had it already but it was not used and not working in practice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch for the BUILD_FATBIN!

Comment thread build.sh
BUILD_CI_ONLY=0
BUILD_LP_ONLY=0
SKIP_C_PYTHON_ADAPTERS=0
SKIP_TESTS_BUILD=0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dow we need to add option to skip BUILD_MIP_BENCHMARKS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep this for now and see if someone needs it

Comment thread cpp/CMakeLists.txt
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUOPT_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUOPT_CUDA_FLAGS}>"
)
if(NOT BUILD_LP_ONLY)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

Suggested change
if(NOT BUILD_LP_ONLY)
if(BUILD_LP_ONLY)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I confirm we don't want to have cuopt_cli if we are in lp_only mode since there is a call to the MIP solver

Comment thread cpp/tests/CMakeLists.txt
add_library(cuopttestutils STATIC
routing/utilities/check_constraints.cu
)
if(BUILD_TESTS)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an option where we can skip directly from cpp/CMakefiles.txt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know any. That's the only way I found to truely diable the compilation of tests

}
]=])
target_link_options(mps_parser PRIVATE "${MPS_PARSER_BINARY_DIR}/fatbin.ld")
if(WRITE_FATBIN)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this always?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? Remove the fatbin writing completly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think he is asking, by default currently this was disabled, so do we need to disable it by default might be the question. Think I also had asked this question.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you have changed it if I am not wrong.

@copy-pr-bot

copy-pr-bot Bot commented Aug 19, 2025

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Kh4ster

Kh4ster commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 0e3191a

@Kh4ster

Kh4ster commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 3a9bac7

@Kh4ster

Kh4ster commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 7bc2ce4

@Kh4ster

Kh4ster commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 2ad2c73

@copy-pr-bot

copy-pr-bot Bot commented Aug 20, 2025

Copy link
Copy Markdown

/ok to test 2ad2c73

@Kh4ster, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@Kh4ster

Kh4ster commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 33e9344

Comment thread cpp/tests/CMakeLists.txt
@Kh4ster

Kh4ster commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 3a3e7c9

instance_name=$(basename $instance)
echo "Parsing ${instance_name}.mps then solving"
${CUOPT_HOME}/cpp/build/solve_MPS_file --path ${CUOPT_HOME}/benchmarks/linear_programming/datasets/${instance_name}/${instance_name}.mps --time-limit 3600 # --solution-path $CUOPT_HOME/benchmarks/linear_programming/datasets/$instance.sol
${CUOPT_HOME}/cpp/build/solve_LP --path ${CUOPT_HOME}/benchmarks/linear_programming/datasets/${instance_name}/${instance_name}.mps --time-limit 3600 # --solution-path $CUOPT_HOME/benchmarks/linear_programming/datasets/$instance.sol

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start using cuopt_cli here? That's what Hans would be using as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as below

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you are not using any of those additional settings/options from run_pdlp right? We can still use run_pdlp for when benchmarking with those settings.

Comment thread cpp/CMakeLists.txt
target_compile_options(solve_MPS_file
option(BUILD_LP_BENCHMARKS "Build LP benchmarks" OFF)
if(BUILD_LP_BENCHMARKS)
add_executable(solve_LP ../benchmarks/linear_programming/cuopt/run_pdlp.cu)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For benchmarking, I think we should directly use the cuopt_cli, because that's what everyone will use

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I have is run_pdlp has more options that cuopt_cli

@Kh4ster

Kh4ster commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test 3a3e7c9

@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator

/ok to test 50e56b8

@Kh4ster

Kh4ster commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

/ok to test c241602

@aliceb-nv aliceb-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving :) Awesome work Nicolas, this is going to be super useful
Is it ready to merge?

@rg20

rg20 commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

/merge

1 similar comment
@rg20

rg20 commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit eac3d69 into branch-25.10 Sep 3, 2025
73 checks passed
aliceb-nv pushed a commit that referenced this pull request Sep 22, 2025
This PR aims at making the compile time faster by adding several options:

- build lp only (extracted MIP files necessary in LP), also meant we needed a skip c and python adapter option
- put back no fetch rapids
- put back not building test option
- added skip routing
- added skip write of fatbin
- adding ccache to libcuopt target
- added two benchmarking targets, one for LP and for MIP

Authors:
  - Nicolas Blin (https://github.com/Kh4ster)

Approvers:
  - Alice Boucher (https://github.com/aliceb-nv)
  - Rajesh Gandham (https://github.com/rg20)
  - Ramakrishnap (https://github.com/rgsl888prabhu)

URL: #316
@Kh4ster
Kh4ster deleted the faster-build branch October 22, 2025 07:59
jieyibi pushed a commit to yining043/cuopt that referenced this pull request Mar 26, 2026
This PR aims at making the compile time faster by adding several options:

- build lp only (extracted MIP files necessary in LP), also meant we needed a skip c and python adapter option
- put back no fetch rapids
- put back not building test option
- added skip routing
- added skip write of fatbin
- adding ccache to libcuopt target
- added two benchmarking targets, one for LP and for MIP

Authors:
  - Nicolas Blin (https://github.com/Kh4ster)

Approvers:
  - Alice Boucher (https://github.com/aliceb-nv)
  - Rajesh Gandham (https://github.com/rg20)
  - Ramakrishnap (https://github.com/rgsl888prabhu)

URL: NVIDIA#316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants