Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.2.0 pypi prep script modifications #1686

Merged
merged 7 commits into from
Jan 25, 2024
Merged
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
54 changes: 26 additions & 28 deletions .github/workflows/validate-repackaged-binary-sizes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,66 +23,64 @@ jobs:
fail-fast: false
matrix:
whl:
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp310-cp310-linux_x86_64.whl
python: "3.10" # python version to use for smoke tests
upload_artifact: false # upload the repackaged binary as an artifact
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp37-cp37m-linux_x86_64.whl
python: "3.7"
- url: https://download.pytorch.org/whl/test/cu121/torch-2.2.0%2Bcu121-cp312-cp312-linux_x86_64.whl
python: "3.12"
artifact: false
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp38-cp38-linux_x86_64.whl
python: "3.8"
- url: https://download.pytorch.org/whl/test/cu121/torch-2.2.0%2Bcu121-cp311-cp311-linux_x86_64.whl
python: "3.11" # python version to use for smoke tests
upload_artifact: false # upload the repackaged binary as an artifact
- url: https://download.pytorch.org/whl/test/cu121/torch-2.2.0%2Bcu121-cp310-cp310-linux_x86_64.whl
python: "3.10"
artifact: false
- url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp39-cp39-linux_x86_64.whl
- url: https://download.pytorch.org/whl/test/cu121/torch-2.2.0%2Bcu121-cp39-cp39-linux_x86_64.whl
python: "3.9"
artifact: false
# - url: https://download.pytorch.org/whl/test/cu117_pypi_cudnn/torch-1.13.1%2Bcu117.with.pypi.cudnn-cp311-cp311-linux_x86_64.whl
# python: "3.11"
# artifact: false
- url: https://download.pytorch.org/whl/test/cu121/torch-2.2.0%2Bcu121-cp38-cp38-linux_x86_64.whl
python: "3.8"
artifact: false

uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.4xlarge.nvidia.gpu
runner: linux.g5.4xlarge.nvidia.gpu
job-name: "Validate binary size"
upload-artifact: ${{ matrix.whl.upload_artifact == 'true' && 'repackaged-binary' || '' }}
script: |
set -ex
export ENV_NAME="conda-env-${{ github.run_id }}"
export GPU_ARCH_VER="11.7"
export GPU_ARCH_TYPE="cuda"
export CUDA_VER="11.7"
export MATRIX_GPU_ARCH_VERSION="12.1"
export MATRIX_GPU_ARCH_TYPE="cuda"
export MATRIX_CUDA_VER="12.1"
export DESIRED_PYTHON="${{ matrix.whl.python }}"
export DESIRED_CUDA="cu117"
export PACKAGE_TYPE="wheel"
export MATRIX_PACKAGE_TYPE="wheel"
export TARGET_OS="linux"
export INSTALLATION=""


# install zip
sudo yum install zip -y

# install patchelf
chmod a+x common/install_patchelf.sh
sudo common/install_patchelf.sh

# download torch whl
wget ${{ matrix.whl.url }}
FILENAME=$(ls -1 *.whl | head -n 1)
SIZE_BEFORE=$(du -h $FILENAME | cut -f1)

# repackage into manywheel
release/pypi/prep_binary_for_pypi.sh $FILENAME

NEW_FILENAME=$(ls -1 *.whl | head -n 1)
echo "::notice:: $FILENAME before: $SIZE_BEFORE after: $(du -h $NEW_FILENAME | cut -f1)"

# cp to ${RUNNER_ARTIFACT_DIR}
cp $NEW_FILENAME ${RUNNER_ARTIFACT_DIR}/

# create conda env
conda create -y -n $ENV_NAME python=$DESIRED_PYTHON
conda activate $ENV_NAME

# install torch
pip install numpy pillow $NEW_FILENAME

# run smoke test
python ./test/smoke_test/smoke_test.py --package=torchonly
python ./test/smoke_test/smoke_test.py --package=torchonly
8 changes: 0 additions & 8 deletions release/pypi/prep_binary_for_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ for whl_file in "$@"; do
(
set -x

# Special build with pypi cudnn remove it from version
if [[ $whl_file == *"with.pypi.cudnn"* ]]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both of these folders where removed from torch. Validated generated binary. It does not have any caffe2 or /torch/lib/libnvrtc*

rm -rf "${whl_dir}/caffe2"
rm -rf "${whl_dir}"/torch/lib/libnvrtc*

sed -i -e "s/-with-pypi-cudnn//g" "${whl_dir}/torch/version.py"
fi

find "${dist_info_folder}" -type f -exec sed -i "s!${version_with_suffix}!${version_no_suffix}!" {} \;
# Moves distinfo from one with a version suffix to one without
# Example: torch-1.8.0+cpu.dist-info => torch-1.8.0.dist-info
Expand Down
3 changes: 1 addition & 2 deletions release/pypi/promote_pypi_to_staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ upload_pypi_to_staging() {
}

# Uncomment these to promote to pypi
PYTORCH_LINUX_VERSION_SUFFIX="%2Bcu121.with.pypi.cudnn"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cu121.with.pypi.cudnn was deprecated infavor of cu121

LINUX_VERSION_SUFFIX="%2Bcu121"
CPU_VERSION_SUFFIX="%2Bcpu"
MACOS_X86_64="macosx_.*_x86_64"
MACOS_ARM64="macosx_.*_arm64"

PLATFORM="linux_x86_64" VERSION_SUFFIX="${PYTORCH_LINUX_VERSION_SUFFIX}" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
PLATFORM="linux_x86_64" VERSION_SUFFIX="${LINUX_VERSION_SUFFIX}" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
PLATFORM="manylinux2014_aarch64" VERSION_SUFFIX="" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
PLATFORM="win_amd64" VERSION_SUFFIX="${CPU_VERSION_SUFFIX}" upload_pypi_to_staging torch "${PYTORCH_VERSION}"
PLATFORM="${MACOS_X86_64}" VERSION_SUFFIX="" upload_pypi_to_staging torch "${PYTORCH_VERSION}" # intel mac
Expand Down
2 changes: 0 additions & 2 deletions release/pypi/upload_pypi_to_staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ pushd "${output_tmp_dir}"
# Dry run by default
DRY_RUN=${DRY_RUN:-enabled}
# On dry run just echo the commands that are meant to be run
TWINE_UPLOAD="echo twine upload"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not set any TWINE vars in upload_pypi_to_staging

DRY_RUN_FLAG="--dryrun"
if [[ $DRY_RUN = "disabled" ]]; then
TWINE_UPLOAD="twine upload"
DRY_RUN_FLAG=""
fi

Expand Down
8 changes: 4 additions & 4 deletions release/release_versions.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

# Make sure to update these versions when doing a release first
PYTORCH_VERSION=${PYTORCH_VERSION:-2.1.1}
TORCHVISION_VERSION=${TORCHVISION_VERSION:-0.16.1}
TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION:-2.1.1}
TORCHTEXT_VERSION=${TORCHTEXT_VERSION:-0.16.1}
PYTORCH_VERSION=${PYTORCH_VERSION:-2.2.0}
TORCHVISION_VERSION=${TORCHVISION_VERSION:-0.17.0}
TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION:-2.2.0}
TORCHTEXT_VERSION=${TORCHTEXT_VERSION:-0.17.0}
TORCHDATA_VERSION=${TORCHDATA_VERSION:-0.7.1}
TORCHREC_VERSION=${TORCHREC_VERSION:-0.6.0}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give me a sec to land the fbgemm PR #1681, may be this will complain about a conflict and ask for a rebase.

FBGEMMGPU_VERSION=${FBGEMMGPU_VERSION:-0.6.0}
Loading