Skip to content

Commit

Permalink
Merge pull request cupy#7405 from kmaehashi/drop-py37
Browse files Browse the repository at this point in the history
Drop support for Python 3.7, NumPy 1.20, and SciPy 1.6
  • Loading branch information
kmaehashi authored Mar 1, 2023
2 parents 2664a36 + be00466 commit 2077bab
Show file tree
Hide file tree
Showing 21 changed files with 100 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.10'

- name: setup backport
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ configs {
include_dot_git: true
}
environment_variables { key: "GPU" value: "2" }
command: ".pfnci\\windows\\run.bat 10.2 3.7 test"
command: ".pfnci\\windows\\run.bat 10.2 3.8 test"
}
}
Expand Down Expand Up @@ -678,7 +678,7 @@ configs {
include_dot_git: true
}
environment_variables { key: "GPU" value: "2" }
command: ".pfnci\\windows\\run.bat 11.2 3.7 test"
command: ".pfnci\\windows\\run.bat 11.2 3.8 test"
}
}
Expand Down
24 changes: 12 additions & 12 deletions .pfnci/coverage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1811,15 +1811,8 @@ CuPy CI Test Coverage
- ✅
* - python
- 3.7
- 7
- ✅
- ✅
-
- 🚨
-
- ✅
- ✅
- ✅
- ✅
-
-
-
Expand All @@ -1834,7 +1827,6 @@ CuPy CI Test Coverage
-
-
-
- ✅
-
-
-
Expand All @@ -1843,9 +1835,6 @@ CuPy CI Test Coverage
-
-
-
* -
- 3.8
- 3
-
-
-
Expand All @@ -1854,10 +1843,20 @@ CuPy CI Test Coverage
-
-
-
* -
- 3.8
- 10
- ✅
- ✅
-
-
- ✅
- ✅
- ✅
- ✅
- ✅
- ✅
-
-
-
-
Expand All @@ -1869,6 +1868,7 @@ CuPy CI Test Coverage
-
-
-
- ✅
-
-
-
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda102.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENV PATH "/usr/lib/ccache:${PATH}"
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.20.*' 'scipy==1.6.*' 'optuna==3.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda102.multi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENV PATH "/usr/lib/ccache:${PATH}"
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.20.*' 'scipy==1.6.*' 'optuna==3.*' 'mpi4py==3.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda111.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN /update-alternatives-cutensor.sh
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.20.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda111.multi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN /update-alternatives-cutensor.sh
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.20.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda112.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN /update-alternatives-cutensor.sh
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.21.*' 'scipy==1.7.*' 'optuna==3.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/cuda112.multi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN /update-alternatives-cutensor.sh
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.21.*' 'scipy==1.7.*' 'optuna==3.*' 'cython==0.29.*'
Expand Down
4 changes: 2 additions & 2 deletions .pfnci/linux/tests/rocm-4-3.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ENV LDFLAGS "-L${ROCM_HOME}/lib"
RUN git clone https://github.com/pyenv/pyenv.git /opt/pyenv
ENV PYENV_ROOT "/opt/pyenv"
ENV PATH "${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install 3.7.11 && \
pyenv global 3.7.11 && \
RUN pyenv install 3.8.11 && \
pyenv global 3.8.11 && \
pip install -U setuptools pip

RUN pip install -U 'numpy==1.20.*' 'scipy==1.6.*' 'optuna==3.*' 'cython==0.29.*'
Expand Down
9 changes: 4 additions & 5 deletions .pfnci/matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cutensor: null
cusparselt: null
cudnn: "7.6"
python: "3.7"
python: "3.8"
numpy: "1.20"
scipy: "1.6"
optuna: "3"
Expand Down Expand Up @@ -75,7 +75,7 @@
cutensor: "1.5"
cusparselt: null
cudnn: "8.0"
python: "3.7"
python: "3.8"
numpy: "1.20"
scipy: null
optuna: null # Avoid SciPy installation
Expand Down Expand Up @@ -105,7 +105,7 @@
cutensor: "1.4"
cusparselt: "0.2.0"
cudnn: "8.1"
python: "3.7"
python: "3.8"
numpy: "1.21"
scipy: "1.7"
optuna: "3"
Expand Down Expand Up @@ -358,7 +358,7 @@
cutensor: null
cusparselt: null
cudnn: null
python: "3.7"
python: "3.8"
numpy: "1.20"
scipy: "1.6"
optuna: "3"
Expand Down Expand Up @@ -448,7 +448,6 @@
# Example (with Doctest) | Linux
# Notes:
# - Examples and Doctests are tested against the minimum supported Python version.
# (Uses Python 3.8 instead of 3.7 to test Array API support.)
# - Libraries versions for doctests will be overridden by docs/requirements.txt
# - Accelerators are disabled as doctests expect it (#5891)
- project: "cupy.linux.cuda-example"
Expand Down
10 changes: 4 additions & 6 deletions docker/rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

RUN apt-get update -y && \
apt-get install -y --no-install-recommends python3.7 python3.7-distutils && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 && \
apt-get install -y --no-install-recommends python3.8 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1

RUN curl https://bootstrap.pypa.io/get-pip.py | sudo python3.7

RUN pip3 install --no-cache-dir -U install setuptools pip
RUN pip3 install --no-cache-dir -f https://pip.cupy.dev/pre/ "cupy-rocm-5-0[all]==12.0.0b3"
RUN python3 -m pip install --no-cache-dir -U install setuptools pip
RUN python3 -m pip install --no-cache-dir -f https://pip.cupy.dev/pre/ "cupy-rocm-5-0[all]==12.0.0b3"

USER rocm-user
6 changes: 3 additions & 3 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Requirements
* This requirement is optional if you install CuPy from ``conda-forge``. However, you still need to have a compatible
driver installed for your GPU. See :ref:`install_cupy_from_conda_forge` for details.

* `Python <https://python.org/>`_: v3.7.0+ / v3.8.0+ / v3.9.0+ / v3.10.0+ / v3.11.0+
* `Python <https://python.org/>`_: v3.8 / v3.9 / v3.10 / v3.11

.. note::

Expand All @@ -25,9 +25,9 @@ Python Dependencies

NumPy/SciPy-compatible API in CuPy v12 is based on NumPy 1.24 and SciPy 1.9, and has been tested against the following versions:

* `NumPy <https://numpy.org/>`_: v1.20 / v1.21 / v1.22 / v1.23 / v1.24
* `NumPy <https://numpy.org/>`_: v1.21 / v1.22 / v1.23 / v1.24

* `SciPy <https://scipy.org/>`_ (*optional*): v1.6 / v1.7 / v1.8 / v1.9
* `SciPy <https://scipy.org/>`_ (*optional*): v1.7 / v1.8 / v1.9

* Required only when coping sparse matrices from GPU to CPU (see :doc:`../reference/scipy_sparse`.)

Expand Down
2 changes: 1 addition & 1 deletion install/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ disallow_untyped_defs = True
ignore_errors = False
ignore_missing_imports = True
no_implicit_optional = True
python_version = 3.7
python_version = 3.8
show_error_codes = True
strict_equality = True
strict_optional = True
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Expand Down Expand Up @@ -138,7 +137,7 @@
packages=find_packages(exclude=['install', 'tests']),
package_data=package_data,
zip_safe=False,
python_requires='>=3.7',
python_requires='>=3.8',
setup_requires=setup_requires,
install_requires=install_requires,
tests_require=tests_require,
Expand Down
8 changes: 4 additions & 4 deletions tests/cupy_tests/lib_tests/test_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_poly1d_str(self, xp, dtype):
return str(xp.poly1d(a))

@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(rtol=1e-6)
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-2, 'default': 1e-6})
def test_poly1d_call(self, xp, dtype):
a = testing.shaped_arange((5,), xp, dtype)
b = xp.poly1d(a)
Expand Down Expand Up @@ -713,7 +713,7 @@ def test_polyfit_weighted_diff_types(self, xp, dtype1, dtype2, dtype3):
class TestPolyval(Poly1dTestBase):

@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(rtol=1e-3)
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-2, 'default': 1e-3})
def test_polyval(self, xp, dtype):
a1 = self._get_input(xp, self.type_l, dtype, size=5)
a2 = self._get_input(xp, self.type_r, dtype, size=5)
Expand Down Expand Up @@ -744,7 +744,7 @@ def test_polyval(self, dtype):
class TestPolyvalShapeCombination:

@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(rtol=1e-6)
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-2, 'default': 1e-6})
def test_polyval(self, xp, dtype):
a = testing.shaped_arange(self.shape1, xp, dtype)
b = testing.shaped_arange(self.shape2, xp, dtype)
Expand All @@ -770,7 +770,7 @@ def test_polyval(self, dtype):
class TestPolyvalDtypesCombination:

@testing.for_all_dtypes_combination(names=['dtype1', 'dtype2'], full=True)
@testing.numpy_cupy_allclose(rtol=1e-6)
@testing.numpy_cupy_allclose(rtol={numpy.float16: 1e-2, 'default': 1e-6})
def test_polyval_diff_types_array_array(self, xp, dtype1, dtype2):
a = testing.shaped_arange((10,), xp, dtype1)
b = testing.shaped_arange((3,), xp, dtype2)
Expand Down
9 changes: 6 additions & 3 deletions tests/cupy_tests/linalg_tests/test_einsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ def test_numpy_15961_list(self, xp, do_opt):
class TestEinSumUnaryOperation:

@testing.for_all_dtypes(no_bool=False)
@testing.numpy_cupy_allclose(contiguous_check=False)
@testing.numpy_cupy_allclose(
rtol={numpy.float16: 1e-1, 'default': 1e-7}, contiguous_check=False)
def test_einsum_unary(self, xp, dtype):
a = testing.shaped_arange(self.shape_a, xp, dtype)
out = xp.einsum(self.subscripts, a)
Expand All @@ -360,7 +361,8 @@ def test_einsum_unary_views(self, xp, dtype):
['dtype_a', 'dtype_out'],
no_bool=False,
no_complex=True) # avoid ComplexWarning
@testing.numpy_cupy_allclose(contiguous_check=False)
@testing.numpy_cupy_allclose(
rtol={numpy.float16: 1e-1, 'default': 1e-7}, contiguous_check=False)
def test_einsum_unary_dtype(self, xp, dtype_a, dtype_out):
if not numpy.can_cast(dtype_a, dtype_out):
pytest.skip()
Expand Down Expand Up @@ -436,7 +438,8 @@ class TestEinSumBinaryOperation:
['dtype_a', 'dtype_b'],
no_bool=False,
no_float16=False)
@testing.numpy_cupy_allclose(contiguous_check=False)
@testing.numpy_cupy_allclose(
rtol={numpy.float16: 1e-2, 'default': 1e-7}, contiguous_check=False)
def test_einsum_binary(self, xp, dtype_a, dtype_b):
a = testing.shaped_arange(self.shape_a, xp, dtype_a)
b = testing.shaped_arange(self.shape_b, xp, dtype_b)
Expand Down
Loading

0 comments on commit 2077bab

Please sign in to comment.