From 4011152e49d02cb0db953d65019a68c6886a3a64 Mon Sep 17 00:00:00 2001 From: Chad Chiang Date: Tue, 31 Dec 2024 09:17:15 -0800 Subject: [PATCH] Update the numpy version to 2.0 and pandas version to 2.2.3 --- pyproject.toml | 4 ++-- requirements/extras/test_requirements.txt | 4 ++-- src/sagemaker/serve/utils/conda_in_process.yml | 6 +++--- .../serve/utils/in_process_requirements.txt | 2 +- tests/data/serve_resources/mlflow/pytorch/conda.yaml | 4 ++-- .../serve_resources/mlflow/pytorch/requirements.txt | 4 ++-- .../serve_resources/mlflow/tensorflow/conda.yaml | 2 +- .../mlflow/tensorflow/requirements.txt | 2 +- tests/data/serve_resources/mlflow/xgboost/conda.yaml | 4 ++-- .../serve_resources/mlflow/xgboost/requirements.txt | 4 ++-- tests/unit/sagemaker/jumpstart/constants.py | 10 +++++----- .../serve/detector/test_dependency_manager.py | 12 ++++++------ 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 21eb185090..fda43bbec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,10 +39,10 @@ dependencies = [ "google-pasta", "importlib-metadata>=1.4.0,<7.0", "jsonschema", - "numpy>=1.9.0,<2.0", + "numpy==2.0", "omegaconf>=2.2,<2.3", "packaging>=20.0", - "pandas", + "pandas==2.2.3", "pathos", "platformdirs", "protobuf>=3.12,<6.0", diff --git a/requirements/extras/test_requirements.txt b/requirements/extras/test_requirements.txt index fe31300c22..c0377e63c2 100644 --- a/requirements/extras/test_requirements.txt +++ b/requirements/extras/test_requirements.txt @@ -1,5 +1,5 @@ tox==3.24.5 -numpy>=1.24.0 +numpy==2.0 build[virtualenv]==1.2.1 flake8==4.0.1 pytest==6.2.5 @@ -22,7 +22,7 @@ requests==2.32.2 sagemaker-experiments==0.1.35 Jinja2==3.1.4 pyvis==0.2.1 -pandas==1.4.4 +pandas==2.2.3 scikit-learn==1.3.0 cloudpickle==2.2.1 jsonpickle<4.0.0 diff --git a/src/sagemaker/serve/utils/conda_in_process.yml b/src/sagemaker/serve/utils/conda_in_process.yml index 61badaa52f..775c5857fd 100644 --- a/src/sagemaker/serve/utils/conda_in_process.yml +++ b/src/sagemaker/serve/utils/conda_in_process.yml @@ -12,12 +12,12 @@ dependencies: - boto3>=1.34.142,<2.0 - cloudpickle==2.2.1 - google-pasta - - numpy>=1.9.0,<2.0 + - numpy==2.0 - protobuf>=3.12,<5.0 - smdebug_rulesconfig==1.0.1 - importlib-metadata>=1.4.0,<7.0 - packaging>=20.0 - - pandas + - pandas==2.2.3 - pathos - schema - PyYAML~=6.0 @@ -64,7 +64,7 @@ dependencies: - multiprocess>=0.70.14 - networkx>=3.1 - packaging>=23.1 - - pandas>=1.5.3 + - pandas==2.2.3 - pathos>=0.3.0 - pillow>=9.5.0 - platformdirs>=3.2.0 diff --git a/src/sagemaker/serve/utils/in_process_requirements.txt b/src/sagemaker/serve/utils/in_process_requirements.txt index e356e1720d..a40738202e 100644 --- a/src/sagemaker/serve/utils/in_process_requirements.txt +++ b/src/sagemaker/serve/utils/in_process_requirements.txt @@ -32,7 +32,7 @@ mpmath>=1.3.0 multiprocess>=0.70.14 networkx>=3.1 packaging>=23.1 -pandas>=1.5.3 +pandas==2.2.3 pathos>=0.3.0 pillow>=9.5.0 platformdirs>=3.2.0 diff --git a/tests/data/serve_resources/mlflow/pytorch/conda.yaml b/tests/data/serve_resources/mlflow/pytorch/conda.yaml index be61456197..be83c37482 100644 --- a/tests/data/serve_resources/mlflow/pytorch/conda.yaml +++ b/tests/data/serve_resources/mlflow/pytorch/conda.yaml @@ -11,10 +11,10 @@ dependencies: - defusedxml==0.7.1 - dill==0.3.8 - gmpy2==2.1.2 - - numpy==1.26.4 + - numpy==2.0 - opt-einsum==3.3.0 - packaging==24.0 - - pandas==2.2.1 + - pandas==2.2.3 - pyyaml==6.0.1 - requests==2.31.0 - torch==2.0.1 diff --git a/tests/data/serve_resources/mlflow/pytorch/requirements.txt b/tests/data/serve_resources/mlflow/pytorch/requirements.txt index 0446ed5053..811ad6aa73 100644 --- a/tests/data/serve_resources/mlflow/pytorch/requirements.txt +++ b/tests/data/serve_resources/mlflow/pytorch/requirements.txt @@ -5,10 +5,10 @@ cloudpickle==2.2.1 defusedxml==0.7.1 dill==0.3.8 gmpy2==2.1.2 -numpy==1.24.4 +numpy==2.0 opt-einsum==3.3.0 packaging==21.3 -pandas==2.2.1 +pandas==2.2.3 pyyaml==6.0.1 requests==2.32.2 torch==2.2.0 diff --git a/tests/data/serve_resources/mlflow/tensorflow/conda.yaml b/tests/data/serve_resources/mlflow/tensorflow/conda.yaml index 90d8c300a0..4e8e060321 100644 --- a/tests/data/serve_resources/mlflow/tensorflow/conda.yaml +++ b/tests/data/serve_resources/mlflow/tensorflow/conda.yaml @@ -6,6 +6,6 @@ dependencies: - pip: - mlflow==2.11.1 - cloudpickle==2.2.1 - - numpy==1.26.4 + - numpy==2.0 - tensorflow==2.16.1 name: mlflow-env diff --git a/tests/data/serve_resources/mlflow/tensorflow/requirements.txt b/tests/data/serve_resources/mlflow/tensorflow/requirements.txt index ff99d3b92e..d633a8e813 100644 --- a/tests/data/serve_resources/mlflow/tensorflow/requirements.txt +++ b/tests/data/serve_resources/mlflow/tensorflow/requirements.txt @@ -1,4 +1,4 @@ mlflow==2.13.2 cloudpickle==2.2.1 -numpy==1.26.4 +numpy==2.0 tensorflow==2.16.1 diff --git a/tests/data/serve_resources/mlflow/xgboost/conda.yaml b/tests/data/serve_resources/mlflow/xgboost/conda.yaml index 44ca3c4c2e..9948b037c8 100644 --- a/tests/data/serve_resources/mlflow/xgboost/conda.yaml +++ b/tests/data/serve_resources/mlflow/xgboost/conda.yaml @@ -6,8 +6,8 @@ dependencies: - pip: - mlflow==2.11.1 - lz4==4.3.2 - - numpy==1.26.4 - - pandas==2.2.1 + - numpy==2.0 + - pandas==2.2.3 - psutil==5.9.8 - scikit-learn==1.3.2 - scipy==1.11.3 diff --git a/tests/data/serve_resources/mlflow/xgboost/requirements.txt b/tests/data/serve_resources/mlflow/xgboost/requirements.txt index 1130dcaec5..e70ddeca62 100644 --- a/tests/data/serve_resources/mlflow/xgboost/requirements.txt +++ b/tests/data/serve_resources/mlflow/xgboost/requirements.txt @@ -1,7 +1,7 @@ mlflow==2.13.2 lz4==4.3.2 -numpy==1.24.4 -pandas==2.0.3 +numpy==2.0 +pandas==2.2.3 psutil==5.9.8 scikit-learn==1.3.2 scipy==1.10.1 diff --git a/tests/unit/sagemaker/jumpstart/constants.py b/tests/unit/sagemaker/jumpstart/constants.py index 59f38bd189..adc2d8d6d9 100644 --- a/tests/unit/sagemaker/jumpstart/constants.py +++ b/tests/unit/sagemaker/jumpstart/constants.py @@ -12095,7 +12095,7 @@ "inference_vulnerabilities": [], "training_vulnerable": False, "training_dependencies": [ - "numpy==1.23.1", + "numpy==2.0", "opencv_python==4.7.0.68", "sagemaker_jumpstart_prepack_script_utilities==1.0.0", ], @@ -14360,10 +14360,10 @@ "jmespath==1.0.1", "jsonschema==4.17.3", "multiprocess==0.70.14", - "numpy==1.24.3", + "numpy==2.0", "oscrypto==1.3.0", "packaging==23.1", - "pandas==2.0.2", + "pandas==2.2.3", "pathos==0.3.0", "pkgutil-resolve-name==1.3.10", "platformdirs==3.8.0", @@ -14884,10 +14884,10 @@ "jmespath==1.0.1", "jsonschema==4.17.3", "multiprocess==0.70.14", - "numpy==1.24.3", + "numpy==2.0", "oscrypto==1.3.0", "packaging==23.1", - "pandas==2.0.2", + "pandas==2.2.3", "pathos==0.3.0", "pkgutil-resolve-name==1.3.10", "platformdirs==3.8.0", diff --git a/tests/unit/sagemaker/serve/detector/test_dependency_manager.py b/tests/unit/sagemaker/serve/detector/test_dependency_manager.py index 491968dd25..f767a35d66 100644 --- a/tests/unit/sagemaker/serve/detector/test_dependency_manager.py +++ b/tests/unit/sagemaker/serve/detector/test_dependency_manager.py @@ -21,8 +21,8 @@ DEPENDENCY_LIST = [ "requests==2.26.0", - "numpy>=1.20.0", - "pandas<=1.3.3", + "numpy==2.0", + "pandas==2.2.3", "matplotlib<3.5.0", "scikit-learn>0.24.1", "Django!=4.0.0", @@ -34,8 +34,8 @@ EXPECTED_DEPENDENCY_MAP = { "requests": "==2.26.0", - "numpy": ">=1.20.0", - "pandas": "<=1.3.3", + "numpy": "==2.0", + "pandas": "==2.2.3", "matplotlib": "<3.5.0", "scikit-learn": ">0.24.1", "Django": "!=4.0.0", @@ -60,7 +60,7 @@ AUTODETECTED_REQUIREMENTS = """module==1.2 custom_module==1.2.0 -numpy==4.5 +numpy==2.0 boto3==1.26.135 """ @@ -97,7 +97,7 @@ def test_capture_dependencies(self, mock_subprocess, mock_file, mock_path): expected_calls = [ call("module==1.2\n"), call("custom_module==1.2.3\n"), - call("numpy==4.5\n"), + call("numpy==2.0\n"), call("boto3=1.28.*\n"), call("sagemaker[huggingface]>=2.199\n"), call("other_module@http://some/website.whl\n"),