Skip to content

Conversation

@rgsl888prabhu
Copy link
Collaborator

@rgsl888prabhu rgsl888prabhu commented Jan 15, 2026

Description

Replace cudf Column and Buffers APIs with pylibcudf and public cuDF APIs

Issue

closes #762 579

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

Summary by CodeRabbit

  • Refactor

    • Simplified buffer handling in internal data processing pipelines
  • Chores

    • Updated copyright year notices
    • Removed unused dependencies
  • Tests

    • Added new optimization model file for testing and validation purposes

✏️ Tip: You can customize this high-level summary in your review settings.

@rgsl888prabhu rgsl888prabhu requested a review from a team as a code owner January 15, 2026 22:29
@rgsl888prabhu rgsl888prabhu self-assigned this Jan 15, 2026
@rgsl888prabhu rgsl888prabhu added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Jan 15, 2026
@rgsl888prabhu rgsl888prabhu added this to the 26.02 milestone Jan 15, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

This PR updates copyright years to 2026 across Cython files, removes deprecated cudf buffer-wrapping dependencies by simplifying buffer handling to use CUDA array interfaces directly, and adds a new MPS format file for mixed-integer programming problems.

Changes

Cohort / File(s) Change Summary
Cython copyright and dependency cleanup
python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx, python/cuopt/cuopt/routing/utils_wrapper.pyx
Updated copyright year to 2026 and removed deprecated cudf.core.column_accessor.ColumnAccessor and cudf.core.buffer.as_buffer imports. Refactored buffer handling in utils_wrapper.pyx by replacing as_buffer(DeviceBuffer.c_from_unique_ptr(move(...))) with direct DeviceBuffer.c_from_unique_ptr(move(...)) calls, relying on __cuda_array_interface__ directly for d_matrices_, d_caps_, d_service_time_, and d_demands_.
Test data
python/small_mip.mps
Added new MPS format file defining a small mixed-integer programming problem (SMALLMIP) with 5 variables, 4 constraints, and objective coefficients for optimization solver testing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR objectives state closure of issues #762 and #579, but linked issue #762 covers SonarQube setup, not cudf API migration. No requirements from issue #762 are met by the code changes. Clarify which linked issues actually relate to the cudf API migration changes. Issue #762 appears mislinked; verify the correct issue numbers are referenced.
Out of Scope Changes check ⚠️ Warning The PR includes a new MPS file (python/small_mip.mps) with 46 lines that is unrelated to the cudf API deprecation migration objective. Remove the MPS file (python/small_mip.mps) or clarify its necessity in the PR description as it appears outside the stated objective.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of replacing deprecated cudf.core APIs with pylibcudf and public cuDF APIs, which aligns with the actual code changes in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb76f7 and c448c03.

📒 Files selected for processing (3)
  • python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx
  • python/cuopt/cuopt/routing/utils_wrapper.pyx
  • python/small_mip.mps
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-01-14T00:38:38.038Z
Learnt from: chris-maes
Repo: NVIDIA/cuopt PR: 746
File: cpp/src/dual_simplex/barrier.cu:549-552
Timestamp: 2026-01-14T00:38:38.038Z
Learning: In cpp/src/dual_simplex/barrier.cu's form_adat() method within the barrier solver, the raft::copy from d_original_A_values to device_AD.x is necessary and must not be removed. This copy restores the original matrix A values before they are scaled by the diagonal matrix D (via d_inv_diag_prime). Since D changes between iterations and the scaling mutates device_AD.x, copying the original values each iteration is required for correctness.

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Refactor code duplication in solver components (3+ occurrences) into shared utilities; for GPU kernels, use templated device functions to avoid duplication

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Check that hard-coded GPU device IDs and resource limits are made configurable; abstract multi-backend support for different CUDA versions

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: wheel-build-cuopt-sh-client / 13.1.0, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.11, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.11, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.13, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.10, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.13, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.12, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.12, amd64, rockylinux8
  • GitHub Check: checks / check-style
🔇 Additional comments (2)
python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx (1)

1-1: Copyright year update looks good.

python/small_mip.mps (1)

1-46: LGTM: MPS model file appears well-formed.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
python/cuopt/cuopt/routing/utils_wrapper.pyx (1)

108-115: Do not mutate DeviceBuffer.__cuda_array_interface__ directly; copy the descriptor or pass the owner to Numba.

The pattern of getting the descriptor directly and mutating its shape and typestr modifies the DeviceBuffer's own interface state. While the mutation happens before Numba reads it (safe for the immediate call), subsequent access to the buffer's descriptor would return the modified values.

Use one of these approaches instead:

# Option 1: Copy the descriptor before mutating
desc = matrices_buf.__cuda_array_interface__.copy()
desc["shape"] = (n_vehicle_types, n_matrix_types, locations, locations)
desc["typestr"] = "f4"
matrices = cuda.from_cuda_array_interface(desc)

Or:

# Option 2: Pass owner to keep buffer alive and avoid relying on mutation
desc = matrices_buf.__cuda_array_interface__
desc["shape"] = (n_vehicle_types, n_matrix_types, locations, locations)
desc["typestr"] = "f4"
matrices = cuda.from_cuda_array_interface(desc, owner=matrices_buf)

This applies to all four locations: 108–115, 140–146, 150–156, 171–176.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb76f7 and c448c03.

📒 Files selected for processing (3)
  • python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx
  • python/cuopt/cuopt/routing/utils_wrapper.pyx
  • python/small_mip.mps
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-01-14T00:38:38.038Z
Learnt from: chris-maes
Repo: NVIDIA/cuopt PR: 746
File: cpp/src/dual_simplex/barrier.cu:549-552
Timestamp: 2026-01-14T00:38:38.038Z
Learning: In cpp/src/dual_simplex/barrier.cu's form_adat() method within the barrier solver, the raft::copy from d_original_A_values to device_AD.x is necessary and must not be removed. This copy restores the original matrix A values before they are scaled by the diagonal matrix D (via d_inv_diag_prime). Since D changes between iterations and the scaling mutates device_AD.x, copying the original values each iteration is required for correctness.

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Refactor code duplication in solver components (3+ occurrences) into shared utilities; for GPU kernels, use templated device functions to avoid duplication

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to **/*.{cu,cuh,cpp,hpp,h} : Check that hard-coded GPU device IDs and resource limits are made configurable; abstract multi-backend support for different CUDA versions

Applied to files:

  • python/cuopt/cuopt/routing/utils_wrapper.pyx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: wheel-build-cuopt-sh-client / 13.1.0, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.11, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.11, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.13, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.10, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.10, amd64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.13, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.12, arm64, rockylinux8
  • GitHub Check: wheel-build-cuopt-mps-parser / 13.1.0, 3.12, amd64, rockylinux8
  • GitHub Check: checks / check-style
🔇 Additional comments (2)
python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx (1)

1-1: Copyright year update looks good.

python/small_mip.mps (1)

1-46: LGTM: MPS model file appears well-formed.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

1 participant