Skip to content

Commit

Permalink
save disk space when building wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzeyi committed Nov 11, 2023
1 parent aeac6ac commit 395789f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-20.04
- windows-2019
# - 8-core-ubuntu
# - windows-8-core
python:
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/wheels_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
TWINE_USERNAME: __token__

jobs:
build-internal:
build_internal:
name: ${{ inputs.os }}-py${{ inputs.python }}-torch${{ inputs.torch_version }}+cu${{ inputs.cuda_short_version }}
runs-on: ${{ inputs.os }}
env:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
}[cushort]
with open(os.environ['GITHUB_OUTPUT'], "r+") as fp:
fp.write("CUDA_VERSION=" + full_version + "\n")
fp.write("CUDA_VERSION_SUFFIX=+cu" + cushort + "\n")
fp.write("CUDA_VERSION_SUFFIX=cu" + cushort + "\n")
# fp.write("TORCH_ORG_S3_PATH=s3://pytorch/whl/" + cushort + "\n")
# fp.write("PUBLISH_PYPI=0\n")
fp.write("CUDA_INSTALL_SCRIPT=" + install_script + "\n")
Expand Down Expand Up @@ -108,15 +108,16 @@ jobs:
git config --global --add safe.directory "*"
pip install packaging ninja
version=`cat version.txt`
# if we are not building a tag, set BUILD_NIGHTLY=1
echo "BUILD_NIGHTLY=$([[ $VERSION_SOURCE == 'tag' ]] && echo 0 || echo 1)" >> ${GITHUB_ENV}
echo "BUILD_NIGHTLY=$([[ $VERSION_SOURCE == 'tag' ]] && echo 0 || echo 1)" >> ${GITHUB_OUTPUT}
echo "BUILD_VERSION=$version${{ steps.cuda_info.outputs.CUDA_VERSION_SUFFIX }}" >> ${GITHUB_ENV}
echo "BUILD_VERSION=$version${{ steps.cuda_info.outputs.CUDA_VERSION_SUFFIX }}" >> ${GITHUB_OUTPUT}
# Set build version to x.x.x.devYYYYMMDD+torchxxxcu111
torch_version_suffix=torch$(echo ${{ inputs.torch_version }} | sed 's/\.//g')
cuda_version_suffix=${{ steps.cuda_info.outputs.CUDA_VERSION_SUFFIX }}
nightly_tag=$([[ $VERSION_SOURCE == 'tag' ]] && echo '' || echo '.dev'`date +%Y%m%d`)
echo "BUILD_VERSION=$version$nightly_tag+torch${torch_version_suffix}${cuda_version_suffix}" >> ${GITHUB_ENV}
echo "BUILD_VERSION=$version$nightly_tag+torch${torch_version_suffix}${cuda_version_suffix}" >> ${GITHUB_OUTPUT}
which ninja
cat ${GITHUB_ENV}
- run: echo "sfast-${BUILD_VERSION}"
- run: echo "release version (will upload to GitHub)"
- run: echo "release version"
if: ${{ !contains(steps.sfast_version.outputs.BUILD_VERSION, '.dev') }}

- name: Setup proper pytorch dependency in "requirements.txt"
Expand All @@ -133,7 +134,7 @@ jobs:
python: ${{ inputs.python }}

- name: Install dependencies
run: $PY -m pip install wheel setuptools twine -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cuda_short_version }}
run: $PY -m pip install wheel setuptools twine -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu${{ inputs.cuda_short_version }} --no-cache-dir

- if: runner.os == 'Linux'
name: (Linux) install cuda
Expand Down
2 changes: 1 addition & 1 deletion sfast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def new_lru_cache(*args, **kwargs):

# This line will be programatically read/write by setup.py.
# Leave them at the bottom of this file and don't touch them.
__version__ = "0.0.8"
__version__ = "0.0.8+torch211.cu121"

0 comments on commit 395789f

Please sign in to comment.