diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e374035c..de3596ca 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,31 +2,14 @@ name: PYPI Release on: workflow_dispatch: - release: - types: [created] jobs: - release: + build_and_publish: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - - name: Assert vX.X.X tag - run: | - if [[ ! $GITHUB_REF =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Tag name must be vX.X.X" - exit 1 - fi - - - name: Assert matching versions - run: | - VERSION=$(echo $GITHUB_REF | sed -E 's/^refs\/tags\/v([0-9]+\.[0-9]+\.[0-9]+)$/\1/') - if [[ $(grep -E '__version__ = "[0-9]+\.[0-9]+\.[0-9]+"' optimum_benchmark/version.py) != "__version__ = \"$VERSION\"" ]]; then - echo "Version in tag does not match version in optimum_benchmark/version.py" - exit 1 - fi - - name: Set up Python 3.10 uses: actions/setup-python@v3 with: @@ -56,11 +39,12 @@ jobs: - name: Install the wheel run: | + pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu pip install dist/*.whl - name: Test run: | - optimum-benchmark --config-dir examples --config-name pytorch_bert backend.device=cpu + optimum-benchmark --config-dir examples --config-name pytorch_bert backend.device=cpu launcher.device_isolation=false - name: Publish env: diff --git a/.github/workflows/test_cli_rocm_pytorch_multi_gpu.yaml b/.github/workflows/test_cli_rocm_pytorch_multi_gpu.yaml index ccf57576..aee4853e 100644 --- a/.github/workflows/test_cli_rocm_pytorch_multi_gpu.yaml +++ b/.github/workflows/test_cli_rocm_pytorch_multi_gpu.yaml @@ -63,5 +63,5 @@ jobs: --volume ${{ github.workspace }}:/workspace --workdir /workspace run: | - pip install -e .[testing,diffusers,timm,deepspeed,peft,autoawq-rocm,auto-gptq-rocm] + pip install -e .[testing,diffusers,timm,deepspeed,peft,autoawq,auto-gptq] pytest -x -s -k "cli and cuda and pytorch and (dp or ddp or device_map or deepspeed) and not (bnb or awq)" diff --git a/.github/workflows/test_cli_rocm_pytorch_single_gpu.yaml b/.github/workflows/test_cli_rocm_pytorch_single_gpu.yaml index 152d99e1..10674b68 100644 --- a/.github/workflows/test_cli_rocm_pytorch_single_gpu.yaml +++ b/.github/workflows/test_cli_rocm_pytorch_single_gpu.yaml @@ -59,5 +59,5 @@ jobs: --volume ${{ github.workspace }}:/workspace --workdir /workspace run: | - pip install -e .[testing,diffusers,timm,peft,autoawq-rocm,auto-gptq-rocm] + pip install -e .[testing,diffusers,timm,peft,autoawq,auto-gptq] pytest -x -s -k "cli and cuda and pytorch and not (dp or ddp or device_map or deepspeed) and not (bnb or awq)" diff --git a/README.md b/README.md index 3c2142bd..b1face7b 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,6 @@ We also support the following extra extra dependencies: - autoawq - auto-gptq -- autoawq-rocm -- auto-gptq-rocm - sentence-transformers - bitsandbytes - codecarbon diff --git a/setup.py b/setup.py index 964209e4..900ce99b 100644 --- a/setup.py +++ b/setup.py @@ -58,11 +58,12 @@ "Please install amdsmi from https://github.com/ROCm/amdsmi to enable this feature." ) -AUTOGPTQ_CUDA = "auto-gptq==0.7.1" -AUTOGPTQ_ROCM = "auto-gptq@https://huggingface.github.io/autogptq-index/whl/rocm573/auto-gptq/auto_gptq-0.7.1%2Brocm5.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" - -AUTOAWQ_CUDA = "autoawq==0.2.1" -AUTOAWQ_ROCM = "autoawq@https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.1/autoawq-0.2.1+rocm571-cp310-cp310-linux_x86_64.whl" +if USE_ROCM: + AUTOAWQ = "autoawq@https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.1/autoawq-0.2.1+rocm571-cp310-cp310-linux_x86_64.whl" + AUTOGPTQ = "auto-gptq@https://huggingface.github.io/autogptq-index/whl/rocm573/auto-gptq/auto_gptq-0.7.1%2Brocm5.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl" +else: + AUTOAWQ = "autoawq==0.2.1" + AUTOGPTQ = "auto-gptq==0.7.1" EXTRAS_REQUIRE = { "quality": ["ruff"], @@ -74,14 +75,12 @@ "neural-compressor": [f"optimum[neural-compressor]>={MIN_OPTIMUM_VERSION}"], "torch-ort": ["torch-ort", "onnxruntime-training", f"optimum>={MIN_OPTIMUM_VERSION}"], # other backends - "llm-swarm": ["llm-swarm@git+https://github.com/huggingface/llm-swarm.git"], - "py-txi": ["py-txi@git+https://github.com/IlyasMoutawwakil/py-txi.git"], + "llm-swarm": ["llm-swarm"], + "py-txi": ["py-txi"], "vllm": ["vllm"], # optional dependencies - "autoawq": [AUTOAWQ_CUDA], - "autoawq-rocm": [AUTOAWQ_ROCM], - "auto-gptq": ["optimum", AUTOGPTQ_CUDA], - "auto-gptq-rocm": ["optimum", AUTOGPTQ_ROCM], + "autoawq": [AUTOAWQ], + "auto-gptq": ["optimum", AUTOGPTQ], "sentence-transformers": ["sentence-transformers"], "bitsandbytes": ["bitsandbytes"], "codecarbon": ["codecarbon"],