diff --git a/.github/workflows/build-kernels.yml b/.github/workflows/build-kernels.yml index cc842dd..d789d38 100644 --- a/.github/workflows/build-kernels.yml +++ b/.github/workflows/build-kernels.yml @@ -22,8 +22,9 @@ jobs: - name: build kernels run: | + pip install build ts=$(date +%s) - DS_KERNELS_MAKE_JOBS=10 DS_KERNELS_BUILD_STRING=".dev${ts}" CUDA_ARCH_LIST="80;86;89;90" python setup.py bdist_wheel + DS_KERNELS_MAKE_JOBS=10 DS_KERNELS_BUILD_STRING=".dev${ts}" CUDA_ARCH_LIST="80;86;89;90" python -m build --wheel fname=$(ls dist) nname=$(echo $fname | sed 's/cp[0-9]\+-cp[0-9]\+/py3-none/' | sed 's/linux/manylinux1/') mv "dist/$fname" "dist/$nname" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13afa25..fef9951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,8 +32,9 @@ jobs: python release/check_release_version.py --release_version ${{ env.RELEASE_VERSION }} - name: Build DeepSpeed-Kernels run: | + pip install build ts=$(date +%s) - DS_KERNELS_MAKE_JOBS=10 DS_KERNELS_BUILD_STRING=".dev${ts}" CUDA_ARCH_LIST="80;86;89;90" python setup.py bdist_wheel + DS_KERNELS_MAKE_JOBS=10 DS_KERNELS_BUILD_STRING=".dev${ts}" CUDA_ARCH_LIST="80;86;89;90" python -m build --wheel --no-build-isolation fname=$(ls dist) nname=$(echo $fname | sed 's/cp[0-9]\+-cp[0-9]\+/py3-none/' | sed 's/linux/manylinux1/') mv "dist/$fname" "dist/$nname" diff --git a/README.md b/README.md index a5b695d..5fdfe65 100644 --- a/README.md +++ b/README.md @@ -32,5 +32,5 @@ pip install -v . You can create a pre-compiled portable wheel that supports different CUDA architectures via the `CUDA_ARCH_LIST` environment variable. By default the kernels will be compiled using the `native` compute capability. If you want to compile for more than one you can set the `CUDA_ARCH_LIST` environment variable. We currently only support Ampere and above architectures (i.e., 8.0+). See example below to build for GPUs like A100 and A6000: ```bash -CUDA_ARCH_LIST="80;86;89;90" python setup.py bdist_wheel +CUDA_ARCH_LIST="80;86;89;90" python -m build --wheel ``` diff --git a/build.sh b/build.sh index 295c02a..6c647e4 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ set -ex # set CUDA_ARCH_LIST if desired, otherwise falls back to native -CUDA_ARCH_LIST="80;86" python setup.py bdist_wheel +CUDA_ARCH_LIST="80;86" python -m build --wheel diff --git a/setup.py b/setup.py index b62d7a8..294eb46 100644 --- a/setup.py +++ b/setup.py @@ -55,11 +55,11 @@ def command_exists(cmd): except subprocess.CalledProcessError: pass -# Parse the MII version string from version.txt +# Parse the ds-kernels version string from version.txt version_str = open('version.txt', 'r').read().strip() # Build specifiers like .devX can be added at install time. Otherwise, add the git hash. -# example: BUILD_STR=".dev20201022" python setup.py sdist bdist_wheel +# example: BUILD_STR=".dev20201022" python -m build --sdist --wheel BUILD_STRING = 'DS_KERNELS_BUILD_STRING' BUILD_FILE = 'build.txt'