Context
Parent: #11 | PRD: #10 | Design: docs/design/gpu-acceleration.md Section B, Pass 1
Goal
Implement the first GPU pass: batch frames through DTCWTForward, extract phase deltas on GPU, transfer to CPU, and cumsum into cumulative phase arrays.
Acceptance Criteria
Blocked by
#13 (Slice 2) — needs --gpu flag and import infrastructure.
Files likely involved
motion_mag.py — _gpu_forward_pass() function
Testing approach
- Unit test: forward pass on 10-frame synthetic data, verify phase array shapes and finiteness
- Unit test: batched (bs=5) produces identical phases to single batch (bs=10)
- Unit test: OOM handling with artificially small batch size
Context
Parent: #11 | PRD: #10 | Design:
docs/design/gpu-acceleration.mdSection B, Pass 1Goal
Implement the first GPU pass: batch frames through
DTCWTForward, extract phase deltas on GPU, transfer to CPU, and cumsum into cumulative phase arrays.Acceptance Criteria
_gpu_forward_pass(data, nlevels, biort, qshift, device)function returnsphase_arrays(list of numpy arrays per level, shape(num_frames, num_coeffs), float32)free_vram * 0.7 / (frame_vram_estimate)np.cumsum(axis=0)on CPU (float32)Blocked by
#13 (Slice 2) — needs
--gpuflag and import infrastructure.Files likely involved
motion_mag.py—_gpu_forward_pass()functionTesting approach