-
Notifications
You must be signed in to change notification settings - Fork 227
Fix Ruiz equilibration skip heuristic to also check column imbalance #1601
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
Merged
rapids-bot
merged 6 commits into
NVIDIA:main
from
mlubin:fix-ruiz-skip-column-imbalance
Jul 24, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2e172ba
Fix Ruiz equilibration skip heuristic to also check column imbalance
mlubin 9022180
Update stale comment in Ruiz equilibration skip heuristic
mlubin b8ba060
feat(lp): register qcqp_hyper_ruiz_equilibration parameter
mlubin 8d7e747
feat(lp): honor qcqp_hyper_ruiz_equilibration in barrier scaling
mlubin b9d9aa2
test(lp): tidy qcqp_hyper_ruiz_equilibration barrier tests
mlubin 378c96b
style(lp): apply clang-format to Ruiz equilibration switch
mlubin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
datasets/quadratic_programming/download_qplib_test_dataset.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #!/bin/bash | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| INSTANCES=( | ||
|
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. Are we only downloading this specific example?
Contributor
Author
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, it's the first instance from qplib that we're using in tests. |
||
| "QPLIB_8515" | ||
| ) | ||
|
|
||
| BASE_URL="https://qplib.zib.de/lp" | ||
| BASEDIR=$(dirname "$0") | ||
| OUTDIR="${BASEDIR}/qplib" | ||
|
|
||
| mkdir -p "${OUTDIR}" | ||
|
|
||
| ################################################################################ | ||
| # S3 Download Support | ||
| ################################################################################ | ||
| # Requires explicit CUOPT credentials to avoid using unintended AWS credentials: | ||
| # - CUOPT_S3_URI: Base S3 bucket root (e.g., s3://cuopt-datasets/) | ||
| # - CUOPT_AWS_ACCESS_KEY_ID: AWS access key | ||
| # - CUOPT_AWS_SECRET_ACCESS_KEY: AWS secret key | ||
| # - CUOPT_AWS_REGION (optional): AWS region, defaults to us-east-1 | ||
|
|
||
| function try_download_from_s3() { | ||
| if [ -z "${CUOPT_S3_URI:-}" ]; then | ||
| echo "WARNING: CUOPT_S3_URI not set — S3 dataset download disabled, using HTTP fallback." >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| # Require explicit CUOPT credentials to avoid accidentally using generic AWS credentials | ||
| if [ -z "${CUOPT_AWS_ACCESS_KEY_ID:-}" ]; then | ||
| echo "WARNING: CUOPT_AWS_ACCESS_KEY_ID not set — cannot download datasets from S3." >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| if [ -z "${CUOPT_AWS_SECRET_ACCESS_KEY:-}" ]; then | ||
| echo "WARNING: CUOPT_AWS_SECRET_ACCESS_KEY not set — cannot download datasets from S3." >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| if ! command -v aws &> /dev/null; then | ||
| echo "WARNING: AWS CLI not found — cannot download datasets from S3." >&2 | ||
| return 1 | ||
| fi | ||
|
|
||
| # Append ci_datasets/quadratic_programming/qplib subdirectory to base S3 URI | ||
| local s3_uri="${CUOPT_S3_URI}ci_datasets/quadratic_programming/qplib/" | ||
| echo "Downloading QPLIB datasets from S3..." | ||
|
|
||
| # Use CUOPT-specific credentials only | ||
| local region="${CUOPT_AWS_REGION:-us-east-1}" | ||
|
|
||
| # Export credentials for AWS CLI | ||
| export AWS_ACCESS_KEY_ID="$CUOPT_AWS_ACCESS_KEY_ID" | ||
| export AWS_SECRET_ACCESS_KEY="$CUOPT_AWS_SECRET_ACCESS_KEY" | ||
| # Unset session token to avoid mixing credentials | ||
| unset AWS_SESSION_TOKEN | ||
| export AWS_DEFAULT_REGION="$region" | ||
|
|
||
| # Test AWS credentials | ||
| if ! aws sts get-caller-identity &> /dev/null 2>&1; then | ||
| echo "AWS credentials invalid, skipping S3 download..." | ||
| return 1 | ||
| fi | ||
|
|
||
| local success=true | ||
| local total=${#INSTANCES[@]} | ||
| local count=0 | ||
| for instance in "${INSTANCES[@]}"; do | ||
| count=$((count + 1)) | ||
| if ! aws s3 cp "${s3_uri}${instance}.lp" "${OUTDIR}/${instance}.lp" --only-show-errors; then | ||
| success=false | ||
| fi | ||
| printf "\rProgress: %d/%d" "$count" "$total" | ||
| done | ||
| echo "" | ||
|
|
||
| if $success; then | ||
| echo "✓ Downloaded QPLIB datasets from S3" | ||
| return 0 | ||
| else | ||
| echo "S3 download failed, falling back to HTTP..." | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # Try S3 first | ||
| if try_download_from_s3; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # HTTP fallback | ||
| echo "Downloading QPLIB datasets from HTTP..." | ||
| for INSTANCE in "${INSTANCES[@]}"; do | ||
| URL="${BASE_URL}/${INSTANCE}.lp" | ||
| OUTFILE="${OUTDIR}/${INSTANCE}.lp" | ||
|
|
||
| wget -4 --tries=3 --continue --progress=dot:mega --retry-connrefused "${URL}" -O "${OUTFILE}" || { | ||
| echo "Failed to download: ${URL}" | ||
| continue | ||
| } | ||
| done | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should this be
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.
I think this is correct because we want to ignore the downloaded instances, while not ignoring the checked-in instances.