1.3 KiB
1.3 KiB
Step 3: device-oom-policy
Read First
- /AGENTS.md
- /PLAN.md
- /PROGRESS.md
- /docs/HARNESS.md
- /docs/IMPLEMENTATION_PLAN.md
- /docs/ARCHITECTURE.md
- /docs/CONVERSION_POLICY.md
- /docs/TOOLCHAIN.md
- /phases/1-core-runtime-contracts/step1.md
Task
Implement runtime device selection, CUDA fail-fast behavior, auto CPU fallback behavior, and OOM retry policy hooks.
This step should be tested with mocks and small CUDA smoke checks only where safe.
Sprint Contract
- Done means: runtime policy enforces explicit CUDA fail-fast, auto fallback warning, and configurable OOM retry reductions.
- Hard thresholds: no silent CPU fallback for explicit CUDA; tests do not require exhausting VRAM; GTX 1070 Ti constraints remain documented.
- Files owned:
src/pdftomd/runtime.py, tests,docs/TOOLCHAIN.mdif behavior changes,PROGRESS.md, phase index. - Dependencies: Runtime config options.
Acceptance Criteria
python scripts\validate_workspace.py
.\venv\python.exe -m pytest tests
Verification
- Run the acceptance commands.
- Confirm CUDA smoke test instructions still work separately.
- Update
PROGRESS.mdand this phase index.
Do Not
- Do not intentionally trigger real GPU OOM in tests.
- Do not change PyTorch pins without updating
docs/TOOLCHAIN.md. - Do not hide runtime warnings.