From 8092feb9422c79960f1628f6e55da753d8c7a44c Mon Sep 17 00:00:00 2001 From: Joshua Warren <816217+joshuaswarren@users.noreply.github.com> Date: Mon, 9 Nov 2026 22:11:56 -0600 Subject: [PATCH] honeykrisp: expose VK_AMD_shader_core_properties2 Report the active GPU core count through activeComputeUnitCount, taken from agx_get_num_cores(). llama.cpp reads this property to decide how many workgroups a decode flash attention dispatch needs. Without a core count it assumes 16, so 32-head decode runs as 32 workgroups on a 32-core M1 Max, and each workgroup walks the whole KV cache serially. Measured on an M1 Max with llama-2-7B Q4_0, FA decode op, 32 heads, head size 128, f16 KV, at KV 4096: 942 us with the placeholder, 578 us when the core count is 32. A consumer that also scales the count (a 4096-KV run with an effective 64) reaches 411 us. --- docs/relnotes/new_features.txt | 1 + src/asahi/vulkan/hk_physical_device.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 051daf16d060..d2d179b1ac2c 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -78,3 +78,4 @@ GL_OES_draw_buffers_indexed on etnaviv/HALTI5 GL_OES_EGL_image_external_essl3 on etnaviv/HALTI5 GLES 3.0 on etnaviv/HALTI5 VK_QCOM_rotated_copy_commands on Turnip +VK_AMD_shader_core_properties2 on honeykrisp diff --git a/src/asahi/vulkan/hk_physical_device.c b/src/asahi/vulkan/hk_physical_device.c index ac48a0805b15..72850f945dc6 100644 --- a/src/asahi/vulkan/hk_physical_device.c +++ b/src/asahi/vulkan/hk_physical_device.c @@ -224,6 +224,7 @@ hk_get_device_extensions(const struct agx_device *dev, .KHR_vulkan_memory_model = true, .KHR_workgroup_memory_explicit_layout = true, .KHR_zero_initialize_workgroup_memory = true, + .AMD_shader_core_properties2 = true, .EXT_4444_formats = true, .EXT_attachment_feedback_loop_layout = true, .EXT_blend_operation_advanced = true, @@ -1434,6 +1435,9 @@ hk_get_device_properties(const struct agx_device *dev, .dynamicRenderingLocalReadDepthStencilAttachments = false, .dynamicRenderingLocalReadMultisampledAttachments = true, + /* VK_AMD_shader_core_properties2 */ + .activeComputeUnitCount = agx_get_num_cores(dev), + /* VK_KHR_push_descriptor */ .maxPushDescriptors = HK_MAX_PUSH_DESCRIPTORS,