From 0610126049e1aa61945aeaabbc55e9aae99d8c77 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 18 Jan 2024 17:19:12 -0800 Subject: [PATCH 1/4] remove env setting --- .github/workflows/test.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fc58cfce..36691b26 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,20 +23,6 @@ jobs: with: go-version: '1.21' cache: true - - if: ${{ startsWith(matrix.os, 'windows-') }} - shell: pwsh - run: | - $path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath - if ($path) { - $path = join-path $path 'Common7\Tools\vsdevcmd.bat' - if (test-path $path) { - cmd /s /c """$path"" $args && set" | where { $_ -match '(\w+)=(.*)' } | foreach { - echo "$($Matches[1])=$($Matches[2])" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - } - } - } - - echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append - run: go get ./... - run: go generate -x ./... - uses: actions/upload-artifact@v4 From 946431d5b073ff2f620faabb182336895cd174dc Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 22 Dec 2023 12:17:37 -0800 Subject: [PATCH 2/4] build cuda and rocm --- .github/workflows/test.yaml | 82 +++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 36691b26..5ba4c6e8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,8 +28,66 @@ jobs: - uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.arch }}-libraries - path: | - llm/llama.cpp/build/**/lib/* + path: llm/llama.cpp/build/**/lib/* + generate-cuda: + strategy: + matrix: + cuda-version: + - '11.8.0' + runs-on: ubuntu-latest + container: nvidia/cuda:${{ matrix.cuda-version }}-devel-ubuntu20.04 + steps: + - run: | + apt-get update && apt-get install -y git build-essential curl + curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz \ + | tar -zx -C /usr --strip-components 1 + env: + DEBIAN_FRONTEND: noninteractive + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: true + - run: go get ./... + - run: | + git config --global --add safe.directory /__w/ollama/ollama + go generate -x ./... + env: + OLLAMA_SKIP_CPU_GENERATE: '1' + - uses: actions/upload-artifact@v4 + with: + name: cuda-${{ matrix.cuda-version }}-libraries + path: llm/llama.cpp/build/**/lib/* + generate-rocm: + strategy: + matrix: + rocm-version: + - '5.7.1' + - '6.0' + runs-on: ubuntu-latest + container: rocm/dev-ubuntu-20.04:${{ matrix.rocm-version }} + steps: + - run: | + apt-get update && apt-get install -y git build-essential curl rocm-libs + curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz \ + | tar -zx -C /usr --strip-components 1 + env: + DEBIAN_FRONTEND: noninteractive + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: true + - run: go get ./... + - run: | + git config --global --add safe.directory /__w/ollama/ollama + go generate -x ./... + env: + OLLAMA_SKIP_CPU_GENERATE: '1' + - uses: actions/upload-artifact@v4 + with: + name: rocm-${{ matrix.rocm-version }}-libraries + path: llm/llama.cpp/build/**/lib/* lint: strategy: matrix: @@ -69,7 +127,10 @@ jobs: if: ${{ startsWith(matrix.os, 'windows-') }} - uses: golangci/golangci-lint-action@v3 test: - needs: generate + needs: + - generate + - generate-cuda + - generate-rocm strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -96,5 +157,20 @@ jobs: with: name: ${{ matrix.os }}-${{ matrix.arch }}-libraries path: llm/llama.cpp/build + - if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/download-artifact@v4 + with: + name: cuda-11.8.0-libraries + path: llm/llama.cpp/build + - if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/download-artifact@v4 + with: + name: rocm-5.7.1-libraries + path: llm/llama.cpp/build + - if: ${{ matrix.os == 'ubuntu-latest' }} + uses: actions/download-artifact@v4 + with: + name: rocm-6.0-libraries + path: llm/llama.cpp/build - run: go build - run: go test -v ./... From 5580de45717c2f1b85ff66f4012d87d6bf8c2963 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 22 Dec 2023 16:06:35 -0800 Subject: [PATCH 3/4] archive ollama binaries --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5ba4c6e8..c98b1f6e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -174,3 +174,7 @@ jobs: path: llm/llama.cpp/build - run: go build - run: go test -v ./... + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}-binaries + path: ollama From a8c5413d06b417f9484d8723da308215a7eed922 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 19 Jan 2024 09:20:19 -0800 Subject: [PATCH 4/4] only generate gpu libs --- .github/workflows/test.yaml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c98b1f6e..f5174c33 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,10 +127,7 @@ jobs: if: ${{ startsWith(matrix.os, 'windows-') }} - uses: golangci/golangci-lint-action@v3 test: - needs: - - generate - - generate-cuda - - generate-rocm + needs: generate strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -157,21 +154,6 @@ jobs: with: name: ${{ matrix.os }}-${{ matrix.arch }}-libraries path: llm/llama.cpp/build - - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions/download-artifact@v4 - with: - name: cuda-11.8.0-libraries - path: llm/llama.cpp/build - - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions/download-artifact@v4 - with: - name: rocm-5.7.1-libraries - path: llm/llama.cpp/build - - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: actions/download-artifact@v4 - with: - name: rocm-6.0-libraries - path: llm/llama.cpp/build - run: go build - run: go test -v ./... - uses: actions/upload-artifact@v4