Skip to content

Nightly Build Fix

Nightly Build Fix #87

Workflow file for this run

name: PyPI Nightly Build
on:
schedule:
- cron: '0 0 * * *' # Runs at midnight UTC every day
workflow_dispatch:
### Comment this out before merge
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: regression_test-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
cancel-in-progress: true
###
jobs:
build-and-publish:
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
secrets: inherit
with:
runner: linux.g5.12xlarge.nvidia.gpu
gpu-arch-type: cuda
gpu-arch-version: "12.1"
secrets-env: PYPI_API_TOKEN
docker-image: "pytorch/manylinux-builder:cuda12.1"
script: |
# Install conda
PYTHON_VERSION=3.9
MINICONDA_VERSION=24.3.0-0
BASE_URL="https://repo.anaconda.com/miniconda"
CONDA_FILE="Miniconda3-py${PYTHON_VERSION//./}_${MINICONDA_VERSION}-Linux-x86_64.sh"
mkdir -p /opt/conda
pushd /tmp
wget -q "${BASE_URL}/${CONDA_FILE}"
bash "${CONDA_FILE}" -b -f -p "/opt/conda"
rm "${CONDA_FILE}"
popd
sed -e 's|PATH="\(.*\)"|PATH="/opt/conda/bin:\1"|g' -i /etc/environment
export PATH="/opt/conda/bin:$PATH"
conda init
source /opt/conda/etc/profile.d/conda.sh
# Install dependencies
conda create -n venv python=3.9 -y
conda activate venv
echo "::group::Install newer objcopy that supports --set-section-alignment"
yum install -y devtoolset-10-binutils
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install torch
pip install -r requirements.txt
pip install -r dev-requirements.txt
# Create wheel file
export TORCHAO_NIGHTLY=1
python setup.py sdist bdist_wheel
# Binary validation
# pip install dist/torchao*.whl
# pytest test --verbose -s
# Upload
REPOSITORY_URL="https://upload.pypi.org/legacy/"
twine upload --repository-url $REPOSITORY_URL -u __token__ -p $SECRET_PYPI_API_TOKEN dist/*