| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5af8163 commit 9e396b3
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,8 @@ jobs: | |||
| 20 | 20 | id: set-matrix | |
| 21 | 21 | run: | | |
| 22 | 22 | $matrix = @{ | |
| 23 | - 'os' = @('ubuntu-20.04', 'windows-latest') | ||
| 24 | - 'pyver' = @("3.10", "3.11", "3.12") | ||
| 23 | + 'os' = @('ubuntu-latest', 'windows-latest') | ||
| 24 | + 'pyver' = @("3.9", "3.10", "3.11", "3.12") | ||
| 25 | 25 | 'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1") | |
| 26 | 26 | 'releasetag' = @("basic") | |
| 27 | 27 | } | |
@@ -50,6 +50,7 @@ jobs: | |||
| 50 | 50 | - uses: actions/setup-python@v5 | |
| 51 | 51 | with: | |
| 52 | 52 | python-version: ${{ matrix.pyver }} | |
| 53 | + cache: 'pip' | ||
| 53 | 54 | ||
| 54 | 55 | - name: Setup Mamba | |
| 55 | 56 | uses: conda-incubator/setup-miniconda@v3.0.4 | |
@@ -109,15 +110,15 @@ jobs: | |||
| 109 | 110 | $env:VERBOSE = '1' | |
| 110 | 111 | $env:CMAKE_ARGS = '-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=all' | |
| 111 | 112 | $env:CMAKE_ARGS = "-DLLAMA_CUDA_FORCE_MMQ=ON $env:CMAKE_ARGS" | |
| 112 | - if ($env:AVXVER -eq 'AVX') { | ||
| 113 | - $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off' | ||
| 114 | - } | ||
| 115 | - if ($env:AVXVER -eq 'AVX512') { | ||
| 116 | - $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on' | ||
| 117 | - } | ||
| 118 | - if ($env:AVXVER -eq 'basic') { | ||
| 119 | - $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off' | ||
| 120 | - } | ||
| 113 | + # if ($env:AVXVER -eq 'AVX') { | ||
| 114 | + $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off' | ||
| 115 | + # } | ||
| 116 | + # if ($env:AVXVER -eq 'AVX512') { | ||
| 117 | + # $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX512=on' | ||
| 118 | + # } | ||
| 119 | + # if ($env:AVXVER -eq 'basic') { | ||
| 120 | + # $env:CMAKE_ARGS = $env:CMAKE_ARGS + ' -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off' | ||
| 121 | + # } | ||
| 121 | 122 | python -m build --wheel | |
| 122 | 123 | # write the build tag to the output | |
| 123 | 124 | Write-Output "CUDA_VERSION=$cudaVersion" >> $env:GITHUB_ENV | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,81 +6,60 @@ permissions: | |||
| 6 | 6 | contents: write | |
| 7 | 7 | ||
| 8 | 8 | jobs: | |
| 9 | - define_matrix: | ||
| 10 | - name: Define Build Matrix | ||
| 11 | - runs-on: ubuntu-latest | ||
| 12 | - outputs: | ||
| 13 | - matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| 14 | - defaults: | ||
| 15 | - run: | ||
| 16 | - shell: pwsh | ||
| 17 | - | ||
| 18 | - steps: | ||
| 19 | - - name: Define Job Output | ||
| 20 | - id: set-matrix | ||
| 21 | - run: | | ||
| 22 | - $matrix = @{ | ||
| 23 | - 'os' = @('macos-11', 'macos-12', 'macos-13') | ||
| 24 | - 'pyver' = @('3.10', '3.11', '3.12') | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - $matrixOut = ConvertTo-Json $matrix -Compress | ||
| 28 | - Write-Output ('matrix=' + $matrixOut) >> $env:GITHUB_OUTPUT | ||
| 29 | - | ||
| 30 | 9 | build_wheels: | |
| 31 | - name: ${{ matrix.os }} Python ${{ matrix.pyver }} | ||
| 32 | - needs: define_matrix | ||
| 10 | + name: Build wheels on ${{ matrix.os }} | ||
| 33 | 11 | runs-on: ${{ matrix.os }} | |
| 34 | 12 | strategy: | |
| 35 | - matrix: ${{ fromJSON(needs.define_matrix.outputs.matrix) }} | ||
| 36 | - env: | ||
| 37 | - OSVER: ${{ matrix.os }} | ||
| 13 | + matrix: | ||
| 14 | + os: [macos-12, macos-13, macos-14] | ||
| 38 | 15 | ||
| 39 | 16 | steps: | |
| 40 | 17 | - uses: actions/checkout@v4 | |
| 41 | 18 | with: | |
| 42 | 19 | submodules: "recursive" | |
| 43 | 20 | ||
| 21 | + # Used to host cibuildwheel | ||
| 44 | 22 | - uses: actions/setup-python@v5 | |
| 45 | 23 | with: | |
| 46 | - python-version: ${{ matrix.pyver }} | ||
| 47 | - | ||
| 48 | - - name: Install Dependencies | ||
| 49 | - run: | | ||
| 50 | - python -m pip install build wheel cmake | ||
| 24 | + python-version: "3.12" | ||
| 25 | + cache: 'pip' | ||
| 51 | 26 | ||
| 52 | - - name: Build Wheel | ||
| 27 | + - name: Install dependencies | ||
| 53 | 28 | run: | | |
| 54 | - XCODE15PATH="/Applications/Xcode_15.0.app/Contents/Developer" | ||
| 55 | - XCODE15BINPATH="${XCODE15PATH}/Toolchains/XcodeDefault.xctoolchain/usr/bin" | ||
| 56 | - export CMAKE_ARGS="-DLLAMA_NATIVE=off -DLLAMA_METAL=on" | ||
| 57 | - [[ "$OSVER" == "macos-13" ]] && export CC="${XCODE15BINPATH}/cc" && export CXX="${XCODE15BINPATH}/c++" && export MACOSX_DEPLOYMENT_TARGET="13.0" | ||
| 58 | - [[ "$OSVER" == "macos-12" ]] && export MACOSX_DEPLOYMENT_TARGET="12.0" | ||
| 59 | - [[ "$OSVER" == "macos-11" ]] && export MACOSX_DEPLOYMENT_TARGET="11.0" | ||
| 29 | + python -m pip install --upgrade pip | ||
| 30 | + python -m pip install -e .[all] | ||
| 60 | 31 | ||
| 61 | - export CMAKE_OSX_ARCHITECTURES="arm64" && export ARCHFLAGS="-arch arm64" | ||
| 62 | - VERBOSE=1 python -m build --wheel | ||
| 63 | - | ||
| 64 | - if [[ "$OSVER" == "macos-13" ]]; then | ||
| 65 | - export SDKROOT="${XCODE15PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk" | ||
| 66 | - export MACOSX_DEPLOYMENT_TARGET="14.0" | ||
| 67 | - VERBOSE=1 python -m build --wheel | ||
| 68 | - fi | ||
| 69 | - | ||
| 70 | - for file in ./dist/*.whl; do cp "$file" "${file/arm64.whl/aarch64.whl}"; done | ||
| 32 | + - name: Build wheels | ||
| 33 | + uses: pypa/cibuildwheel@v2.18.1 | ||
| 34 | + env: | ||
| 35 | + # disable repair | ||
| 36 | + CIBW_REPAIR_WHEEL_COMMAND: "" | ||
| 37 | + CIBW_ARCHS: "arm64" | ||
| 38 | + CIBW_ENVIRONMENT: CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_APPLE_SILICON_PROCESSOR=arm64 -DLLAMA_METAL=on" | ||
| 39 | + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | ||
| 40 | + with: | ||
| 41 | + package-dir: . | ||
| 42 | + output-dir: wheelhouse2 | ||
| 71 | 43 | ||
| 72 | - export CMAKE_OSX_ARCHITECTURES="x86_64" && export CMAKE_ARGS="-DLLAMA_NATIVE=off -DLLAMA_AVX=off -DLLAMA_AVX2=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DLLAMA_METAL=on" && export ARCHFLAGS="-arch x86_64" | ||
| 73 | - VERBOSE=1 python -m build --wheel | ||
| 44 | + - uses: actions/upload-artifact@v4 | ||
| 45 | + with: | ||
| 46 | + name: wheels-mac_${{ matrix.os }} | ||
| 47 | + path: ./wheelhouse2/*.whl | ||
| 74 | 48 | ||
| 75 | - if [[ "$OSVER" == "macos-13" ]]; then | ||
| 76 | - export SDKROOT="${XCODE15PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk" | ||
| 77 | - export MACOSX_DEPLOYMENT_TARGET="14.0" | ||
| 78 | - VERBOSE=1 python -m build --wheel | ||
| 79 | - fi | ||
| 49 | + release: | ||
| 50 | + name: Release | ||
| 51 | + needs: [build_wheels] | ||
| 52 | + runs-on: ubuntu-latest | ||
| 80 | 53 | ||
| 54 | + steps: | ||
| 55 | + - uses: actions/download-artifact@v4 | ||
| 56 | + with: | ||
| 57 | + merge-multiple: true | ||
| 58 | + path: dist2 | ||
| 59 | + | ||
| 81 | 60 | - uses: softprops/action-gh-release@v2 | |
| 82 | 61 | with: | |
| 83 | - files: dist/* | ||
| 62 | + files: dist2/* | ||
| 84 | 63 | # set release name to <tag>-metal | |
| 85 | 64 | tag_name: ${{ github.ref_name }}-metal | |
| 86 | 65 | env: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,8 @@ jobs: | |||
| 22 | 22 | - name: Set up Python | |
| 23 | 23 | uses: actions/setup-python@v5 | |
| 24 | 24 | with: | |
| 25 | - python-version: "3.8" | ||
| 25 | + python-version: "3.11" | ||
| 26 | + cache: 'pip' | ||
| 26 | 27 | - name: Append Dev Version to __version__ | |
| 27 | 28 | run: | | |
| 28 | 29 | DEV_VERSION=${{ github.event.inputs.dev_version }} | |
@@ -31,11 +32,11 @@ jobs: | |||
| 31 | 32 | sed -i 's/__version__ = \".*\"/__version__ = \"'"${NEW_VERSION}"'\"/' llama_cpp/__init__.py | |
| 32 | 33 | - name: Install dependencies | |
| 33 | 34 | run: | | |
| 34 | - python3 -m pip install --upgrade pip build | ||
| 35 | - python3 -m pip install -e .[all] | ||
| 35 | + python -m pip install --upgrade pip build | ||
| 36 | + python -m pip install -e .[all] | ||
| 36 | 37 | - name: Build source distribution | |
| 37 | 38 | run: | | |
| 38 | - python3 -m build --sdist | ||
| 39 | + python -m build --sdist | ||
| 39 | 40 | - name: Publish to Test PyPI | |
| 40 | 41 | uses: pypa/gh-action-pypi-publish@release/v1 | |
| 41 | 42 | with: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,14 +16,14 @@ jobs: | |||
| 16 | 16 | - name: Set up Python | |
| 17 | 17 | uses: actions/setup-python@v5 | |
| 18 | 18 | with: | |
| 19 | - python-version: "3.8" | ||
| 19 | + python-version: "3.9" | ||
| 20 | 20 | - name: Install dependencies | |
| 21 | 21 | run: | | |
| 22 | - python3 -m pip install --upgrade pip build | ||
| 23 | - python3 -m pip install -e .[all] | ||
| 22 | + python -m pip install --upgrade pip build | ||
| 23 | + python -m pip install -e .[all] | ||
| 24 | 24 | - name: Build source distribution | |
| 25 | 25 | run: | | |
| 26 | - python3 -m build --sdist | ||
| 26 | + python -m build --sdist | ||
| 27 | 27 | - name: Publish distribution to PyPI | |
| 28 | 28 | # TODO: move to tag based releases | |
| 29 | 29 | # if: startsWith(github.ref, 'refs/tags') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,57 +8,60 @@ jobs: | |||
| 8 | 8 | runs-on: ubuntu-latest | |
| 9 | 9 | strategy: | |
| 10 | 10 | matrix: | |
| 11 | - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 11 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 12 | 12 | ||
| 13 | 13 | steps: | |
| 14 | 14 | - name: Set up Python ${{ matrix.python-version }} | |
| 15 | 15 | uses: actions/setup-python@v5 | |
| 16 | 16 | with: | |
| 17 | 17 | python-version: ${{ matrix.python-version }} | |
| 18 | + cache: 'pip' | ||
| 18 | 19 | - name: Install dependencies | |
| 19 | 20 | run: | | |
| 20 | - python3 -m pip install --upgrade pip | ||
| 21 | - python3 -m pip install --verbose llama-cpp-python[all] | ||
| 21 | + python -m pip install --upgrade pip | ||
| 22 | + python -m pip install --verbose llama-cpp-python[all] | ||
| 22 | 23 | - name: Test with pytest | |
| 23 | 24 | run: | | |
| 24 | - python3 -c "import llama_cpp" | ||
| 25 | + python -c "import llama_cpp" | ||
| 25 | 26 | ||
| 26 | 27 | build-windows: | |
| 27 | 28 | ||
| 28 | 29 | runs-on: windows-latest | |
| 29 | 30 | strategy: | |
| 30 | 31 | matrix: | |
| 31 | - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 32 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 32 | 33 | ||
| 33 | 34 | steps: | |
| 34 | 35 | - name: Set up Python ${{ matrix.python-version }} | |
| 35 | 36 | uses: actions/setup-python@v5 | |
| 36 | 37 | with: | |
| 37 | 38 | python-version: ${{ matrix.python-version }} | |
| 39 | + cache: 'pip' | ||
| 38 | 40 | - name: Install dependencies | |
| 39 | 41 | run: | | |
| 40 | - python3 -m pip install --upgrade pip | ||
| 41 | - python3 -m pip install --verbose llama-cpp-python[all] | ||
| 42 | + python -m pip install --upgrade pip | ||
| 43 | + python -m pip install --verbose llama-cpp-python[all] | ||
| 42 | 44 | - name: Test with pytest | |
| 43 | 45 | run: | | |
| 44 | - python3 -c "import llama_cpp" | ||
| 46 | + python -c "import llama_cpp" | ||
| 45 | 47 | ||
| 46 | 48 | build-macos: | |
| 47 | 49 | ||
| 48 | 50 | runs-on: macos-latest | |
| 49 | 51 | strategy: | |
| 50 | 52 | matrix: | |
| 51 | - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 53 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 52 | 54 | ||
| 53 | 55 | steps: | |
| 54 | 56 | - name: Set up Python ${{ matrix.python-version }} | |
| 55 | 57 | uses: actions/setup-python@v5 | |
| 56 | 58 | with: | |
| 57 | 59 | python-version: ${{ matrix.python-version }} | |
| 60 | + cache: 'pip' | ||
| 58 | 61 | - name: Install dependencies | |
| 59 | 62 | run: | | |
| 60 | - python3 -m pip install --upgrade pip | ||
| 61 | - python3 -m pip install --verbose llama-cpp-python[all] | ||
| 63 | + python -m pip install --upgrade pip | ||
| 64 | + python -m pip install --verbose llama-cpp-python[all] | ||
| 62 | 65 | - name: Test with pytest | |
| 63 | 66 | run: | | |
| 64 | - python3 -c "import llama_cpp" | ||
| 67 | + python -c "import llama_cpp" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ jobs: | |||
| 14 | 14 | runs-on: ubuntu-latest | |
| 15 | 15 | strategy: | |
| 16 | 16 | matrix: | |
| 17 | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 17 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 18 | 18 | ||
| 19 | 19 | steps: | |
| 20 | 20 | - uses: actions/checkout@v4 | |
@@ -24,20 +24,21 @@ jobs: | |||
| 24 | 24 | uses: actions/setup-python@v5 | |
| 25 | 25 | with: | |
| 26 | 26 | python-version: ${{ matrix.python-version }} | |
| 27 | + cache: 'pip' | ||
| 27 | 28 | - name: Install dependencies | |
| 28 | 29 | run: | | |
| 29 | - python3 -m pip install --upgrade pip | ||
| 30 | - python3 -m pip install .[all] -v | ||
| 30 | + python -m pip install --upgrade pip | ||
| 31 | + python -m pip install .[all] -v | ||
| 31 | 32 | - name: Test with pytest | |
| 32 | 33 | run: | | |
| 33 | - python3 -m pytest | ||
| 34 | + python -m pytest | ||
| 34 | 35 | ||
| 35 | 36 | build-windows: | |
| 36 | 37 | ||
| 37 | 38 | runs-on: windows-latest | |
| 38 | 39 | strategy: | |
| 39 | 40 | matrix: | |
| 40 | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 41 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 41 | 42 | ||
| 42 | 43 | steps: | |
| 43 | 44 | - uses: actions/checkout@v4 | |
@@ -47,20 +48,21 @@ jobs: | |||
| 47 | 48 | uses: actions/setup-python@v5 | |
| 48 | 49 | with: | |
| 49 | 50 | python-version: ${{ matrix.python-version }} | |
| 51 | + cache: 'pip' | ||
| 50 | 52 | - name: Install dependencies | |
| 51 | 53 | run: | | |
| 52 | - python3 -m pip install --upgrade pip | ||
| 53 | - python3 -m pip install .[all] -v | ||
| 54 | + python -m pip install --upgrade pip | ||
| 55 | + python -m pip install .[all] -v | ||
| 54 | 56 | - name: Test with pytest | |
| 55 | 57 | run: | | |
| 56 | - python3 -m pytest | ||
| 58 | + python -m pytest | ||
| 57 | 59 | ||
| 58 | 60 | build-macos: | |
| 59 | 61 | ||
| 60 | - runs-on: macos-13 | ||
| 62 | + runs-on: macos-latest | ||
| 61 | 63 | strategy: | |
| 62 | 64 | matrix: | |
| 63 | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 65 | + python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
| 64 | 66 | ||
| 65 | 67 | steps: | |
| 66 | 68 | - uses: actions/checkout@v4 | |
@@ -70,13 +72,14 @@ jobs: | |||
| 70 | 72 | uses: actions/setup-python@v5 | |
| 71 | 73 | with: | |
| 72 | 74 | python-version: ${{ matrix.python-version }} | |
| 75 | + cache: 'pip' | ||
| 73 | 76 | - name: Install dependencies | |
| 74 | 77 | run: | | |
| 75 | - python3 -m pip install --upgrade pip | ||
| 76 | - python3 -m pip install .[all] --verbose | ||
| 78 | + python -m pip install --upgrade pip | ||
| 79 | + python -m pip install .[all] --verbose | ||
| 77 | 80 | - name: Test with pytest | |
| 78 | 81 | run: | | |
| 79 | - python3 -m pytest | ||
| 82 | + python -m pytest | ||
| 80 | 83 | ||
| 81 | 84 | # build-linux-opencl: | |
| 82 | 85 | ||
@@ -98,29 +101,29 @@ jobs: | |||
| 98 | 101 | # sudo apt-get install -y --no-install-recommends llvm intel-oneapi-runtime-opencl intel-oneapi-runtime-compilers libclblast-dev | |
| 99 | 102 | # - name: Install dependencies | |
| 100 | 103 | # run: | | |
| 101 | - # python3 -m pip install --upgrade pip | ||
| 102 | - # CMAKE_ARGS="-DLLAMA_CLBLAST=on" python3 -m pip install .[all] --verbose | ||
| 104 | + # python -m pip install --upgrade pip | ||
| 105 | + # CMAKE_ARGS="-DLLAMA_CLBLAST=on" python -m pip install .[all] --verbose | ||
| 103 | 106 | # - name: Test with pytest | |
| 104 | 107 | # run: | | |
| 105 | - # python3 -m pytest | ||
| 108 | + # python -m pytest | ||
| 106 | 109 | ||
| 107 | 110 | ||
| 108 | 111 | build-macos-metal: | |
| 109 | 112 | ||
| 110 | - runs-on: macos-13 | ||
| 113 | + runs-on: macos-latest | ||
| 111 | 114 | ||
| 112 | 115 | steps: | |
| 113 | 116 | - uses: actions/checkout@v4 | |
| 114 | 117 | with: | |
| 115 | 118 | submodules: "recursive" | |
| 116 | - - name: Set up Python 3.8 | ||
| 119 | + - name: Set up Python 3.9 | ||
| 117 | 120 | uses: actions/setup-python@v5 | |
| 118 | 121 | with: | |
| 119 | - python-version: "3.8" | ||
| 122 | + python-version: "3.9" | ||
| 120 | 123 | - name: Install dependencies | |
| 121 | 124 | run: | | |
| 122 | - python3 -m pip install --upgrade pip | ||
| 123 | - CMAKE_ARGS="-DLLAMA_METAL=on" python3 -m pip install .[all] --verbose | ||
| 125 | + python -m pip install --upgrade pip | ||
| 126 | + CMAKE_ARGS="-DLLAMA_METAL=on" python -m pip install .[all] --verbose | ||
| 124 | 127 | - name: Test with pytest | |
| 125 | 128 | run: | | |
| 126 | - python3 -m pytest | ||
| 129 | + python -m pytest | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments