Skip to content

Commit a4f011e

Browse files
authored
vulkan: linux builds + small subgroup size fixes (#11767)
* mm subgroup size * upload vulkan x86 builds
1 parent a7b8ce2 commit a4f011e

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,34 @@ jobs:
403403
# This is using llvmpipe and runs slower than other backends
404404
ctest -L main --verbose --timeout 1800
405405
406+
- name: Determine tag name
407+
id: tag
408+
shell: bash
409+
run: |
410+
BUILD_NUMBER="$(git rev-list --count HEAD)"
411+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
412+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
413+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
414+
else
415+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
416+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
417+
fi
418+
419+
- name: Pack artifacts
420+
id: pack_artifacts
421+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
422+
run: |
423+
cp LICENSE ./build/bin/
424+
cp examples/run/linenoise.cpp/LICENSE ./build/bin/LICENSE.linenoise.cpp
425+
zip -r llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip ./build/bin/*
426+
427+
- name: Upload artifacts
428+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
429+
uses: actions/upload-artifact@v4
430+
with:
431+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.zip
432+
name: llama-bin-ubuntu-vulkan-x64.zip
433+
406434
ubuntu-22-cmake-hip:
407435
runs-on: ubuntu-22.04
408436
container: rocm/dev-ubuntu-22.04:6.0.2

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
14301430
VK_LOG_DEBUG("ggml_vk_load_shaders(" << device->name << ")");
14311431

14321432
// some shaders have a minimum subgroup size
1433+
const uint32_t subgroup_size_8 = std::max(device->subgroup_size, 8u);
14331434
const uint32_t subgroup_size_16 = std::max(device->subgroup_size, 16u);
14341435
const uint32_t subgroup_size_32 = std::max(device->subgroup_size, 32u);
14351436

@@ -1492,13 +1493,13 @@ static void ggml_vk_load_shaders(vk_device& device) {
14921493
const uint32_t tk_m = device->coopmat_support ? device->coopmat_k : 1;
14931494
const uint32_t tk_s = device->coopmat_support ? device->coopmat_k : 1;
14941495

1495-
l_warptile = { 128, 128, 128, 16, device->subgroup_size * 2, 64, 2, tm_l, tn_l, tk_l, device->subgroup_size };
1496-
m_warptile = { 128, 64, 64, 16, device->subgroup_size, 32, 2, tm_m, tn_m, tk_m, device->subgroup_size };
1497-
s_warptile = { subgroup_size_16, 32, 32, 16, 32, 32, 2, tm_s, tn_s, tk_s, device->subgroup_size };
1496+
l_warptile = { 128, 128, 128, 16, subgroup_size_8 * 2, 64, 2, tm_l, tn_l, tk_l, subgroup_size_8 };
1497+
m_warptile = { 128, 64, 64, 16, subgroup_size_8, 32, 2, tm_m, tn_m, tk_m, subgroup_size_8 };
1498+
s_warptile = { subgroup_size_16, 32, 32, 16, 32, 32, 2, tm_s, tn_s, tk_s, subgroup_size_8 };
14981499

1499-
l_warptile_mmq = { 128, 128, 128, 32, device->subgroup_size * 2, 64, 2, tm_l, tn_l, tk_l, device->subgroup_size };
1500-
m_warptile_mmq = { 128, 64, 64, 32, device->subgroup_size, 32, 2, tm_m, tn_m, tk_m, device->subgroup_size };
1501-
s_warptile_mmq = { subgroup_size_32, 32, 32, 32, 32, 32, 2, tm_s, tn_s, tk_s, device->subgroup_size };
1500+
l_warptile_mmq = { 128, 128, 128, 32, subgroup_size_8 * 2, 64, 2, tm_l, tn_l, tk_l, subgroup_size_8 };
1501+
m_warptile_mmq = { 128, 64, 64, 32, subgroup_size_8, 32, 2, tm_m, tn_m, tk_m, subgroup_size_8 };
1502+
s_warptile_mmq = { subgroup_size_32, 32, 32, 32, 32, 32, 2, tm_s, tn_s, tk_s, subgroup_size_8 };
15021503

15031504
l_mmq_wg_denoms = l_wg_denoms = {128, 128, 1 };
15041505
m_mmq_wg_denoms = m_wg_denoms = { 64, 64, 1 };

0 commit comments

Comments
 (0)