Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
contains( github.event.pull_request.labels.*.name, 'Run Build and Test')
runs-on: [self-hosted, gpu]
container:
image: hpcaitech/pytorch-cuda:1.10.1-11.3.0
image: hpcaitech/pytorch-cuda:1.12.0-11.3.0
options: --gpus all --rm -v /data/scratch/cifar-10:/data/scratch/cifar-10
timeout-minutes: 40
steps:
Expand Down
41 changes: 27 additions & 14 deletions .github/workflows/release_bdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ name: Release bdist wheel
on:
workflow_dispatch:
inputs:
torch_version:
type: string
description: torch version, separated by comma
required: true
default: "all"
cuda_version:
type: choice
description: CUDA Version
default: 'all'
type: string
description: cuda version, separated by comma
required: true
options:
- all
- "11.3"
- "11.1"
- "10.2"
github_ref:
type: string
description: Branch or Tag
Expand All @@ -27,12 +26,24 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
env:
TORCH_VERSIONS: ${{ inputs.torch_version }}
CUDA_VERSIONS: ${{ inputs.cuda_version }}
run: |
[ "${{github.event.inputs.cuda_version}}" != "" ] && matrix="[\"hpcaitech/cuda-conda:${{github.event.inputs.cuda_version}}\"]"
[ "${{github.event.inputs.cuda_version}}" == "" ] || [ "${{github.event.inputs.cuda_version}}" == "all" ] && \
matrix="[\"hpcaitech/cuda-conda:11.3\", \"hpcaitech/cuda-conda:11.1\", \"hpcaitech/cuda-conda:10.2\"]"
echo $matrix
echo "::set-output name=matrix::{\"container\":$(echo $matrix)}"
echo $TORCH_VERSIONS
echo $CUDA_VERSIONS
IFS=','
DOCKER_IMAGE=()

for cv in $CUDA_VERSIONS
do
DOCKER_IMAGE+=("\"hpcaitech/cuda-conda:${cv}\"")
done

container=$( IFS=',' ; echo "${DOCKER_IMAGE[*]}" )
container="[${container}]"
echo "$container"
echo "::set-output name=matrix::{\"container\":$(echo "$container")}"

build:
name: Release bdist wheels
Expand Down Expand Up @@ -62,7 +73,9 @@ jobs:
- name: Build bdist wheel
run: |
pip install beautifulsoup4 requests packaging
python ./build_colossalai_wheel.py
python ./build_colossalai_wheel.py --torch_version $TORCH_VERSIONS
env:
TORCH_VERSIONS: ${{ inputs.torch_version }}
- name: 🚀 Deploy
uses: garygrossgarten/github-action-scp@release
with:
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/scripts/build_colossalai_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--torch_version', type=str)
parser.add_argument('--nightly', action='store_true',
help='whether this build is for nightly release, if True, will only build on the latest PyTorch version and Python 3.8')
return parser.parse_args()
Expand Down Expand Up @@ -81,29 +82,27 @@ def main():
args = parse_args()
wheel_info = all_wheel_info()

if args.nightly:
latest_torch_version = list(wheel_info.keys())
# filter wheels on condition
all_torch_versions = list(wheel_info.keys())
def _compare_version(a, b):
if version.parse(a) > version.parse(b):
return 1
else:
return -1

def _compare_version(a, b):
if version.parse(a) > version.parse(b):
return 1
else:
return -1
all_torch_versions.sort(key=cmp_to_key(_compare_version))

latest_torch_version.sort(key=cmp_to_key(_compare_version))

if args.nightly:
# only keep the latest version
for key in latest_torch_version[:-1]:
for key in all_torch_versions[:-1]:
wheel_info.pop(key)

# we only keep python 3.8 for nightly release
for torch_version, cuda_versioned_info in wheel_info.items():
for cuda_version, python_versioned_info in cuda_versioned_info.items():
python_versions = list(python_versioned_info.keys())

for key in python_versions:
if key != '3.8':
python_versioned_info.pop(key)
elif args.torch_version != 'all':
torch_versions = args.torch_version.split(',')
# only keep the torch versions specified
for key in all_torch_versions:
if key not in torch_versions:
wheel_info.pop(key)

build_colossalai(wheel_info)

if __name__ == '__main__':
Expand Down