[test]: Marker-based suites + ctest + ccc-gpu-bench CLI (restructure-tests + extract-benchmarks) - #36
Merged
Conversation
…ture-tests) OpenSpec change: restructure-tests. - Markers gpu/slow/network registered with --strict-markers; tests/gpu/conftest.py auto-marks the GPU dir and skips cleanly when cupy/ccc_cuda_ext are absent, so `pytest tests/ -m "not gpu"` passes on a CPU-only box. tests/conftest.py holds shared fixtures; clean_gpu_memory is now an autouse fixture. - De-benchmarked the parity tests: removed the duplicated timing/logging/log-file machinery from test_ccc_gpu.py and test_ccc_gpu_return_parts.py (kept the assert_frame_equal parity at 1e-6), removed wall-clock speedup assertions from the n_jobs tests (now determinism checks), deleted the pure-timing benchmark tests (their intent moves to ccc-gpu-bench). - CUDA gtests wired into ctest behind option(CCC_BUILD_TESTS OFF); googletest FetchContent gated inside the option so default/wheel builds do not fetch it; registered via gtest_discover_tests. Two oversized reference cases GTEST_SKIP. - Closed GPU coverage gaps (all pass after the fix-cuda-correctness fixes): categorical return_parts parity, constant-feature matrix, too-few-objects error parity, mixed numerical+categorical DataFrame (tests/gpu/test_coverage_gaps.py). - Updated scripts/run_tests.sh, tests/README.md, and ci.yml to the marker-based commands. (pyproject.toml also carries the bench console-script for the companion extract-benchmarks commit.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OpenSpec change: extract-benchmarks. Decouples performance measurement from the test suite into a standalone CLI (`ccc-gpu-bench` / `python -m ccc.bench`). - Modes: coef (GPU-vs-CPU end-to-end, --pvalue-n-perms/--return-parts/ --gpu-only/--cpu-only + grids), ari (kernel-level), scaling (CPU n_jobs). - Structured output: JSONL (default) or CSV, incremental writes, one record per case with full config, seed, env metadata (GPU/driver/CUDA/CPU/pkg version), and warmup-excluded repeated timings + speedup. - Presets smoke (seconds) and paper (poster/README grid). --profile gives a CPU cProfile category breakdown and prints an nsys suggestion for GPU runs. - Stdlib-only (argparse); graceful degradation without a GPU. CPU-only smoke test for the CLI plumbing (tests/test_bench_cli.py). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- All human-readable status/progress/nsys-suggestion output now goes to stderr (cli.py, runners.py), so the default JSONL/CSV written to stdout stays machine-parseable when --output is omitted or '-'. - gpu_available() now probes cupy for an accessible CUDA device count instead of only checking that cupy/ccc_cuda_ext are importable, so a device-less host (CUDA env on a CPU runner) fails fast with a clear message. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Codex review returned two findings, both fixed in the latest commit:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements restructure-tests (proposal 4) + extract-benchmarks (proposal 5). Two commits.
restructure-tests
gpu/slow/network+--strict-markers;tests/gpu/conftest.pyauto-marks the GPU dir and skips cleanly when cupy/ext are missing; research-module tests (test_giant/methods/plots/corr) now guard withpytest.importorskip("ccc.<mod>")so barepytest tests/is green on a CPU-only box (no--ignoreneeded).assert_frame_equalat 1e-6); n_jobs tests became determinism checks; deleted pure-timing benchmark tests (intent →ccc-gpu-bench).option(CCC_BUILD_TESTS OFF); googletest FetchContent gated inside it so default/wheel builds fetch only spdlog.ctest→ 8 passed, 2 skipped (oversized reference cases).return_parts, constant-feature matrix, too-few-objects error parity, mixed-type DataFrame.extract-benchmarks
ccc-gpu-bench/python -m ccc.bench: modescoef/ari/scaling, JSONL/CSV incremental output with full env metadata + seed + warmup-excluded timings, presetssmoke/paper,--profile(CPU cProfile categories + nsys hint). Stdlib-only; graceful without a GPU.Testing (ccc-gpu-dev, RTX 4090)
-m "not gpu and not slow and not network"→ 139 passed, 4 skipped. GPU-m gpu→ 79 passed. Full suite 224 passed (216 − 3 removed benchmark tests + 11 new).ctest -DCCC_BUILD_TESTS=ON→ 8 passed, 2 skipped; default configure fetches only spdlog.ccc-gpu-bench coef --preset smokewrites valid JSONL (10–39× speedups). ruff + clang-format clean.