mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Modernize the development installation:
```bash
# python setup.py develop
python -m pip install --no-build-isolation -e .
# python setup.py install
python -m pip install --no-build-isolation .
```
Now, the `python setup.py develop` is a wrapper around `python -m pip install -e .` since `setuptools>=80.0`:
- pypa/setuptools#4955
`python setup.py install` is deprecated and will emit a warning during run. The warning will become an error on October 31, 2025.
- 9c4d383631/setuptools/command/install.py (L58-L67)
> ```python
> SetuptoolsDeprecationWarning.emit(
> "setup.py install is deprecated.",
> """
> Please avoid running ``setup.py`` directly.
> Instead, use pypa/build, pypa/installer or other
> standards-based tools.
> """,
> see_url="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html",
> due_date=(2025, 10, 31),
> )
> ```
- pypa/setuptools#3849
Additional Resource:
- [Why you shouldn't invoke setup.py directly](https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/156027
Approved by: https://github.com/ezyang
41 lines
1.1 KiB
Bash
41 lines
1.1 KiB
Bash
OUTFILE=spmm-no-mkl-test.txt
|
|
PYTORCH_HOME=$1
|
|
|
|
cd $PYTORCH_HOME
|
|
|
|
echo "" >> $OUTFILE
|
|
echo "----- USE_MKL=1 -----" >> $OUTFILE
|
|
rm -rf build
|
|
|
|
export USE_MKL=1
|
|
CMAKE_ONLY=1 python setup.py build
|
|
ccmake build # or cmake-gui build
|
|
|
|
python -m pip install --no-build-isolation -v .
|
|
|
|
cd benchmarks
|
|
echo "!! SPARSE SPMM TIME BENCHMARK!! " >> $OUTFILE
|
|
for dim0 in 1000 5000 10000; do
|
|
for nnzr in 0.01 0.05 0.1 0.3; do
|
|
python -m sparse.spmm --format csr --m $dim0 --n $dim0 --k $dim0 --nnz-ratio $nnzr --outfile $OUTFILE
|
|
# python -m sparse.spmm --format coo --m $dim0 --n $dim0 --k $dim0 --nnz-ratio $nnzr --outfile $OUTFILE
|
|
done
|
|
done
|
|
echo "----------------------" >> $OUTFILE
|
|
|
|
cd $PYTORCH_HOME
|
|
echo "----- USE_MKL=0 ------" >> $OUTFILE
|
|
rm -rf build
|
|
|
|
export USE_MKL=0
|
|
python -m pip install --no-build-isolation -v .
|
|
|
|
cd benchmarks
|
|
for dim0 in 1000 5000 10000; do
|
|
for nnzr in 0.01 0.05 0.1 0.3; do
|
|
python -m sparse.spmv --format csr --m $dim0 --nnz-ratio $nnzr --outfile $OUTFILE
|
|
python -m sparse.spmv --format coo --m $dim0 --nnz-ratio $nnzr --outfile $OUTFILE
|
|
done
|
|
done
|
|
echo "----------------------" >> $OUTFILE
|