code wiki / (root) / nx_f32_conv2d_fast.nx

nx_f32_conv2d_fast.nx

buildroot/runtime/nx_f32_conv2d_fast.nx

3564 B78 linesdepth 8pulls 13 transitivereach 2 importersview sourcekind librarytopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_conv2d_fast.nx -- FAST software-f32 conv2d (NCHW) via im2col + the FORK-PARALLEL nx_f32_matmul_t. The serial nx_f32_conv2d_forward is the training bottleneck (~4-10s/step for a real pose net); this unfolds each conv into a matrix multiply (col[OH*OW, C_in*KH*KW] @ weight[C_out, C_in*KH*KW]^T) so the MAC work runs on the parallel matmul (~7x). Same NCHW layout + weight order as nx_f32_conv2d, so it composes identically. Output is bit-EXACT vs the serial conv when the accumulation has no rounding (integer-valued); for real weights it differs by <=1 ulp only in bias placement (bias added last vs first) -- negligible for train/infer. Composes nx_f32_matmul_t + add. license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_f32.nx nx_f32_matmul_t.nx nx_f32_conv2d_fast.nx nx_f32_conv2d_fast_gate.nx nx_pose_student_distill.nx

imports: nx_syscalls.nxnx_f32.nxnx_f32_matmul_t.nx

imported by: nx_f32_conv2d_fast_gate.nxnx_pose_student_distill.nx

structs

none

consts

12const NX_CVF_OK: i64 = 0
13const NX_CVF_ERR_ARGS: i64 = 4

functions

15func nx_f32_conv2d_fast(input: *i64, N: i64, C_in: i64, H: i64, W: i64,