Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/actions/setup-uv-project/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: setup-uv-project
description: Install uv and set up the project with its dependencies

inputs:
python-version:
description: 'Python version to use'
required: false
default: '3.11'

runs:
using: composite
steps:
Expand All @@ -10,6 +16,7 @@ runs:
activate-environment: true
enable-cache: true
github-token: ${{ github.token }}
python-version: ${{ inputs.python-version }}

- shell: bash
run: uv sync --extra dev --extra lmharness --extra vllm
run: uv sync --extra dev --extra lmharness --extra vllm
5 changes: 1 addition & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-uv-project
with:
python-version: ${{ matrix.python-version }}

- uses: ./.github/actions/setup-uv-project

- name: Run generation script
run: python docs/utils/gen_docs.py

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-uv-project
with:
python-version: ${{ matrix.python-version }}

- uses: ./.github/actions/setup-uv-project
10 changes: 2 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-uv-project
with:
python-version: ${{ matrix.python-version }}

- uses: ./.github/actions/setup-uv-project

- name: Get changed Python files
id: changed-files
uses: tj-actions/changed-files@v47
Expand Down Expand Up @@ -80,13 +77,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
- uses: ./.github/actions/setup-uv-project
with:
python-version: ${{ matrix.python-version }}

- uses: ./.github/actions/setup-uv-project

- name: Cache Hugging Face datasets and models
uses: actions/cache@v5
with:
Expand Down
34 changes: 27 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@ testpaths = [

[[tool.uv.index]]
name = "pypi"
url = "https://pypi.org/simple" # regular PyPI
url = "https://pypi.org/simple"
default = true

[[tool.uv.index]]
name = "pruna_internal"
url = "https://prunaai.pythonanywhere.com/simple/" # Pruna Pythonanywhere
default = true # default = True makes this index the lowest prio
url = "https://prunaai.pythonanywhere.com/simple/"
explicit = true

[[tool.uv.index]]
name = "intel-pytorch-extension"
url = "https://pytorch-extension.intel.com/release-whl/stable/cpu/cn/"
explicit = true

[tool.uv]
index-strategy = "unsafe-best-match"
index-strategy = "first-index"

conflicts = [
[
Expand All @@ -87,13 +89,26 @@ conflicts = [
{ extra = "vllm" },
{ extra = "vbench" },
],
[
{ extra = "stable-fast-extraindex" },
{ extra = "stable-fast" },
],
[
{ extra = "stable-fast-extraindex" },
{ extra = "full" },
],
]

[tool.uv.sources]
gptqmodel = [
{ index = "pruna_internal", marker = "sys_platform != 'darwin' or platform_machine != 'arm64'"},
{ index = "pypi", marker = "sys_platform == 'darwin' and platform_machine == 'arm64'"},
]
intel-extension-for-pytorch = { index = "intel-pytorch-extension" }
stable-fast-pruna = [
{ index = "pruna_internal", extra = "stable-fast-extraindex" },
{ index = "pypi", extra = "stable-fast" },
]

[project]
name = "pruna"
Expand Down Expand Up @@ -167,7 +182,13 @@ vllm = [
]
stable-fast = [
"xformers>=0.0.30",
"stable-fast-pruna==1.0.8",
"stable-fast-pruna>=1.0.8,<1.0.9",
]
# stable-fast-pruna from pythonanywhere (torch/CUDA line wheels); same version band as stable-fast, different index via [tool.uv.sources].
# Linux x86_64 only where those wheels are published; mutually exclusive with stable-fast/full.
stable-fast-extraindex = [
"xformers>=0.0.30",
"stable-fast-pruna>=1.0.8,<1.0.9; sys_platform == 'linux' and platform_machine == 'x86_64'",
]
# dependencies are added here because the wheels aren't bundling them
gptq = [
Expand All @@ -185,8 +206,7 @@ awq = [
"torch>=2.9.0"
]
full = [
"xformers>=0.0.30",
"stable-fast-pruna==1.0.8",
"pruna[stable-fast]",
]
vbench = [
"vbench-pruna; sys_platform != 'darwin'",
Expand Down
Loading