llama.cpp
669204ee - hexagon: conv_2d optimizations and support for conv_3d (#31814)

Commit
4 days ago
hexagon: conv_2d optimizations and support for conv_3d (#31814) * hexagon: Generalization of CONV_2D implementation for CONV_3D - New op HTP_OP_CONV_3D is wired through htp-ops.h, main.c (shares op_conv_2d) and the op remap in htp-kparams.cpp. - conv_3d runs on the existing HMX tiled (implicit GEMM) conv2d path. KD and KH are folded into one virtual kernel row (KD*KH), and output rows are counted as N*OD*OH. - htp_kparams_solve_conv3d checks the conv_3d layout and calls the tiled solver htp_kparams_conv2d_tiled, which takes an is3d flag. - The tiled kernel takes the sizes and strides that differ between conv_2d and conv_3d from a struct htp_conv_geom. Only the input stage unfolds depth. - 256-entry DMA queue can no longer overflow Assisted-by: Claude Code * hexagon: modify checking to eliminate divide-by-zero hazards * hexagon: conv2d tiled: compute the conv_3d unfold divisors on the host The KH and OH fastdiv values used to unfold conv_3d kh into (kd, kh) and oh into (od, oh) were built per op on the device, each with a 64-bit divide. Pass them in the kernel params instead; they fit in the space the window variant already reserves, so the struct size does not change. Assisted-by: Claude Code * hexagon : preserve fold scheduling in conv2d for small size hexagon : support arbitrary positive conv2d strides Support positive horizontal strides for WHCN and CWHN inputs. Preserve load/shuffle paths for strides 1/2 and use gather for larger strides. hexagon : improve conv2d tile size selection Prefer the largest feasible output-channel block and derive spatial chunk capacity from VTCM usage. Compare capacity and thread-aligned candidates using per-thread work and chunk overhead. Co-authored-by: Yiwei Shao <yiwei@aizip.ai> * hex-conv: fix compiler warning --------- Co-authored-by: Yiwei Shao <yiwei@aizip.ai> Co-authored-by: Max Krasnyansky <maxk@qti.qualcomm.com>
Parents
Loading