8000 feat(ci): Speed up CI workflows using `uv`, add support for CUDA 12.5… · asusevski/llama-cpp-python@e529940 · GitHub
[go: up one dir, main page]

Skip to content
  • Commit e529940

    Browse files
    Smartappliabetlen
    andauthored
    feat(ci): Speed up CI workflows using uv, add support for CUDA 12.5 wheels
    * Update build-wheels-cuda.yaml * Update build-wheels-cuda.yaml * revert * Bump pyhton from 3.8 to 3.9 * Remove python 3.8 * Remove Python 3.7 and 3.8 deprecated * Bump python from 3.8 to 3.9 * Add python 3.9 * Add python 3.9, remove macos-11 deprecated, add macos-14 * Bump python 3.8 to 3.9 * Add python 3.13 * Add python 3.13 * python 3.13 remove * remove python 3.13 * remove python 3.8 * Bump macos-13 to macos-14 * Update build-wheels-metal.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update generate-index-from-release.yaml Add avx, avx2 and avx512 * Update test.yaml * Update test-pypi.yaml * Update publish.yaml * Update publish-to-test.yaml * Update build-wheels-cuda.yaml Cuda with AVX2 by default * Update build-wheels-cuda.yaml * remove DEPRECATED 32 bits * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml Upgrade matrix os to latest version * Update build-wheels-metal.yaml * Update build-wheels-cuda.yaml * Update test.yaml * Update test-pypi.yaml * Update test.yaml Add cache: 'pip' * Update publish-to-test.yaml * Update build-wheels-metal.yaml Add cache: 'pip' * Update build-wheels-cuda.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml remove x86_64 * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * revert * Remove cpu variants * Update build-wheels-metal.yaml * Update build-and-release.yaml * Update publish-to-test.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update publish.yaml * Update test-pypi.yaml * Update test.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update publish.yaml * Update test-pypi.yaml * Update publish-to-test.yaml * Update test.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update publish-to-test.yaml * Update publish.yaml * Update test-pypi.yaml * Update test.yaml * Update test.yaml * Update build-and-release.yaml * Update publish-to-test.yaml * Update build-wheels-metal.yaml * Update test-pypi.yaml * Update test.yaml * Update build-and-release.yaml * Update build-wheels-metal.yaml * Update build-wheels-metal.yaml * Update publish.yaml * Update publish-to-test.yaml * Update test-pypi.yaml * Update test.yaml * Update build-wheels-cuda.yaml * Update generate-index-from-release.yaml * Update README.md * Update README.md * Update test.yaml --------- Co-authored-by: Andrei Betlen <abetlen@gmail.com>
    1 parent c032fc6 commit e529940

    File tree

    9 files changed

    +217
    -31
    lines changed

    9 files changed

    +217
    -31
    lines changed

    .github/workflows/build-and-release.yaml

    Lines changed: 37 additions & 7 deletions
    Original file line numberDiff line numberDiff line change
    @@ -21,12 +21,25 @@ jobs:
    2121
    # Used to host cibuildwheel
    2222
    - uses: actions/setup-python@v5
    2323
    with:
    24-
    python-version: "3.8"
    24+
    python-version: "3.9"
    2525

    26-
    - name: Install dependencies
    26+
    - name: Install dependencies (Linux/MacOS)
    27+
    if: runner.os != 'Windows'
    2728
    run: |
    2829
    python -m pip install --upgrade pip
    29-
    python -m pip install -e .[all]
    30+
    python -m pip install uv
    31+
    RUST_LOG=trace python -m uv pip install -e .[all] --verbose
    32+
    shell: bash
    33+
    34+
    - name: Install dependencies (Windows)
    35+
    if: runner.os == 'Windows'
    36+
    env:
    37+
    RUST_LOG: trace
    38+
    run: |
    39+
    python -m pip install --upgrade pip
    40+
    python -m pip install uv
    41+
    python -m uv pip install -e .[all] --verbose
    42+
    shell: cmd
    3043

    3144
    - name: Build wheels
    3245
    uses: pypa/cibuildwheel@v2.20.0
    @@ -79,16 +92,33 @@ jobs:
    7992
    - uses: actions/checkout@v4
    8093
    with:
    8194
    submodules: "recursive"
    95+
    8296
    - uses: actions/setup-python@v5
    8397
    with:
    84-
    python-version: "3.8"
    85-
    - name: Install dependencies
    98+
    python-version: "3.9"
    99+
    100+
    - name: Install dependencies (Linux/MacOS)
    101+
    if: runner.os != 'Windows'
    86102
    run: |
    87-
    python -m pip install --upgrade pip build
    88-
    python -m pip install -e .[all]
    103+
    python -m pip install --upgrade pip
    104+
    python -m pip install uv
    105+
    RUST_LOG=trace python -m uv pip install -e .[all] --verbose
    106+
    shell: bash
    107+
    108+
    - name: Install dependencies (Windows)
    109+
    if: runner.os == 'Windows'
    110+
    env:
    111+
    RUST_LOG: trace
    112+
    run: |
    113+
    python -m pip install --upgrade pip
    114+
    python -m pip install uv
    115+
    python -m uv pip install -e .[all] --verbose
    116+
    shell: cmd
    117+
    89118
    - name: Build source distribution
    90119
    run: |
    91120
    python -m build --sdist
    121+
    92122
    - uses: actions/upload-artifact@v4
    93123
    with:
    94124
    name: sdist

    .github/workflows/build-wheels-cuda.yaml

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -22,7 +22,7 @@ jobs:
    2222
    $matrix = @{
    2323
    'os' = @('ubuntu-latest', 'windows-2019')
    2424
    'pyver' = @("3.9", "3.10", "3.11", "3.12")
    25-
    'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1")
    25+
    'cuda' = @("12.1.1", "12.2.2", "12.3.2", "12.4.1", "12.5.0")
    2626
    'releasetag' = @("basic")
    2727
    }
    2828

    .github/workflows/build-wheels-metal.yaml

    Lines changed: 15 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -23,11 +23,24 @@ jobs:
    2323
    with:
    2424
    python-version: "3.12"
    2525
    cache: 'pip'
    26+
    27+
    - name: Install dependencies (Linux/MacOS)
    28+
    if: runner.os != 'Windows'
    29+
    run: |
    30+
    python -m pip install --upgrade pip
    31+
    python -m pip install uv
    32+
    RUST_LOG=trace python -m uv pip install -e .[all] --verbose
    33+
    shell: bash
    2634

    27-
    - name: Install dependencies
    35+
    - name: Install dependencies (Windows)
    36+
    if: runner.os == 'Windows'
    37+
    env:
    38+
    RUST_LOG: trace
    2839
    run: |
    2940
    python -m pip install --upgrade pip
    30-
    python -m pip install -e .[all]
    41+
    python -m pip install uv
    42+
    python -m uv pip install -e .[all] --verbose
    43+
    shell: cmd
    3144

    3245
    - name: Build wheels
    3346
    uses: pypa/cibuildwheel@v2.20.0

    .github/workflows/generate-index-from-release.yaml

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -44,6 +44,7 @@ jobs:
    4444
    ./scripts/releases-to-pep-503.sh index/whl/cu122 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu122$'
    4545
    ./scripts/releases-to-pep-503.sh index/whl/cu123 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu123$'
    4646
    ./scripts/releases-to-pep-503.sh index/whl/cu124 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu124$'
    47+
    ./scripts/releases-to-pep-503.sh index/whl/cu125 '^[v]?[0-9]+\.[0-9]+\.[0-9]+-cu125$'
    4748
    ./scripts/releases-to-pep-503.sh index/whl/metal '^[v]?[0-9]+\.[0-9]+\.[0-9]+-metal$'
    4849
    - name: Upload artifact
    4950
    uses: actions/upload-pages-artifact@v3

    .github/workflows/publish-to-test.yaml

    Lines changed: 21 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -19,24 +19,42 @@ jobs:
    1919
    - uses: actions/checkout@v4
    2020
    with:
    2121
    submodules: "recursive"
    22+
    2223
    - name: Set up Python
    2324
    uses: actions/setup-python@v5
    2425
    with:
    2526
    python-version: "3.11"
    2627
    cache: 'pip'
    28+
    2729
    - name: Append Dev Version to __version__
    2830
    run: |
    2931
    DEV_VERSION=${{ github.event.inputs.dev_version }}
    3032
    CURRENT_VERSION=$(awk -F= '/__version__ =/ {print $2}' llama_cpp/__init__.py | tr -d ' "')
    3133
    NEW_VERSION="${CURRENT_VERSION}.dev${DEV_VERSION}"
    3234
    sed -i 's/__version__ = \".*\"/__version__ = \"'"${NEW_VERSION}"'\"/' llama_cpp/__init__.py
    33-
    - name: Install dependencies
    35+
    36+
    - name: Install dependencies (Linux/MacOS)
    37+
    if: runner.os != 'Windows'
    3438
    run: |
    35-
    python -m pip install --upgrade pip build
    36-
    python -m pip install -e .[all]
    39+
    python -m pip install --upgrade pip
    40+
    python -m pip install uv
    41+
    RUST_LOG=trace python -m uv pip install -e .[all] --verbose
    42+
    shell: bash
    43+
    44+
    - name: Install dependencies (Windows)
    45+
    if: runner.os == 'Windows'
    46+
    env:
    47+
    RUST_LOG: trace
    48+
    run: |
    49+
    python -m pip install --upgrade pip
    50+
    python -m pip install uv
    51+
    python -m uv pip install -e .[all] --verbose
    52+
    shell: cmd
    53+
    3754
    - name: Build source distribution
    3855
    run: |
    3956
    python -m build --sdist
    57+
    4058
    - name: Publish to Test PyPI
    4159
    uses: pypa/gh-action-pypi-publish@release/v1
    4260
    with:

    .github/workflows/publish.yaml

    Lines changed: 20 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -13,17 +13,34 @@ jobs:
    1313
    - uses: actions/checkout@v4
    1414
    with:
    1515
    submodules: "recursive"
    16+
    1617
    - name: Set up Python
    1718
    uses: actions/setup-python@v5
    1819
    with:
    1920
    python-version: "3.9"
    20-
    - name: Install dependencies
    21+
    22+
    - name: Install dependencies (Linux/MacOS)
    23+
    if: runner.os != 'Windows'
    2124
    run: |
    22-
    python -m pip install --upgrade pip build
    23-
    python -m pip install -e .[all]
    25+
    python -m pip install --upgrade pip
    26+
    python -m pip install uv
    27+
    RUST_LOG=trace python -m uv pip install -e .[all] --verbose
    28+
    shell: bash
    29+
    30+
    - name: Install dependencies (Windows)
    31+
    if: runner.os == 'Windows'
    32+
    env:
    33+
    RUST_LOG: trace
    34+
    run: |
    35+
    python -m pip install --upgrade pip
    36+
    python -m pip install uv
    37+
    python -m uv pip install -e .[all] --verbose
    38+
    shell: cmd
    39+
    2440
    - name: Build source distribution
    2541
    run: |
    2642
    python -m build --sdist
    43+
    2744
    - name: Publish distribution to PyPI
    2845
    # TODO: move to tag based releases
    2946
    # if: startsWith(github.ref, 'refs/tags')

    .github/workflows/test-pypi.yaml

    Lines changed: 52 additions & 7 deletions
    Original file line numberDiff line numberDiff line change
    @@ -16,10 +16,25 @@ jobs:
    1616
    with:
    1717
    python-version: ${{ matrix.python-version }}
    1818
    cache: 'pip'
    19-
    - name: Install dependencies
    19+
    20+
    - name: Install dependencies (Linux/MacOS)
    21+
    if: runner.os != 'Windows'
    22+
    run: |
    23+
    python -m pip install --upgrade pip
    24+
    python -m pip install uv
    25+
    RUST_LOG=trace python -m uv pip install llama-cpp-python[all] --verbose
    26+
    shell: bash
    27+
    28+
    - name: Install dependencies (Windows)
    29+
    if: runner.os == 'Windows'
    30+
    env:
    31+
    RUST_LOG: trace
    2032
    run: |
    2133
    python -m pip install --upgrade pip
    22-
    python -m pip install --verbose llama-cpp-python[all]
    34+
    python -m pip install uv
    35+
    python -m uv pip install llama-cpp-python[all] --verbose
    36+
    shell: cmd
    37+
    2338
    - name: Test with pytest
    24< 38AC /td>39
    run: |
    2540
    python -c "import llama_cpp"
    @@ -37,10 +52,25 @@ jobs:
    3752
    with:
    3853
    python-version: ${{ matrix.python-version }}
    3954
    cache: 'pip'
    40-
    - name: Install dependencies
    55+
    56+
    - name: Install dependencies (Linux/MacOS)
    57+
    if: runner.os != 'Windows'
    58+
    run: |
    59+
    python -m pip install --upgrade pip
    60+
    python -m pip install uv
    61+
    RUST_LOG=trace python -m uv pip install llama-cpp-python[all] --verbose
    62+
    shell: bash
    63+
    64+
    - name: Install dependencies (Windows)
    65+
    if: runner.os == 'Windows'
    66+
    env:
    67+
    RUST_LOG: trace
    4168
    run: |
    4269
    python -m pip install --upgrade pip
    43-
    python -m pip install --verbose llama-cpp-python[all]
    70+
    python -m pip install uv
    71+
    python -m uv pip install llama-cpp-python[all] --verbose
    72+
    shell: cmd
    73+
    4474
    - name: Test with pytest
    4575
    run: |
    4676
    python -c "import llama_cpp"
    @@ -57,11 +87,26 @@ jobs:
    5787
    uses: actions/setup-python@v5
    5888
    with:
    5989
    python-version: ${{ matrix.python-version }}
    60-
    cache: 'pip'
    61-
    - name: Install dependencies
    90+
    cache: 'pip'
    91+
    92+
    - name: Install dependencies (Linux/MacOS)
    93+
    if: runner.os != 'Windows'
    94+
    run: |
    95+
    python -m pip install --upgrade pip
    96+
    python -m pip install uv
    97+
    RUST_LOG=trace python -m uv pip install llama-cpp-python[all] --verbose
    98+
    shell: bash
    99+
    100+
    - name: Install dependencies (Windows)
    101+
    if: runner.os == 'Windows'
    102+
    env:
    103+
    RUST_LOG: trace
    62104
    run: |
    63105
    python -m pip install --upgrade pip
    64-
    python -m pip install --verbose llama-cpp-python[all]
    106+
    python -m pip install uv
    107+
    python -m uv pip install llama-cpp-python[all] --verbose
    108+
    shell: cmd
    109+
    65110
    - name: Test with pytest
    66111
    run: |
    67112
    python -c "import llama_cpp"

    0 commit comments

    Comments
     (0)
    0