Push Binary Release #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
name: Push Binary Release | ||
on: | ||
workflow_call: | ||
secrets: | ||
PYPI_TOKEN: | ||
required: false | ||
workflow_dispatch: | ||
jobs: | ||
build_release: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: linux.g5.12xlarge.nvidia.gpu | ||
python-version: 3.9 | ||
python-tag: "py39" | ||
cuda-tag: "cu124" | ||
- os: linux.g5.12xlarge.nvidia.gpu | ||
python-version: '3.10' | ||
python-tag: "py310" | ||
cuda-tag: "cu124" | ||
- os: linux.g5.12xlarge.nvidia.gpu | ||
python-version: '3.11' | ||
python-tag: "py311" | ||
cuda-tag: "cu124" | ||
- os: linux.g5.12xlarge.nvidia.gpu | ||
python-version: '3.12' | ||
python-tag: "py312" | ||
cuda-tag: "cu124" | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: ${{ matrix.os }} | ||
timeout: 30 | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
script: | | ||
ldd --version | ||
conda create -y --name build_binary python=${{ matrix.python-version }} | ||
conda info | ||
python --version | ||
conda run -n build_binary python --version | ||
conda run -n build_binary pip install torch | ||
conda run -n build_binary pip install numpy | ||
conda run -n build_binary pip install fbgemm-gpu | ||
conda run -n build_binary python -m pip install -r requirements.txt | ||
conda run -n build_binary python -c "import torch.distributed" | ||
echo "torch.distributed succeeded" | ||
conda run -n build_binary python -c "import skbuild" | ||
echo "skbuild succeeded" | ||
conda run -n build_binary python -c "import numpy" | ||
echo "numpy succeeded" | ||
rm -r dist || true | ||
conda run -n build_binary \ | ||
python setup.py bdist_wheel \ | ||
--python-tag=${{ matrix.python-tag }} | ||
conda run -n build_binary \ | ||
python -c "import fbgemm_gpu" | ||
conda run -n build_binary \ | ||
python -c "import torchrec" | ||
conda run -n build_binary python -m pip install twine | ||
conda run -n build_binary \ | ||
python -m twine upload \ | ||
--username __token__ \ | ||
--password "$PYPI_TOKEN" \ | ||
--skip-existing \ | ||
dist/torchrec-*.whl | ||