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

Replace calls to python setup.py sdist with python -m build --sdist #7069

Merged
merged 11 commits into from
Feb 24, 2025
Merged
3 changes: 2 additions & 1 deletion .github/workflows/no-torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ jobs:
run: |
pip uninstall torch --yes
pip install setuptools
pip install build
pip list

- name: Build deepspeed
run: |
DS_BUILD_STRING=" " python setup.py sdist
DS_BUILD_STRING=" " python -m build --sdist

- name: Open GitHub issue if nightly CI fails
if: ${{ failure() && (github.event_name == 'schedule') }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
- name: Build DeepSpeed
run: |
pip install setuptools
DS_BUILD_STRING=" " python setup.py sdist
pip install build
DS_BUILD_STRING=" " python -m build --sdist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
2 changes: 1 addition & 1 deletion build_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 --no-isolation

:end
2 changes: 1 addition & 1 deletion docs/_tutorials/advanced-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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:
Expand Down
2 changes: 1 addition & 1 deletion docs/_tutorials/ds-sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ if [ ! -f $hostfile ]; then
fi

echo "Building deepspeed wheel"
python setup.py $VERBOSE bdist_wheel
python -m build $VERBOSE --wheel --no-isolation

if [ "$local_only" == "1" ]; then
echo "Installing deepspeed"
Expand Down
2 changes: 1 addition & 1 deletion release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 --no-isolation`.

# Building wheel for distribution, update version file.
if is_env_set('DS_BUILD_STRING'):
Expand Down