LLM inference in C/C++
C++ ggml
ci : add self-hosted webgpu to hf-jobs (#28712)
Sigbjørn Skjæret583926e3ac2f
diff --git a/.github/workflows/build-self-hosted.yml b/.github/workflows/build-self-hosted.ymlindex 1337a0ed5b..fd3722bcf5 100644--- a/.github/workflows/build-self-hosted.yml+++ b/.github/workflows/build-self-hosted.yml@@ -124,6 +124,7 @@ jobs:GG_BUILD_ROCM=1 GG_BUILD_AMDGPU_TARGETS=gfx1151 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cppgpu-vulkan-nvidia-cm:+ # runs-on: "hf-jobs-t4-small:ubuntu26_04"runs-on: [self-hosted, Linux, NVIDIA]steps:@@ -131,13 +132,44 @@ jobs:id: checkoutuses: actions/checkout@v6+ # - name: Install dependencies+ # run: |+ # sudo apt update+ # sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc spirv-headers vulkan-tools mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 libssl-dev time unzip wget python3 python3-venv python3-pip++ # - name: ccache+ # uses: ggml-org/[email protected]+ # with:+ # restore: false+ # save: false++ # - name: ccache-buckets-restore+ # uses: ./.github/actions/ccache-buckets+ # with:+ # key: self-hosted-vulkan-nvidia-cm+ # folder: llama.cpp+ # hf_bucket: ggml-org/cache+- name: Testid: ggml-cirun: |vulkaninfo --summaryGG_BUILD_VULKAN=1 GGML_VK_DISABLE_COOPMAT2=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp+ # - name: ccache-buckets-save+ # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}+ # uses: ./.github/actions/ccache-buckets+ # env:+ # HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}+ # with:+ # key: self-hosted-vulkan-nvidia-cm+ # folder: llama.cpp+ # evict-old-files: 1d+ # hf_bucket: ggml-org/cache+ # save: true+gpu-vulkan-nvidia-cm2:+ # runs-on: "hf-jobs-t4-small:ubuntu26_04"runs-on: [self-hosted, Linux, NVIDIA, COOPMAT2]steps:@@ -145,20 +177,68 @@ jobs:id: checkoutuses: actions/checkout@v6+ # - name: Install dependencies+ # run: |+ # sudo apt update+ # sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan-dev glslc spirv-headers vulkan-tools mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 libssl-dev time unzip wget python3 python3-venv python3-pip++ # - name: ccache+ # uses: ggml-org/[email protected]+ # with:+ # restore: false+ # save: false++ # - name: ccache-buckets-restore+ # uses: ./.github/actions/ccache-buckets+ # with:+ # key: self-hosted-vulkan-nvidia-cm2+ # folder: llama.cpp+ # hf_bucket: ggml-org/cache+- name: Testid: ggml-cirun: |vulkaninfo --summaryGG_BUILD_VULKAN=1 bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp+ # - name: ccache-buckets-save+ # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}+ # uses: ./.github/actions/ccache-buckets+ # env:+ # HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}+ # with:+ # key: self-hosted-vulkan-nvidia-cm2+ # folder: llama.cpp+ # evict-old-files: 1d+ # hf_bucket: ggml-org/cache+ # save: true+gpu-webgpu-nvidia:- runs-on: [self-hosted, Linux, NVIDIA, X64]+ runs-on: "hf-jobs-t4-small:ubuntu26_04"steps:- name: Cloneid: checkoutuses: actions/checkout@v6+ - name: Install dependencies+ run: |+ sudo apt update+ sudo apt install -y build-essential cmake libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libvulkan1 mesa-vulkan-drivers libglvnd0 libgl1 libglx0 libegl1 libgles2 libssl-dev time unzip wget python3 python3-venv python3-pip++ - name: ccache+ uses: ggml-org/[email protected]+ with:+ restore: false+ save: false++ - name: ccache-buckets-restore+ uses: ./.github/actions/ccache-buckets+ with:+ key: self-hosted-webgpu-nvidia+ folder: llama.cpp+ hf_bucket: ggml-org/cache+- name: Dawn Dependencyid: dawn-dependsrun: |@@ -180,6 +260,18 @@ jobs:GG_BUILD_WEBGPU_DAWN_DIR="$GITHUB_WORKSPACE/dawn/lib64/cmake/Dawn" \bash ./ci/run.sh ~/results/llama.cpp ~/mnt/llama.cpp+ - name: ccache-buckets-save+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}+ uses: ./.github/actions/ccache-buckets+ env:+ HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}+ with:+ key: self-hosted-webgpu-nvidia+ folder: llama.cpp+ evict-old-files: 1d+ hf_bucket: ggml-org/cache+ save: true+# TODO: provision AMX-compatible machine#cpu-amx:# runs-on: [self-hosted, Linux, CPU, AMX]diff --git a/tests/test-backend-ops.cpp b/tests/test-backend-ops.cppindex 1616004e0a..bd75e2756d 100644--- a/tests/test-backend-ops.cpp+++ b/tests/test-backend-ops.cpp@@ -12000,8 +12000,7 @@ int main(int argc, char ** argv) {ggml_backend_reg_t reg = ggml_backend_dev_backend_reg(dev);auto ggml_backend_set_n_threads_fn = (ggml_backend_set_n_threads_t) ggml_backend_reg_get_proc_address(reg, "ggml_backend_set_n_threads");if (ggml_backend_set_n_threads_fn) {- // TODO: better value for n_threads- ggml_backend_set_n_threads_fn(backend.get(), N_THREADS);+ ggml_backend_set_n_threads_fn(backend.get(), std::max<int>(1, N_THREADS/2));}size_t free, total; // NOLINT