std :: ml::gpu_mps
Function std::mps_sub_f32
int mps_sub_f32([]const float a, []const float b, []float out)Same shape/verification status as mps_add_f32 (elementwise, GPU-executed, unified-memory readback) — sub/mul/div/pow are two-input, log/exp/sqrt are one-input. mul/div/pow/log/exp/sqrt share mps_add_f32's setup/ dispatch/readback path (see __mps_run_binary_kernel/__mps_run_unary_kernel in gpu_mps.sc), so the fix that made mps_add_f32's GPU dispatch work applies to all of them identically — verified directly for mps_sub_f32/mps_mul_f32 as representative binary/no-special-case cases; div/pow/log/exp/sqrt follow the exact same code path with only the one-line kernel body differing. mps_sub_f32 itself is NOT routed through __mps_run_binary_kernel (unlike mul/div/pow) — it's batch-aware, same reasoning as mps_relu_f32/mps_matmul_f32 (see mps_relu_f32's comment): a per-op caller needs to encode it onto a shared batch's command buffer for the fused forward+loss+backward training-step path, not force its own commit+wait mid-batch.