From c004528dcd6a88a7631400b0a2821eb0e982be6a Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Fri, 21 Feb 2025 15:11:30 -0800 Subject: [PATCH 1/7] Update deprecated [2025-02-21 15:11:28,309] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect) [2025-02-21 15:11:28,392] [INFO] [real_accelerator.py:239:get_accelerator] Setting ds_accelerator to cuda (auto detect) Signed-off-by: Logan Adams --- .github/workflows/no-torch.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/no-torch.yml b/.github/workflows/no-torch.yml index 5b89a6f36787..e194ffb0ccb3 100644 --- a/.github/workflows/no-torch.yml +++ b/.github/workflows/no-torch.yml @@ -36,7 +36,7 @@ jobs: - name: Build deepspeed run: | - DS_BUILD_STRING=" " python setup.py sdist + DS_BUILD_STRING=" " python -m build - name: Open GitHub issue if nightly CI fails if: ${{ failure() && (github.event_name == 'schedule') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2ccca69dfda..b65dc9a3220b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Build DeepSpeed run: | pip install setuptools - DS_BUILD_STRING=" " python setup.py sdist + DS_BUILD_STRING=" " python -m build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 4da96cae158a43fa5d2057dff0b823065aecd95d Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Fri, 21 Feb 2025 15:16:39 -0800 Subject: [PATCH 2/7] Update to specifically build just sdist Signed-off-by: Logan Adams --- .github/workflows/no-torch.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/no-torch.yml b/.github/workflows/no-torch.yml index e194ffb0ccb3..39286da0b5dd 100644 --- a/.github/workflows/no-torch.yml +++ b/.github/workflows/no-torch.yml @@ -36,7 +36,7 @@ jobs: - name: Build deepspeed run: | - DS_BUILD_STRING=" " python -m build + DS_BUILD_STRING=" " python -m build --sdist - name: Open GitHub issue if nightly CI fails if: ${{ failure() && (github.event_name == 'schedule') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b65dc9a3220b..be71e95a9c77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Build DeepSpeed run: | pip install setuptools - DS_BUILD_STRING=" " python -m build + DS_BUILD_STRING=" " python -m build --sdist - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 66f3f68ceffbfd9e91080bf24e0ec7166f2d9e02 Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Fri, 21 Feb 2025 15:22:56 -0800 Subject: [PATCH 3/7] Add pip install build Signed-off-by: Logan Adams --- .github/workflows/no-torch.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/no-torch.yml b/.github/workflows/no-torch.yml index 39286da0b5dd..75c4ecb850c9 100644 --- a/.github/workflows/no-torch.yml +++ b/.github/workflows/no-torch.yml @@ -32,6 +32,7 @@ jobs: run: | pip uninstall torch --yes pip install setuptools + pip install build pip list - name: Build deepspeed diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be71e95a9c77..4bddbc26be4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,7 @@ jobs: - name: Build DeepSpeed run: | pip install setuptools + pip install build DS_BUILD_STRING=" " python -m build --sdist - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From 440171ef5c9a5b46dc243b7acc4bde308a67ebee Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Fri, 21 Feb 2025 15:38:41 -0800 Subject: [PATCH 4/7] Update other non-docs instances where we call or recommend calling setup.py sdist/bdist_wheel Signed-off-by: Logan Adams --- build_win.bat | 2 +- install.sh | 2 +- release/release.sh | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_win.bat b/build_win.bat index 81387471983a..8c7760cfaa55 100644 --- a/build_win.bat +++ b/build_win.bat @@ -11,6 +11,6 @@ set DS_BUILD_GDS=0 set DS_BUILD_RAGGED_DEVICE_OPS=0 set DS_BUILD_SPARSE_ATTN=0 -python setup.py bdist_wheel +python -m build --wheel :end diff --git a/install.sh b/install.sh index 8d56afe40493..4351ace0f1f7 100755 --- a/install.sh +++ b/install.sh @@ -152,7 +152,7 @@ if [ ! -f $hostfile ]; then fi echo "Building deepspeed wheel" -python setup.py $VERBOSE bdist_wheel +python -m build $VERBOSE --wheel if [ "$local_only" == "1" ]; then echo "Installing deepspeed" diff --git a/release/release.sh b/release/release.sh index a83fafcb9b1f..cc3ee2feae62 100644 --- a/release/release.sh +++ b/release/release.sh @@ -38,7 +38,7 @@ if [ $? != 0 ]; then exit 1 fi -DS_BUILD_STRING="" python setup.py sdist +DS_BUILD_STRING="" python -m build --sdist if [ ! -f dist/deepspeed-${version}.tar.gz ]; then echo "prepared version does not match version given ($version), bump version first?" diff --git a/setup.py b/setup.py index 6dc9afb8fbc2..95e3d8421eec 100755 --- a/setup.py +++ b/setup.py @@ -233,7 +233,7 @@ def op_enabled(op_name): version_str = open('version.txt', 'r').read().strip() # Build specifiers like .devX can be added at install time. Otherwise, add the git hash. -# Example: DS_BUILD_STRING=".dev20201022" python setup.py sdist bdist_wheel. +# Example: `DS_BUILD_STRING=".dev20201022" python -m build`. # Building wheel for distribution, update version file. if is_env_set('DS_BUILD_STRING'): From ae0ea694474b0e5b25184dc95ea1510d0163dd7e Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Mon, 24 Feb 2025 08:34:59 -0800 Subject: [PATCH 5/7] Update instances in docs. --- docs/_tutorials/advanced-install.md | 2 +- docs/_tutorials/ds-sequence.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_tutorials/advanced-install.md b/docs/_tutorials/advanced-install.md index d01378484172..286aba669fc9 100755 --- a/docs/_tutorials/advanced-install.md +++ b/docs/_tutorials/advanced-install.md @@ -84,7 +84,7 @@ This should complete the full build 2-3 times faster. You can adjust `-j` to spe You can also build a binary wheel and install it on multiple machines that have the same type of GPUs and the same software environment (CUDA toolkit, PyTorch, Python, etc.) ```bash -DS_BUILD_OPS=1 python setup.py build_ext -j8 bdist_wheel +DS_BUILD_OPS=1 python -m build --wheel ``` This will create a pypi binary wheel under `dist`, e.g., ``dist/deepspeed-0.3.13+8cd046f-cp38-cp38-linux_x86_64.whl`` and then you can install it directly on multiple machines, in our example: diff --git a/docs/_tutorials/ds-sequence.md b/docs/_tutorials/ds-sequence.md index 7a6041f393f9..41a76b784782 100755 --- a/docs/_tutorials/ds-sequence.md +++ b/docs/_tutorials/ds-sequence.md @@ -111,7 +111,7 @@ pip install . cd ${WORK_DIR} git clone -b v1.0.4 https://github.com/HazyResearch/flash-attention cd flash-attention -python setup.py install +python -m pip install . ``` You may also want to ensure your model configuration is compliant with FlashAttention's requirements. For instance, to achieve optimal performance, the head size should be divisible by 8. Refer to the FlashAttention documentation for more details. From f31762a4679e868241dbb39d8abe682264303f64 Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Mon, 24 Feb 2025 08:41:08 -0800 Subject: [PATCH 6/7] Add flags that are missing Signed-off-by: Logan Adams --- docs/_tutorials/advanced-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_tutorials/advanced-install.md b/docs/_tutorials/advanced-install.md index 286aba669fc9..16676be06bc3 100755 --- a/docs/_tutorials/advanced-install.md +++ b/docs/_tutorials/advanced-install.md @@ -84,7 +84,7 @@ This should complete the full build 2-3 times faster. You can adjust `-j` to spe You can also build a binary wheel and install it on multiple machines that have the same type of GPUs and the same software environment (CUDA toolkit, PyTorch, Python, etc.) ```bash -DS_BUILD_OPS=1 python -m build --wheel +DS_BUILD_OPS=1 python -m build --wheel --config-setting="--build-option=build_ext" --config-setting="--build-option=-j8" ``` This will create a pypi binary wheel under `dist`, e.g., ``dist/deepspeed-0.3.13+8cd046f-cp38-cp38-linux_x86_64.whl`` and then you can install it directly on multiple machines, in our example: From 228d6eeed287c871e296a34f6b1a1db94b07c03a Mon Sep 17 00:00:00 2001 From: Logan Adams Date: Mon, 24 Feb 2025 10:19:50 -0800 Subject: [PATCH 7/7] Add --no-isolation to builds where we build the wheel Signed-off-by: Logan Adams --- build_win.bat | 2 +- docs/_tutorials/advanced-install.md | 2 +- install.sh | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_win.bat b/build_win.bat index 8c7760cfaa55..627694dbe8a0 100644 --- a/build_win.bat +++ b/build_win.bat @@ -11,6 +11,6 @@ set DS_BUILD_GDS=0 set DS_BUILD_RAGGED_DEVICE_OPS=0 set DS_BUILD_SPARSE_ATTN=0 -python -m build --wheel +python -m build --wheel --no-isolation :end diff --git a/docs/_tutorials/advanced-install.md b/docs/_tutorials/advanced-install.md index 16676be06bc3..b251485f8988 100755 --- a/docs/_tutorials/advanced-install.md +++ b/docs/_tutorials/advanced-install.md @@ -84,7 +84,7 @@ This should complete the full build 2-3 times faster. You can adjust `-j` to spe You can also build a binary wheel and install it on multiple machines that have the same type of GPUs and the same software environment (CUDA toolkit, PyTorch, Python, etc.) ```bash -DS_BUILD_OPS=1 python -m build --wheel --config-setting="--build-option=build_ext" --config-setting="--build-option=-j8" +DS_BUILD_OPS=1 python -m build --wheel --no-isolation --config-setting="--build-option=build_ext" --config-setting="--build-option=-j8" ``` This will create a pypi binary wheel under `dist`, e.g., ``dist/deepspeed-0.3.13+8cd046f-cp38-cp38-linux_x86_64.whl`` and then you can install it directly on multiple machines, in our example: diff --git a/install.sh b/install.sh index 4351ace0f1f7..8be574c6ec1f 100755 --- a/install.sh +++ b/install.sh @@ -152,7 +152,7 @@ if [ ! -f $hostfile ]; then fi echo "Building deepspeed wheel" -python -m build $VERBOSE --wheel +python -m build $VERBOSE --wheel --no-isolation if [ "$local_only" == "1" ]; then echo "Installing deepspeed" diff --git a/setup.py b/setup.py index 95e3d8421eec..0ad54bb99403 100755 --- a/setup.py +++ b/setup.py @@ -233,7 +233,7 @@ def op_enabled(op_name): version_str = open('version.txt', 'r').read().strip() # Build specifiers like .devX can be added at install time. Otherwise, add the git hash. -# Example: `DS_BUILD_STRING=".dev20201022" python -m build`. +# Example: `DS_BUILD_STRING=".dev20201022" python -m build --no-isolation`. # Building wheel for distribution, update version file. if is_env_set('DS_BUILD_STRING'):