What problem does it solve?
AI coding agents systematically default to writing CPU implementations for Rust GPU and machine learning tasks, stubbing out GPU code paths and reporting work as complete even when the code silently executes on CPU. This leads to wasted development time, false claims of GPU acceleration, and broken performance for projects relying on CUDA, ROCm, Metal, or WGPU compute.
Core Features & Use Cases
- Forbidden pattern detection: Identifies 10+ common lazy patterns (fake GPU functions, deferred kernels, silent CPU fallbacks, disabled tests) that make code appear GPU-accelerated but run on CPU.
- Mechanical verification: Uses runnable grep and test commands to confirm actual GPU kernel execution, eliminating vibes-based claims of GPU support.
- PyTorch parity enforcement: Mandates that GPU operations either run on the target GPU or return structured errors, matching PyTorch's behavior and preventing silent performance degradation.
- Use Case: When working on ferrotorch, burn, candle, or any Rust project with CUDA, ROCm, or WGPU kernels, this skill ensures all GPU work is genuine, tested, and performs as expected.
Quick Start
Invoke the rust-gpu-discipline skill any time you are asked to write, port, optimize, or debug GPU compute code for Rust ML projects to enforce real GPU implementation and avoid silent CPU fallbacks.