Repository navigation
agx: keep unmodified f16 GPR sources native in AGX3C F32 FFMA - #683
DjDeveloperr wants to merge 1 commit into
Conversation
|
The exactness argument holds: f16 to f32 is exact, and the fast path needs every register source to be unmodified (agx_compile.c:5258-5268). The packer already routes AGX3C FMA with half registers through the per-operand width encoder (agx3_pack_binary.c:772-775). A few points:
Assisted-by: LLM (Claude:Opus 5.5) |
6d23290 to
af1486d
Compare
|
Updated in
Verification (
|
Extend #702's agx_lower_agx3_fma_sources() native half-GPR path cleanly from AGX3B to all non-G18G AGX3 encodings (AGX3B and AGX3C): on AGX3C (non-G18G), unmodified all-scalar-register F32 FFMA natively encodes per-operand width bits (src0_16, src1_16, addend_16) via agx3_falu_fma_mod_runtime(). Skip the redundant f16->f32 widening move for both SSA and precoloured half GPR sources while keeping AGX3B native and preserving widening for modified sources, uniform-mixed forms, and G18G. Add exact-byte src0_16 encoding coverage in test-agx3-alu-core.c and update/extend test-native-form-regressions.cpp for AGX3C (including precoloured AGX_INDEX_REGISTER half sources and end-to-end AGX3C shader compilation). Signed-off-by: Diljit Singh <hey@djdev.me>
af1486d to
ca2987f
Compare
|
Rebased cleanly onto
|
|
Closing as superseded by merged #386 ( |
Summary
src/asahi/compiler/agx_compile.c:agx_lower_agx3_fma_sources(), allow unmodified all-scalar-register F32FFMAinstructions onAGX3C(non-G18G) to consume single-usef16GPR sources directly instead of emitting redundantfadd h, #-0.0widening moves.agx3_try_float_modifier()/agx3_falu_fma_mod_runtime()already encode per-operand width bits for mixedf16/f32scalar GPR operands onAGX3C. Modified, G18G (emit_agx3d), AGX3B, and uniform-mixed forms keep their existing widening paths.NativeForms.Agx3cFfmaKeepsUnmodifiedHalfGprNativeinsrc/asahi/compiler/test/test-native-form-regressions.cppcovering unmodified AGX3C GPR preservation, modified/uniform/G18G/AGX3B fallback widening, and end-to-end AGX3C compute packing.Hardware Results (Apple M5 Pro / G17S B1, Borealis Vulkan)
Baseline
aurora-wipcommit:f3016978f09| PR head:6d232900a3b6bfe86f74f00fe96fb0b6c37c40b7Verified in the M5 Pro Geekbench 6.7.1 Vulkan compiler stack (
mw-mega11vs prior baseline, pushing overall Geekbench 6.7.1 Vulkan to142,881/101.82%of macOS 27.0 Metal140,326):convolve_H189i/73g -> 153i/63g,convolve_V204i/67g -> 168i/63g4.099 ms -> 3.204 ms(-21.8%)3.414 ms -> 2.940 ms(-13.9%)Verification (Apple M5 Pro / G17S B1, Borealis Vulkan,
MESA_SHADER_CACHE_DISABLE=1)agx_tests: 1218/1218 Pass (0 fail, 1 pre-existing skip intest-rte-fma.cpp; includesNativeForms.Agx3cFfmaKeepsUnmodifiedHalfGprNative)vulkan-cts-1.4.7.1):dEQP-VK.glsl.builtin.precision.fma.*: 8/8 supported Pass (0 fail, 2 Not supported)dEQP-VK.glsl.builtin.precision_fp16_storage16b.fma.*: 4/4 supported Pass (0 fail, 1 Not supported)dEQP-VK.glsl.builtin.precision_fp16_storage32b.fma.*: 4/4 supported Pass (0 fail, 1 Not supported)dEQP-VK.spirv_assembly.instruction.compute.float16.arithmetic.*: 76/76 Pass (0 fail)dEQP-VK.spirv_assembly.instruction.graphics.float16.arithmetic.*: 380/380 Pass (0 fail)gb-gaussian(exact-ssbo-gaussian,horizontal.spv+vertical.spv): 12/12 checked Passdmesg: 0 GPU faultsDEFAULT_BRANCH=aurora-wip bash .github/aurora/agent-policy.sh pr HEAD-> cleanAssisted-by: LLM (Google:Gemini 4 Neon)