Skip to content

CI never runs pytest; the GPU job builds a multi-GB PyTorch image just to lint; the GPU code is never exercised #19

Description

@joeljose

Severity: High. Regressions like #13-#16 can merge without being noticed.

Problems

  1. Tests don't run in CI. Both jobs run lint, import, --help and --version. The 28 CPU tests (27 s locally) run only through ./test.sh.
  2. The GPU job is heavy for what it checks. test-gpu builds on pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime (several GB) and installs pytorch_wavelets from git on every push and PR, only to repeat the same lint, import and help checks.
  3. The GPU code never runs anywhere automated. tests/test_visualmic_gpu.py skips without CUDA.

Suggested fix

  • Add python -m pytest tests -q to the CPU job.
  • Run the GPU code path on the CPU in CI. pytorch_wavelets runs fine on CPU tensors. During this audit, extract_audio_gpu ran end to end on a CPU-only PyTorch build (torch 2.14 CPU wheel with pytorch_wavelets from git) after patching torch.device('cuda') to CPU. That run found GPU path drops the last partial batch when the container over-reports frames; CPU path drops frames when it under-reports #16 and showed CPU vs GPU-path correlation of 1.000. Make the device a parameter (--device cpu|cuda:N, see the CLI issue) so tests don't need monkeypatching.
  • Replace the heavy test-gpu image build with a CPU-torch job (pip install torch --index-url https://download.pytorch.org/whl/cpu), and build Dockerfile.gpu only when it or requirements-gpu.txt change (paths: filter).
  • Add an end-to-end CLI test on a tiny synthetic clip, generated in a fixture, that checks the WAV exists with the expected sample rate and length.
  • Add permissions: contents: read to the workflow.

Acceptance criteria

  • CI fails on any failing test.
  • The GPU code path runs in CI on the CPU.
  • The heavy GPU image isn't rebuilt on every PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions