Share the GPU smoke test between OptimalControl and OptimalControlScalarized

Offen
#445 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@ocots arbeitet bereits daran.

Seit 10.11.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

Context

Follow-up of #441, to be done once its phase C (shared OptimalControl / OptimalControlScalarized runners in test/common/optimalcontrol_tests.jl) is merged.

The two GPU smoke files differ only by the backend and the configuration group:

  • test/suite/GPU/test_smoke_optimalcontrol.jl (GPU_CONFIGS.OptimalControl, entry function test_smoke_optimalcontrol)
  • test/suite/GPU/test_smoke_scalarized.jl (GPU_CONFIGS.OptimalControlScalarized, entry function test_smoke_scalarized)

Everything else is identical: the CUDA_FUNCTIONAL branch with the visible skip (TST6), the solve with SMOKE_GRID and SMOKE_MAX_ITER, and the finite-objective check.

Goal

Factor the GPU smoke test into one shared implementation parameterized by the backend, as #441 does for test_problem, test_smoke and test_convergence, without changing the behavior on a CPU runner or on a GPU runner.

Proposed approach

  • In test/common/optimalcontrol_tests.jl, or in a new test/common/gpu_tests.jl if the module must not load Main.TestCapabilities in CPU environments, add test_smoke_gpu(backend). The configurations come from getfield(Main.TestConfigs.GPU_CONFIGS, Main.TestStatus.modeling(backend)).
  • Keep the two test files, each as a thin wrapper with its own module and entry function (TST1), so that the report names (test_smoke_optimalcontrol <label>, test_smoke_scalarized <label>) do not change.
  • Keep TST6: no early return in a @testset, Test.@test_skip without a functional device, and test_contract.jl still fails loudly on a kkt or occidata runner without a device.
  • Check that tools/ci/scope.py (Repository.includers) still finds the includers of the new shared file; GPU is an opt-in environment, so it never enters the automatic scope. Add a case to tools/ci/test/test_scope.py if a new file is created.
  • Update test/README.md ("GPU tests") if the layout changes.

Out of scope

  • The GPU configurations and the solvers (GPU_CONFIGS in test/common/configs.jl).
  • Running the GPU tests in CI: they need the run ci kkt-runner or run ci occidata-runner label, and a runner with a device.

Checks

  • On a CPU machine: Pkg.test(; test_args=["GPU"]) reports the same tests as Broken (skipped) as before.
  • On a GPU runner: the same solves run and the same lines appear in the report.
Vorherrschende Sprache
Julia
Sterne
13
Forks
1
Ø Merge
3 Std. 36 Min.
Gemergte PRs (30 T.)
57

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus control-toolbox/OptimalControlProblems.jl

Alle Issues in control-toolbox/OptimalControlProblems.jl

Ähnliche Issues

Weitere Issues zu Julia

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.