[BUG] Constraint validation reports CSR offset count as the number of rows
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee cpp/src/pdlp/utilities/problem_checking.cu alrededor de la comprobación de RHS en las líneas 201–208 y, después, examina las dos comprobaciones de límites mencionadas en el informe. Compara el número de filas usado en cada mensaje de error con el cálculo offsets.size() - 1 de la validación. El trabajo estará listo cuando los vectores RHS y de límites mal formados indiquen el número real de filas de la matriz; ejecuta las pruebas de validación pertinentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug
When the length of a constraint vector does not match the CSR matrix, the solver rejects the model, but the validation message reports the length of the CSR offsets array as the number of matrix rows. For a two-row matrix, a three-element RHS can therefore produce the contradictory message:
The right hand side vector has size 3 and the number of rows (constraints) in the matrix is 3.
The actual matrix has two rows (offsets = [0, 1, 2]). The lower/upper-bound representation has the same diagnostic issue. The validation itself rejected the malformed models in the cases checked; this report does not assert an out-of-bounds access.
Reproducer
import numpy as np
from cuopt.linear_programming.data_model import DataModel
from cuopt.linear_programming.solver import Solve
from cuopt.linear_programming.solver_settings import SolverMethod, SolverSettings
model = DataModel()
model.set_csr_constraint_matrix(
np.array([1.0, 1.0]),
np.array([0, 0], dtype=np.int32),
np.array([0, 1, 2], dtype=np.int32),
)
model.set_objective_coefficients(np.array([1.0]))
model.set_variable_lower_bounds(np.array([0.0]))
model.set_variable_upper_bounds(np.array([np.inf]))
model.set_variable_types(np.array(["C"], dtype="S1"))
model.set_constraint_bounds(np.array([1.0, 2.0, 3.0]))
model.set_row_types(np.array(["G", "G", "G"]))
settings = SolverSettings()
settings.set_parameter("method", SolverMethod.PDLP)
settings.set_parameter("time_limit", 10.0)
settings.set_parameter("log_to_console", False)
solution = Solve(model, settings)
print(solution.get_error_status(), solution.get_error_message())
Expected: a validation error reporting 2 matrix rows. Observed with cuOpt 26.12.00a62 (52d14b4c), CUDA 13, B300: a validation error reporting 3 rows. A valid two-element RHS/row-types control solves to Optimal.
At 52d14b4c, the RHS check compares against offsets.size() - 1 but formats offsets.size(); the two bounds checks use the same pattern. Related: #2254.
- Lenguaje dominante
- Cuda
- Estrellas
- 1.1k
- Forks
- 255
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 123
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/cuopt
-
ci: pr-test-summary job shows red when the GitHub API returns persistent 5xx errorsPosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[BUG] Dataset downloader reports success and replaces data after a failed downloadPosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/cuopt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
SAP/crossplane-provider-btp#1175 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
huggingface/deep-rl-class#723 ·
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
hashtopolis/server#2613 ·
Los mantenedores suelen responder en 1 día
-
adk: stream concatenation errors bypass retry and failoverPosiblemente ocupada @OUAO-FRANK la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días