vulkan: skip all-negative-inf blocks in FA (#17186)

This commit is contained in:
Jeff Bolz
2025-11-15 03:37:25 -06:00
committed by GitHub
parent 38eaf32af1
commit 234ae7d7bd
4 changed files with 116 additions and 43 deletions
+6 -2
View File
@@ -521,6 +521,7 @@ struct vk_device_struct {
bool subgroup_shuffle;
bool subgroup_ballot;
bool subgroup_clustered;
bool subgroup_vote;
bool multi_add;
bool shader_int64;
bool buffer_device_address;
@@ -4188,6 +4189,9 @@ static vk_device ggml_vk_get_device(size_t idx) {
device->subgroup_ballot = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
(vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eBallot);
device->subgroup_vote = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
(vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eVote);
const bool force_disable_f16 = getenv("GGML_VK_DISABLE_F16") != nullptr;
device->fp16 = !force_disable_f16 && fp16_storage && fp16_compute;
@@ -13572,8 +13576,8 @@ static bool ggml_backend_vk_device_supports_op(ggml_backend_dev_t dev, const ggm
default:
return false;
}
if (!coopmat2 && !device->subgroup_shuffle) {
// scalar FA uses subgroupShuffle
if (!coopmat2 && !(device->subgroup_shuffle && device->subgroup_vote)) {
// scalar/coopmat1 FA uses subgroupShuffle/subgroupAll
return false;
}
return true;