Skip to content

Commit 2fe19a6

Browse files
lksj92hsggerganov
authored andcommitted
Workaround for subgroup arithmetic failing on MoltenVK with AMD GPUs (issue 15846) (llama/15886)
1 parent 0ac013c commit 2fe19a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,12 @@ static vk_device ggml_vk_get_device(size_t idx) {
37363736

37373737
device->subgroup_arithmetic = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
37383738
(vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eArithmetic);
3739+
#ifdef __APPLE__
3740+
// Workaround for subgroup arithmetic failing on MoltenVK with AMD GPUs (issue 15846)
3741+
if (device->vendor_id == VK_VENDOR_ID_AMD) {
3742+
device->subgroup_arithmetic = false;
3743+
}
3744+
#endif
37393745
device->subgroup_shuffle = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&
37403746
(vk11_props.subgroupSupportedOperations & vk::SubgroupFeatureFlagBits::eShuffle);
37413747
device->subgroup_clustered = (vk11_props.subgroupSupportedStages & vk::ShaderStageFlagBits::eCompute) &&

0 commit comments

Comments
 (0)