From e4a29d36f8655e4af995e383f4d91f4f1f403676 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 15 Jan 2026 16:27:10 -0600 Subject: [PATCH 1/3] Move away from cudf.core usage --- .../waypoint_matrix_wrapper.pyx | 1 - python/cuopt/cuopt/routing/utils_wrapper.pyx | 17 ++----- python/small_mip.mps | 46 +++++++++++++++++++ 3 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 python/small_mip.mps diff --git a/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx b/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx index 1c959a593..a6279af2e 100644 --- a/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx +++ b/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx @@ -20,7 +20,6 @@ import numpy as np from numba import cuda import cudf -from cudf.core.column_accessor import ColumnAccessor from cuopt.utilities import series_from_buf diff --git a/python/cuopt/cuopt/routing/utils_wrapper.pyx b/python/cuopt/cuopt/routing/utils_wrapper.pyx index 659ac7a73..cc13de508 100644 --- a/python/cuopt/cuopt/routing/utils_wrapper.pyx +++ b/python/cuopt/cuopt/routing/utils_wrapper.pyx @@ -21,7 +21,6 @@ import numpy as np from numba import cuda import cudf -from cudf.core.buffer import as_buffer from libcpp.utility cimport move @@ -106,9 +105,7 @@ def generate_dataset(locations=100, asymmetric=True, min_demand=cudf.Series(), coordinates['x'] = series_from_buf(x_pos, pa.float32()) coordinates['y'] = series_from_buf(y_pos, pa.float32()) - matrices_buf = as_buffer( - DeviceBuffer.c_from_unique_ptr(move(g_ret.d_matrices_)) - ) + matrices_buf = DeviceBuffer.c_from_unique_ptr(move(g_ret.d_matrices_)) desc = matrices_buf.__cuda_array_interface__ desc["shape"] = (n_vehicle_types, n_matrix_types, locations, locations) desc["typestr"] = "f4" @@ -140,9 +137,7 @@ def generate_dataset(locations=100, asymmetric=True, min_demand=cudf.Series(), ) fleet_size = vehicles["earliest_time"].shape[0] - capacities_buf = as_buffer( - DeviceBuffer.c_from_unique_ptr(move(g_ret.d_caps_)) - ) + capacities_buf = DeviceBuffer.c_from_unique_ptr(move(g_ret.d_caps_)) desc = capacities_buf.__cuda_array_interface__ desc["shape"] = (dim, fleet_size) desc["typestr"] = "u2" @@ -152,9 +147,7 @@ def generate_dataset(locations=100, asymmetric=True, min_demand=cudf.Series(), vehicles["capacity_" + str(i)] = capacities[i] # Fleet order constraints - service_times_buf = as_buffer( - DeviceBuffer.c_from_unique_ptr(move(g_ret.d_service_time_)) - ) + service_times_buf = DeviceBuffer.c_from_unique_ptr(move(g_ret.d_service_time_)) desc = service_times_buf.__cuda_array_interface__ desc["shape"] = (fleet_size, locations) desc["typestr"] = "i4" @@ -175,9 +168,7 @@ def generate_dataset(locations=100, asymmetric=True, min_demand=cudf.Series(), orders["earliest_time"] = series_from_buf(earliest_time, pa.int32()) orders["latest_time"] = series_from_buf(latest_time, pa.int32()) - demands_buf = as_buffer( - DeviceBuffer.c_from_unique_ptr(move(g_ret.d_demands_)) - ) + demands_buf = DeviceBuffer.c_from_unique_ptr(move(g_ret.d_demands_)) desc = demands_buf.__cuda_array_interface__ desc["shape"] = (dim, locations) desc["typestr"] = "i2" diff --git a/python/small_mip.mps b/python/small_mip.mps new file mode 100644 index 000000000..e7feac318 --- /dev/null +++ b/python/small_mip.mps @@ -0,0 +1,46 @@ +NAME SMALLMIP +ROWS + N OBJ + L c1 + G c2 + E R2 + L R3 + G c5 +COLUMNS + MARK0001 'MARKER' 'INTORG' + x1 c1 1 + x1 c2 2 + x1 c5 1 + x1 OBJ 2 + x2 c1 1 + x2 R2 1 + x2 c5 1 + x2 OBJ 3 + x3 c1 1 + x3 c2 1 + x3 c5 1 + x3 OBJ 1 + x4 c2 -1 + x4 R3 1 + x4 c5 1 + x4 OBJ 1 + x5 R2 3 + x5 R3 1 + x5 c5 1 + x5 OBJ 4 + MARK0001 'MARKER' 'INTEND' +RHS + RHS1 c1 10 + RHS1 c2 3 + RHS1 R2 7 + RHS1 R3 8 + RHS1 c5 5 +BOUNDS + LO BOUND1 x1 0 + LO BOUND1 x2 0 + UP BOUND1 x2 4 + LO BOUND1 x3 0 + UP BOUND1 x3 6 + LO BOUND1 x4 0 + LO BOUND1 x5 0 +ENDATA From c448c033c4efae4974a70c2fd009246afa3bcd02 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 15 Jan 2026 16:28:05 -0600 Subject: [PATCH 2/3] style fix --- python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx | 2 +- python/cuopt/cuopt/routing/utils_wrapper.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx b/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx index a6279af2e..68222a133 100644 --- a/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx +++ b/python/cuopt/cuopt/distance_engine/waypoint_matrix_wrapper.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # noqa +# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # noqa # SPDX-License-Identifier: Apache-2.0 # cython: profile=False diff --git a/python/cuopt/cuopt/routing/utils_wrapper.pyx b/python/cuopt/cuopt/routing/utils_wrapper.pyx index cc13de508..aa0800cf1 100644 --- a/python/cuopt/cuopt/routing/utils_wrapper.pyx +++ b/python/cuopt/cuopt/routing/utils_wrapper.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # noqa +# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # noqa # SPDX-License-Identifier: Apache-2.0 From 21257e628eb3c071c2d23b1a3e6eebcf971ac913 Mon Sep 17 00:00:00 2001 From: Ramakrishnap <42624703+rgsl888prabhu@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:14:06 -0600 Subject: [PATCH 3/3] Delete python/small_mip.mps --- python/small_mip.mps | 46 -------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 python/small_mip.mps diff --git a/python/small_mip.mps b/python/small_mip.mps deleted file mode 100644 index e7feac318..000000000 --- a/python/small_mip.mps +++ /dev/null @@ -1,46 +0,0 @@ -NAME SMALLMIP -ROWS - N OBJ - L c1 - G c2 - E R2 - L R3 - G c5 -COLUMNS - MARK0001 'MARKER' 'INTORG' - x1 c1 1 - x1 c2 2 - x1 c5 1 - x1 OBJ 2 - x2 c1 1 - x2 R2 1 - x2 c5 1 - x2 OBJ 3 - x3 c1 1 - x3 c2 1 - x3 c5 1 - x3 OBJ 1 - x4 c2 -1 - x4 R3 1 - x4 c5 1 - x4 OBJ 1 - x5 R2 3 - x5 R3 1 - x5 c5 1 - x5 OBJ 4 - MARK0001 'MARKER' 'INTEND' -RHS - RHS1 c1 10 - RHS1 c2 3 - RHS1 R2 7 - RHS1 R3 8 - RHS1 c5 5 -BOUNDS - LO BOUND1 x1 0 - LO BOUND1 x2 0 - UP BOUND1 x2 4 - LO BOUND1 x3 0 - UP BOUND1 x3 6 - LO BOUND1 x4 0 - LO BOUND1 x5 0 -ENDATA