diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a099ae75..48976020d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,7 @@ jobs: export UV_PYTHON=3.14 echo "UV_PYTHON=3.14" >> "$GITHUB_ENV" - env_name="py314_release_source" + env_name="gptqmodel_py314_release_source" /opt/uv/setup_uv_venv.sh $env_name - name: Fetch PR by number @@ -134,6 +134,12 @@ jobs: echo "PKG_NAME=$pkg" >> "$GITHUB_ENV" twine check "dist/$pkg" + - name: test installation + run: | + uv venv local_uv_env + source local_uv_env/bin/activate + uv pip install "dist/${{ env.PKG_NAME }}" torch + - name: Upload to local continue-on-error: true run: | diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 60638fbe8..d4f28cd0a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -466,147 +466,46 @@ jobs: run: | rm -rf rm -rf ./* .[^.] .??* -# show-statistics: -# runs-on: [ self-hosted, xeon5 ] -# if: always() && inputs['exclusive-gpu'] && !cancelled() -# container: -# image: modelcloud/gptqmodel:alpine-ci-v1 -# needs: -# - torch -# steps: -# - name: Print statistics -# run: curl "http://$RUNNER/gpu/get_vram_logs?id=${{ github.run_id }}" - -# m4: -# runs-on: [ self-hosted, m4 ] -# needs: -# - check-vm -# - list-test-files -# if: false && (github.event.inputs.test_names == '' || contains(github.event.inputs.test_names, 'apple') || contains(github.event.inputs.test_names, 'mlx') ) && (needs.list-test-files.outputs.m4-files != '' && needs.list-test-files.outputs.m4-files != '[]') && !cancelled() -# strategy: -# fail-fast: false -# matrix: -# test_script: ${{ fromJSON(needs.list-test-files.outputs.m4-files) }} -# steps: -# - name: Print Env -# run: | -# echo "repo: ${{ env.repo }}" -# echo "ref: ${{ env.ref }}" -# ls -ahl . -# -# - name: Checkout Codes -# uses: actions/checkout@v6 -# with: -# repository: ${{ env.repo }} -# ref: ${{ env.ref }} -# -# - name: Run test -# run: | -# export PATH="/opt/homebrew/bin:$PATH" && eval "$(pyenv init -)" -# rm -rf venv || true -# -# echo "=== checking models dir is mounted" -# ls ../../../monster -# -# echo "=== activating venv" -# pyenv global 3.11.11 && python -m venv venv -# source venv/bin/activate -# -# rm profile.sb || true -# -# curl -O http://$RUNNER/scripts/m4/profile.sb -# -# echo "=== installing uv setuptools build" -# pip install setuptools build -U -i http://$RUNNER/simple --trusted-host $RUNNER --extra-index-url https://pypi.org/simple -# -# echo "=== installing test tools" -# uv pip install pytest parameterized vllm device-smi mlx-lm -U -i http://$RUNNER/simple/ --trusted-host $RUNNER --extra-index-url https://pypi.org/simple -# -# echo "=== installing gptqmodel" -# uv pip install . -i http://$RUNNER/simple/ --trusted-host $RUNNER --extra-index-url https://pypi.org/simple -# -# echo "replacing model path" -# find tests -name "*.py" -exec sed -i '' 's/\/monster\/data\/model/..\/..\/..\/monster/g' {} + -# -# TEST=${{ matrix.test_script }} -# if [[ ! "$TEST" == *.py ]]; then -# TEST="$TEST.py" -# fi -# echo "=== running test: $TEST" -# pytest tests/$TEST -# -# - name: Clean cache -# if: always() -# run: | -# source venv/bin/activate && pip cache purge && uv cache clean || true -# rm -rf ../GPTQModel && mkdir ../GPTQModel -# -# mac-test: -# runs-on: macos-latest -# env: -# CUDA_VISIBLE_DEVICES: '' -# TORCH_CUDA_ARCH_LIST: '' -# MAX_JOBS: 3 -# BUILD_QQQ: 0 -# BUILD_EORA: 0 -# GPTQMODEL_BUILD_EXLLAMA_V1: 0 -# GPTQMODEL_BUILD_EORA: 0 -# GPTQMODEL_FORCE_BUILD: 0 -# steps: -# - name: Checkout Codes -# uses: actions/checkout@v6 -# -# - uses: actions/setup-python@v6 -# with: -# python-version: 3.12 -# cache: 'pip' -# -## it wastes too much time to find which exactly one caused installation failed, just unset them all..... -# - name: Install dependencies -# run: | -# unset CUDA_DEVICE_ORDER -# unset CUDA_VISIBLE_DEVICES -# unset TORCH_CUDA_ARCH_LIST -# unset PYTORCH_ALLOC_CONF -# unset MAX_JOBS -# unset RUNNER -# unset XEON5 -# unset UV_INDEX_URL -# unset CUDA_VERSION -# unset TORCH_VERSION -# unset PYTHON_VERSION -# unset # PYTHON_GIL -# unset BUILD_QQQ -# unset BUILD_EORA -# unset GPTQMODEL_BUILD_EXLLAMA_V1 -# unset GPTQMODEL_BUILD_EORA -# unset LEGACY_TESTS -# unset IGNORED_TEST_FILES -# unset GPTQMODEL_FORCE_BUILD -# unset repo -# unset ref -# -# python -V -# python -m venv venv -# source venv/bin/activate -# pip install pip uv setuptools build wheel torch -U -# pip install meson-python -U -# pip install numpy==2.2.6 -U -# -# uv pip install -e . -# pip install pip Pillow device_smi pypcre tokenicer threadpoolctl accelerate logbar transformers optimum torch -U -# -# - name: Run test -# run: | -# source venv/bin/activate -# python - <<'PY' -# import os -# from transformers import pipeline -# os.environ["CUDA_VISIBLE_DEVICES"] = "" -# os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1" -# llm_pipeline = pipeline(model="JunHowie/Qwen3-0.6B-GPTQ-Int4") -# output = llm_pipeline("Which city is the capital of France?", max_new_tokens=100) -# print(output) -# -# assert "paris" in output.lower() -# PY + torch-test: + runs-on: [ self-hosted, xeon5 ] + container: + image: 10.0.13.31:5000/nvidia/cuda:130-ubuntu24.04_0325 + options: --device /dev/dri --ipc=host --runtime=nvidia --gpus all + volumes: + - /monster/ci/env/entrypoint.sh:/entrypoint.sh + - /monster/ci/env/entrypoint.sh:/etc/profile.d/01-entrypoint.sh + - /dev/dri/by-path:/dev/dri/by-path + - /monster/ci/uv:/opt/uv + - /monster/ci/env:/opt/env + steps: + - name: Checkout Codes + uses: actions/checkout@v6 + with: + repository: ${{ env.repo }} + ref: ${{ env.ref }} + + - name: Test pypi pip + run: | + uv venv pypi_pip_env + source pypi_pip_env/bin/activate + uv pip install pip -U + pip install gptqmodel torch -U + + - name: Test pypi uv + run: | + uv venv pypi_uv_env + source pypi_uv_env/bin/activate + uv pip install gptqmodel torch -U + + - name: test local pip + run: | + uv venv local_pip_env + source local_pip_env/bin/activate + uv pip install pip -U + pip install . torch -U + + - name: test local uv + run: | + uv venv local_uv_env + source local_uv_env/bin/activate + uv pip install . torch -U