Fix Scipy tests for GPU based docker images
Issue: Currently scipy tests are failing when running it for GPU .
More background: In PyPi, scipy is vended out as a single package. Whereas in Conda forge, scipy is vended out as two different packages - scipy and scipy-tests. (This is a recent change that happened two months ago)
There is a possibility that either one of these packages might be out of date and indirectly causing tests to fail
Acceptance Criteria: Scipy tests should succeed for GPU based docker images. Another possible recommendation is to come up with a different testing plan for scipy.
As of 1.1.0 release, the failure presents in a new way, but the underlying problem is still the same:
Will start running test for: scipy.test.Dockerfile against: localhost/sagemaker-distribution:1.1.0-gpu
Built a test image: sha256:dc5e4b77c35d0f38d94a12bae83f12dca1dad4b7df4adb2ecfc6ca0b4964f1ad, will now execute its default CMD.
Found Nvidia driver version: 525.85.12
============================= test session starts ==============================
platform linux -- Python 3.10.13, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/sagemaker-user
plugins: anyio-3.7.1, dash-2.14.1, hypothesis-6.88.1
collected 58127 items / 1 error / 12693 deselected / 45434 selected
==================================== ERRORS ====================================
_________________ ERROR collecting datasets/tests/test_data.py _________________
ImportError while importing test module '/opt/conda/lib/python3.10/site-packages/scipy/datasets/tests/test_data.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/conda/lib/python3.10/site-packages/scipy/datasets/tests/test_data.py:10: in <module>
import pooch
E ModuleNotFoundError: No module named 'pooch'
During handling of the above exception, another exception occurred:
/opt/conda/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
/opt/conda/lib/python3.10/site-packages/scipy/datasets/tests/test_data.py:12: in <module>
raise ImportError("Missing optional dependency 'pooch' required "
E ImportError: Missing optional dependency 'pooch' required for scipy.datasets module. Please use pip or conda to install 'pooch'.
=========================== short test summary info ============================
ERROR datasets/tests/test_data.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
===================== 12693 deselected, 1 error in 18.77s ======================
I found a relevant commit to the scipy feedstock about this "pooch" dep: https://github.com/conda-forge/scipy-feedstock/commit/87f59ad52a9ad31879ebcf3746ed8a2426530187
Seeing following errors leading to failures
-
TypeError: 'coo_matrix' object is not subscriptable- in https://github.com/scipy/scipy/issues/16059 it's acknowledged coo_matrix is not subscriptable, and this is expected behavior. Need to research why this is showing up in tests and how to fix. -
TypeError: 'dia_matrix' object is not subscriptable- similar to above, in https://github.com/scipy/scipy/issues/6112 it's acknowledged that dia_matrix is not subscriptable. -
NotImplementedError- this seems to be due to mismatch between tests version and the package version
Scipy and scipy-tests are separately available on conda-forge, but the release versions seem to line up. Will make a change to install scipy-tests version matching scipy and see if that resolves.
From 1.12.0, seeing error
Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
Seems to be test case issue