From 724b2ae66d9e7d04dd8076736631ea0b286eb796 Mon Sep 17 00:00:00 2001 From: Shaojun Liu <61072813+liu-shaojun@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:05:20 +0800 Subject: [PATCH] add npu-level0 pipeline.dll to ipex-llm (#12181) * add npu-level0 pipeline.dll to ipex-llm * test * update runner label * fix * update * fix * fix --- .../llm/download-llm-binary/action.yml | 2 + .github/workflows/llm-binary-build.yml | 56 +++++++++++++++++++ python/llm/setup.py | 3 +- 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.github/actions/llm/download-llm-binary/action.yml b/.github/actions/llm/download-llm-binary/action.yml index c15bfe49..8726969c 100644 --- a/.github/actions/llm/download-llm-binary/action.yml +++ b/.github/actions/llm/download-llm-binary/action.yml @@ -27,6 +27,7 @@ runs: mv windows-avx2/* python/llm/llm-binary/ mv windows-avx-vnni/* python/llm/llm-binary/ mv windows-avx/* python/llm/llm-binary/ + mv windows-npu-level0/* python/llm/llm-binary/ fi rm -rf linux-avx2 || true rm -rf linux-avx512 || true @@ -36,3 +37,4 @@ runs: rm -rf windows-avx2 || true rm -rf windows-avx-vnni || true rm -rf windows-avx || true + rm -rf windows-npu-level0 || true diff --git a/.github/workflows/llm-binary-build.yml b/.github/workflows/llm-binary-build.yml index 26f061b3..211a8aa3 100644 --- a/.github/workflows/llm-binary-build.yml +++ b/.github/workflows/llm-binary-build.yml @@ -443,6 +443,62 @@ jobs: path: | release + check-windows-npu-level0-artifact: + if: ${{contains(inputs.platform, 'Windows')}} + runs-on: [Shire] + outputs: + if-exists: ${{steps.check_artifact.outputs.exists}} + steps: + - name: Check if built + id: check_artifact + uses: xSAVIKx/artifact-exists-action@v0 + with: + name: windows-npu-level0 + + windows-build-npu-level0: + runs-on: [self-hosted, Windows, npu-level0] + needs: check-windows-npu-level0-artifact + if: needs.check-windows-npu-level0-artifact.outputs.if-exists == 'false' + steps: + - name: Set access token + run: | + echo "github_access_token=$env:GITHUB_ACCESS_TOKEN" >> $env:GITHUB_ENV + echo "github_access_token=$env:GITHUB_ACCESS_TOKEN" + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3 + with: + repository: "intel-analytics/llm.cpp" + ref: ${{ inputs.llmcpp-ref }} + token: ${{ env.github_access_token }} + submodules: "recursive" + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + with: + msbuild-architecture: x64 + - name: Add cmake to PATH + uses: ilammy/msvc-dev-cmd@v1 + - name: Build binary + shell: powershell + run: | + cd bigdl-core-npu-level0 + mkdir build + cd build + cmake .. + cmake --build . --config Release -j + - name: Move release binary + shell: powershell + run: | + cd bigdl-core-npu-level0 + if (Test-Path ./release) { rm -r -fo release } + mkdir release + mv build/Release/pipeline.dll release/pipeline.dll + - name: Archive build files + uses: actions/upload-artifact@v3 + with: + name: windows-npu-level0 + path: | + bigdl-core-npu-level0/release + + # to make llm-binary-build optionally skippable dummy-step: if: ${{ inputs.platform == 'Dummy' }} diff --git a/python/llm/setup.py b/python/llm/setup.py index 5556f3d0..7169d75f 100644 --- a/python/llm/setup.py +++ b/python/llm/setup.py @@ -85,7 +85,8 @@ windows_binarys = [ "quantize-llama_vnni.exe", "quantize-gptneox_vnni.exe", "quantize-bloom_vnni.exe", - "quantize-starcoder_vnni.exe" + "quantize-starcoder_vnni.exe", + "pipeline.dll" ] linux_binarys = [ "libllama_avx.so",