Skip to content

Opt-in CUDA, CPU default - #15

Merged
emrefbulut merged 2 commits into
mainfrom
fix/cuda-opt-in
Sep 3, 2026
Merged

emrefbulut merged 2 commits into
mainfrom
fix/cuda-opt-in

Conversation

@emrefbulut

Copy link
Copy Markdown
Owner

Summary

  • CUDA is opt-in via --device cpu|cuda on iqforge train and iqforge measure-leakage. The default stays CPU even when a GPU is present; cuda errors if torch reports none.
  • TrainingResult.environment (and measurement runs) record cpu vs cuda so two tables can be told apart. No GPU bit-equality is claimed.
  • Published tables, scripts/parity_gate.py, and artifacts/*.json stay on CPU. The parity path does not pass --device. Seed lists and n are unchanged.

Why

ROADMAP optional CUDA for new measurements only. A silent GPU default would break the reproducibility promise and mix devices inside paired experiments.

How it was verified

uv run pytest tests/test_models.py tests/test_measurement.py tests/test_preflight.py — 53 passed, 2 skipped.

Mutation check: resolve_device was temporarily changed to pick CUDA whenever torch.cuda.is_available(). test_default_stays_cpu_even_when_cuda_is_available, test_cpu_flag_must_not_silently_use_cuda, and test_current_environment_stamps_an_opt_in_cuda_device went red, then the mutation was reverted.

Conventions it touches

  • 1 Never fall back silently — --device cuda errors if torch reports no CUDA; a present GPU does not change the default
  • 2 A passing test does not prove it can fail — CPU-default tests were turned red by the mutation above
  • 3 Do not claim what you did not measure — environment stamps the device; CUDA runs warn they are not bit-comparable
  • 4 Protect published artifacts — no file under artifacts/ was rewritten; the parity gate does not opt in to CUDA

Made with Cursor

emrefbulut and others added 2 commits September 2, 2026 21:28
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@emrefbulut
emrefbulut merged commit 9c05d41 into main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant