Share the GPU smoke test between OptimalControl and OptimalControlScalarized

未關閉
#445 0 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@ocots 已經在處理了。

開始於 2026年11月10日。

評估

這個 Issue 還沒有評估資料。

描述

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.
主要語言
Julia
星號
13
分支
1
平均合併
3 小時 36 分鐘
30 天內合併 PR
57

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

control-toolbox/OptimalControlProblems.jl 的其他 Issue

查看 control-toolbox/OptimalControlProblems.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。