Skip to content

Conftest GPU auto-skip incorrectly skips CPU xpress tests #693

Description

@FBumann

Problem

test/conftest.py::pytest_collection_modifyitems auto-marks any parametrized test where the solver param is a backend with SolverFeature.GPU_ACCELERATION as a GPU test and skips it without --run-gpu.

Xpress carries GPU_ACCELERATION=True because it has an optional GPU pathway, but the vast majority of xpress test runs are pure CPU and don't need a GPU. The current rule treats CPU xpress and GPU xpress as the same thing, so any parametrize("solver", [..., "xpress", ...]) silently drops the xpress cell from the default test run.

Reproduction

pytest test/test_sos_masked.py -k xpress -rs
# every xpress case → SKIPPED [reason: need --run-gpu option to run GPU tests]

pytest test/test_sos_masked.py -k xpress --run-gpu
# every xpress case → PASSED

Same pattern hits test_piecewise_constraints.py::test_sos2_per_entity_nan_padding[xpress-*] and any other suite that parametrizes on solver name.

Why this matters

Xpress's SOS path was a regression target in #688xpress / direct and xpress / lp are exactly the cells we want covered by default. Today they're hidden behind --run-gpu, which CI does not pass, so a real regression in xpress would slip through.

Suggested fix

Distinguish "GPU-only solver" from "solver with an optional GPU mode":

  • cuPDLPx (GPU-only) → keep the skip
  • xpress → don't skip; xpress GPU acceleration is opt-in at solve time via solver options, not at import/parametrize time

A small option here: replace solver_supports(solver, SolverFeature.GPU_ACCELERATION) in the conftest hook with a stricter check (e.g. a GPU_ONLY feature, or just an explicit set of GPU-only backends). Then xpress runs by default and cuPDLPx-style backends still require --run-gpu.

Source

test/conftest.py, lines 37–57.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions