autogluon.cloud 0.5.0__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {autogluon_cloud-0.5.0/src/autogluon.cloud.egg-info → autogluon_cloud-0.6.0}/PKG-INFO +12 -27
- autogluon_cloud-0.6.0/pyproject.toml +109 -0
- autogluon_cloud-0.6.0/setup.py +33 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/__init__.py +6 -1
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/backend.py +41 -6
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/backend_factory.py +8 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/ray_backend.py +3 -4
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/sagemaker_backend.py +38 -31
- autogluon_cloud-0.6.0/src/autogluon/cloud/backend/tabular_sagemaker_backend.py +67 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/timeseries_sagemaker_backend.py +1 -1
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cli.py +17 -5
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/ray_cluster_manager.py +1 -1
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/endpoint/prediction_future.py +5 -6
- autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint/tabular_endpoint.py +128 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/job/sagemaker_job.py +8 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/model/foundation_model.py +217 -68
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/model/registry.py +33 -8
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/predictor/cloud_predictor.py +35 -48
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/predictor/multimodal_cloud_predictor.py +11 -1
- autogluon_cloud-0.6.0/src/autogluon/cloud/predictor/tabular_cloud_predictor.py +258 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/predictor/timeseries_cloud_predictor.py +23 -35
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/ray_scripts/train.py +5 -4
- autogluon_cloud-0.6.0/src/autogluon/cloud/scripts/sagemaker_scripts/tabular_fm_serve.py +117 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/tabular_serve.py +3 -6
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/train.py +45 -17
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/script_manager.py +1 -0
- autogluon_cloud-0.6.0/src/autogluon/cloud/templates/ag_cloud_sagemaker.yaml +132 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/__init__.py +1 -1
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/ag_sagemaker.py +30 -5
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/constants.py +0 -2
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/dlc_utils.py +32 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/serializers.py +3 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/utils.py +41 -5
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/version.py +1 -1
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0/src/autogluon.cloud.egg-info}/PKG-INFO +12 -27
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/SOURCES.txt +2 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/requires.txt +7 -9
- autogluon_cloud-0.5.0/pyproject.toml +0 -37
- autogluon_cloud-0.5.0/setup.py +0 -158
- autogluon_cloud-0.5.0/src/autogluon/cloud/backend/tabular_sagemaker_backend.py +0 -6
- autogluon_cloud-0.5.0/src/autogluon/cloud/predictor/tabular_cloud_predictor.py +0 -30
- autogluon_cloud-0.5.0/src/autogluon/cloud/templates/ag_cloud_sagemaker.yaml +0 -58
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/LICENSE +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/NOTICE +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/README.md +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/setup.cfg +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/constant.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/multimodal_sagemaker_backend.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/ray_aws_backend.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cloud_setup.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/cluster_config_generator.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/cluster_manager.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/constants.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/ray_aws_cluster_config_generator.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/ray_aws_cluster_manager.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/cluster/ray_cluster_config_generator.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/config.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/data/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/data/format_converter.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/default_cluster_configs/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/default_cluster_configs/ray_aws_default_cluster_config.yaml +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/endpoint/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/endpoint/endpoint.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/endpoint/sagemaker_endpoint.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/endpoint/timeseries_endpoint.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/job/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/job/ray_job.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/job/remote_job.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/model/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/predictor/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/ray_scripts/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/multimodal_serve.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/__init__.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/timeseries.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_fm_serve.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_serve.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/templates/ag_cloud_ray_aws.yaml +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/autogluon_dlc.json +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/aws_utils.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/deserializers.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/ec2.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/iam.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/misc.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/ray_aws_iam.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/s3_utils.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/utils/tag_utils.py +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/dependency_links.txt +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/entry_points.txt +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/top_level.txt +0 -0
- {autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon.cloud.egg-info/zip-safe +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autogluon.cloud
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Train and deploy
|
|
5
|
-
Home-page: https://github.com/autogluon/autogluon-cloud
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Train and deploy ML models in the cloud
|
|
6
5
|
Author: AutoGluon Community
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Project-URL: Documentation, https://auto.gluon.ai
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Documentation, https://auto.gluon.ai/cloud
|
|
9
8
|
Project-URL: Bug Reports, https://github.com/autogluon/autogluon-cloud/issues
|
|
10
9
|
Project-URL: Source, https://github.com/autogluon/autogluon-cloud/
|
|
11
10
|
Project-URL: Contribute!, https://github.com/autogluon/autogluon-cloud/blob/master/CONTRIBUTING.md
|
|
@@ -17,7 +16,6 @@ Classifier: Intended Audience :: Customer Service
|
|
|
17
16
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
18
17
|
Classifier: Intended Audience :: Healthcare Industry
|
|
19
18
|
Classifier: Intended Audience :: Telecommunications Industry
|
|
20
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
21
19
|
Classifier: Operating System :: MacOS
|
|
22
20
|
Classifier: Operating System :: Microsoft :: Windows
|
|
23
21
|
Classifier: Operating System :: POSIX
|
|
@@ -31,14 +29,14 @@ Classifier: Topic :: Software Development
|
|
|
31
29
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
32
30
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
33
31
|
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
34
|
-
Requires-Python:
|
|
32
|
+
Requires-Python: <3.14,>=3.10
|
|
35
33
|
Description-Content-Type: text/markdown
|
|
36
34
|
License-File: LICENSE
|
|
37
35
|
License-File: NOTICE
|
|
38
|
-
Requires-Dist: autogluon.common<1.
|
|
39
|
-
Requires-Dist: boto3<2,>=1.
|
|
36
|
+
Requires-Dist: autogluon.common<1.7,>=0.7
|
|
37
|
+
Requires-Dist: boto3<2,>=1.37.23
|
|
40
38
|
Requires-Dist: packaging<27,>=23.0
|
|
41
|
-
Requires-Dist: sagemaker<3,>=2.
|
|
39
|
+
Requires-Dist: sagemaker<3,>=2.240.0
|
|
42
40
|
Requires-Dist: pyarrow<25,>=19.0.1
|
|
43
41
|
Requires-Dist: PyYAML~=6.0
|
|
44
42
|
Requires-Dist: Pillow<13,>=10.2
|
|
@@ -47,28 +45,15 @@ Requires-Dist: typing_extensions<5,>=4.0
|
|
|
47
45
|
Requires-Dist: click<9,>=8.0
|
|
48
46
|
Requires-Dist: rich<15,>=13.0
|
|
49
47
|
Provides-Extra: ray
|
|
50
|
-
Requires-Dist: ray[default]<2.
|
|
48
|
+
Requires-Dist: ray[default]<2.59,>=2.10.0; extra == "ray"
|
|
51
49
|
Provides-Extra: all
|
|
52
|
-
Requires-Dist: autogluon<1.
|
|
53
|
-
Requires-Dist: ray
|
|
50
|
+
Requires-Dist: autogluon<1.7,>=0.7; extra == "all"
|
|
51
|
+
Requires-Dist: autogluon.cloud[ray]; extra == "all"
|
|
54
52
|
Provides-Extra: tests
|
|
55
|
-
Requires-Dist: moto; extra == "tests"
|
|
56
53
|
Requires-Dist: pytest; extra == "tests"
|
|
54
|
+
Requires-Dist: moto; extra == "tests"
|
|
57
55
|
Requires-Dist: autogluon.common>=0.7; extra == "tests"
|
|
58
|
-
Requires-Dist: pytest-cov; extra == "tests"
|
|
59
|
-
Requires-Dist: tox; extra == "tests"
|
|
60
|
-
Dynamic: author
|
|
61
|
-
Dynamic: classifier
|
|
62
|
-
Dynamic: description
|
|
63
|
-
Dynamic: description-content-type
|
|
64
|
-
Dynamic: home-page
|
|
65
|
-
Dynamic: license
|
|
66
56
|
Dynamic: license-file
|
|
67
|
-
Dynamic: project-url
|
|
68
|
-
Dynamic: provides-extra
|
|
69
|
-
Dynamic: requires-dist
|
|
70
|
-
Dynamic: requires-python
|
|
71
|
-
Dynamic: summary
|
|
72
57
|
|
|
73
58
|
|
|
74
59
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"] # >=77 for PEP 639 SPDX license expression support
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "autogluon.cloud"
|
|
7
|
+
description = "Train and deploy ML models in the cloud"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10,<3.14"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
12
|
+
authors = [{ name = "AutoGluon Community" }]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Intended Audience :: Education",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"Intended Audience :: Customer Service",
|
|
19
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
20
|
+
"Intended Audience :: Healthcare Industry",
|
|
21
|
+
"Intended Audience :: Telecommunications Industry",
|
|
22
|
+
"Operating System :: MacOS",
|
|
23
|
+
"Operating System :: Microsoft :: Windows",
|
|
24
|
+
"Operating System :: POSIX",
|
|
25
|
+
"Operating System :: Unix",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.10",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
31
|
+
"Topic :: Software Development",
|
|
32
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
33
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
34
|
+
"Topic :: Scientific/Engineering :: Image Recognition",
|
|
35
|
+
]
|
|
36
|
+
# version stays dynamic and is owned by setup.py (so the RELEASE=1 -> clean
|
|
37
|
+
# version, else .dev0 logic keeps working).
|
|
38
|
+
dynamic = ["version"]
|
|
39
|
+
dependencies = [
|
|
40
|
+
# common module provides utils with stable api across minor version
|
|
41
|
+
"autogluon.common>=0.7,<1.7",
|
|
42
|
+
# <2 because unlikely to introduce breaking changes in minor releases.
|
|
43
|
+
# TransformAmiVersion was added to the SageMaker service model in botocore 1.37.23.
|
|
44
|
+
"boto3>=1.37.23,<2",
|
|
45
|
+
"packaging>=23.0,<27",
|
|
46
|
+
# Supports forwarding inference_ami_version from Model.deploy.
|
|
47
|
+
"sagemaker>=2.240.0,<3",
|
|
48
|
+
"pyarrow>=19.0.1,<25", # lower bound to avoid https://github.com/apache/arrow/issues/45283
|
|
49
|
+
"PyYAML~=6.0",
|
|
50
|
+
"Pillow>=10.2,<13",
|
|
51
|
+
"huggingface_hub>=0.20,<2",
|
|
52
|
+
"typing_extensions>=4.0,<5",
|
|
53
|
+
# CLI dependencies (autogluon-cloud command)
|
|
54
|
+
"click>=8.0,<9",
|
|
55
|
+
"rich>=13.0,<15",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[project.optional-dependencies]
|
|
59
|
+
ray = ["ray[default]>=2.10.0,<2.59"]
|
|
60
|
+
all = [ # To allow user to pass ag objects
|
|
61
|
+
"autogluon>=0.7,<1.7",
|
|
62
|
+
"autogluon.cloud[ray]",
|
|
63
|
+
]
|
|
64
|
+
tests = [
|
|
65
|
+
"pytest",
|
|
66
|
+
"moto",
|
|
67
|
+
"autogluon.common>=0.7",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[project.urls]
|
|
71
|
+
Documentation = "https://auto.gluon.ai/cloud"
|
|
72
|
+
"Bug Reports" = "https://github.com/autogluon/autogluon-cloud/issues"
|
|
73
|
+
Source = "https://github.com/autogluon/autogluon-cloud/"
|
|
74
|
+
"Contribute!" = "https://github.com/autogluon/autogluon-cloud/blob/master/CONTRIBUTING.md"
|
|
75
|
+
|
|
76
|
+
[project.scripts]
|
|
77
|
+
autogluon-cloud = "autogluon.cloud.cli:main"
|
|
78
|
+
|
|
79
|
+
[tool.setuptools]
|
|
80
|
+
zip-safe = true
|
|
81
|
+
include-package-data = true
|
|
82
|
+
|
|
83
|
+
[tool.setuptools.packages.find]
|
|
84
|
+
where = ["src"]
|
|
85
|
+
namespaces = true
|
|
86
|
+
|
|
87
|
+
[tool.setuptools.package-data]
|
|
88
|
+
"autogluon.cloud" = [
|
|
89
|
+
"default_cluster_configs/*.yaml",
|
|
90
|
+
"utils/autogluon_dlc.json",
|
|
91
|
+
"templates/*.yaml",
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
[tool.ruff]
|
|
95
|
+
line-length = 119
|
|
96
|
+
target-version = "py310"
|
|
97
|
+
|
|
98
|
+
[tool.ruff.lint]
|
|
99
|
+
select = ["E", "F", "I", "W"]
|
|
100
|
+
ignore = ["E501"]
|
|
101
|
+
per-file-ignores = {"*/__init__.py" = ["F401"]}
|
|
102
|
+
|
|
103
|
+
[tool.ruff.lint.isort]
|
|
104
|
+
known-first-party = ["autogluon"]
|
|
105
|
+
|
|
106
|
+
[tool.pytest.ini_options]
|
|
107
|
+
testpaths = ["tests"]
|
|
108
|
+
addopts = "--strict-markers"
|
|
109
|
+
xfail_strict = true
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from setuptools import setup
|
|
4
|
+
|
|
5
|
+
AUTOGLUON = "autogluon"
|
|
6
|
+
CLOUD = "cloud"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def create_version_file(*, version):
|
|
10
|
+
print("-- Building version " + version)
|
|
11
|
+
version_path = os.path.join("src", AUTOGLUON, CLOUD, "version.py")
|
|
12
|
+
with open(version_path, "w") as f:
|
|
13
|
+
f.write(f'"""This is the {AUTOGLUON}.{CLOUD} version file."""\n')
|
|
14
|
+
f.write("__version__ = '{}'\n".format(version))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def update_version(version):
|
|
18
|
+
"""
|
|
19
|
+
To release a new stable version on PyPi, tag the release on github; the Github CI publishes it to PyPi
|
|
20
|
+
(see .github/workflows/pypi_release.yml, which sets RELEASE=1). Non-release builds get a `.dev0` suffix.
|
|
21
|
+
"""
|
|
22
|
+
if not os.getenv("RELEASE"):
|
|
23
|
+
version += ".dev0"
|
|
24
|
+
return version
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
version = "0.6.0"
|
|
28
|
+
version = update_version(version)
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
create_version_file(version=version)
|
|
32
|
+
# Everything except the dynamic version lives in pyproject.toml.
|
|
33
|
+
setup(version=version)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
import os
|
|
2
3
|
|
|
4
|
+
os.environ.setdefault("SAGEMAKER_SUPPRESS_V2_WARNING", "1")
|
|
3
5
|
import sagemaker
|
|
4
6
|
from packaging.version import Version
|
|
5
7
|
|
|
@@ -12,8 +14,9 @@ if Version(sagemaker.__version__) >= Version("3.0"):
|
|
|
12
14
|
from autogluon.common.utils.log_utils import _add_stream_handler
|
|
13
15
|
|
|
14
16
|
from .cloud_setup import bootstrap, register, status, teardown
|
|
17
|
+
from .endpoint.tabular_endpoint import TabularEndpoint
|
|
15
18
|
from .endpoint.timeseries_endpoint import TimeSeriesEndpoint
|
|
16
|
-
from .model.foundation_model import TimeSeriesFoundationModel
|
|
19
|
+
from .model.foundation_model import TabularFoundationModel, TimeSeriesFoundationModel
|
|
17
20
|
from .predictor import MultiModalCloudPredictor, TabularCloudPredictor, TimeSeriesCloudPredictor
|
|
18
21
|
|
|
19
22
|
_add_stream_handler()
|
|
@@ -22,6 +25,8 @@ logging.getLogger(__name__).setLevel(logging.INFO)
|
|
|
22
25
|
__all__ = [
|
|
23
26
|
"MultiModalCloudPredictor",
|
|
24
27
|
"TabularCloudPredictor",
|
|
28
|
+
"TabularEndpoint",
|
|
29
|
+
"TabularFoundationModel",
|
|
25
30
|
"TimeSeriesCloudPredictor",
|
|
26
31
|
"TimeSeriesEndpoint",
|
|
27
32
|
"TimeSeriesFoundationModel",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import json
|
|
3
4
|
import os
|
|
4
|
-
import pickle
|
|
5
5
|
from abc import ABC, abstractmethod
|
|
6
6
|
from typing import Any, Dict, List, Optional, Union
|
|
7
7
|
|
|
@@ -10,6 +10,34 @@ import pandas as pd
|
|
|
10
10
|
from ..endpoint.endpoint import Endpoint
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
def dumps_ag_args(config: Dict[str, Any]) -> str:
|
|
14
|
+
"""Serialize the remote-training config to JSON, raising a user-facing error on failure.
|
|
15
|
+
|
|
16
|
+
The config carries the user's predictor init/fit arguments. Some objects (search spaces,
|
|
17
|
+
custom metric objects, classes/callables in ``hyperparameters``) are not JSON-serializable;
|
|
18
|
+
when that happens we pinpoint the offending argument so the error names what the user passed.
|
|
19
|
+
"""
|
|
20
|
+
try:
|
|
21
|
+
return json.dumps(config)
|
|
22
|
+
except TypeError as e:
|
|
23
|
+
original_error = e
|
|
24
|
+
for group in ("predictor_init_args", "predictor_fit_args"):
|
|
25
|
+
for key, value in (config.get(group) or {}).items():
|
|
26
|
+
try:
|
|
27
|
+
json.dumps(value)
|
|
28
|
+
except TypeError as e:
|
|
29
|
+
raise TypeError(
|
|
30
|
+
f"The value passed for `{key}` is not JSON-serializable. This can happen with "
|
|
31
|
+
f"search spaces (Real/Categorical/Int), custom metric objects, or classes/callables "
|
|
32
|
+
f"in `hyperparameters`. Please pass these as plain values (e.g. metric names as strings). "
|
|
33
|
+
f"Original error: {e}"
|
|
34
|
+
) from e
|
|
35
|
+
# Culprit is outside the known arg groups; re-raise the original error with generic guidance.
|
|
36
|
+
raise TypeError(
|
|
37
|
+
f"The provided arguments are not JSON-serializable. Original error: {original_error}"
|
|
38
|
+
) from original_error
|
|
39
|
+
|
|
40
|
+
|
|
13
41
|
class Backend(ABC):
|
|
14
42
|
name = "backend"
|
|
15
43
|
|
|
@@ -27,12 +55,18 @@ class Backend(ABC):
|
|
|
27
55
|
return self._cloud_output_path
|
|
28
56
|
|
|
29
57
|
def initialize(
|
|
30
|
-
self,
|
|
58
|
+
self,
|
|
59
|
+
local_output_path: str,
|
|
60
|
+
predictor_type: str,
|
|
61
|
+
cloud_output_path: Optional[str] = None,
|
|
62
|
+
resource_prefix: Optional[str] = None,
|
|
63
|
+
**kwargs,
|
|
31
64
|
) -> None:
|
|
32
65
|
"""Initialize the backend."""
|
|
33
66
|
self.local_output_path = local_output_path
|
|
34
67
|
self._cloud_output_path = cloud_output_path
|
|
35
68
|
self.predictor_type = predictor_type
|
|
69
|
+
self.resource_prefix = resource_prefix or f"ag-cloud-{predictor_type}"
|
|
36
70
|
self.original_features = None
|
|
37
71
|
self.endpoint: Optional[Endpoint] = None
|
|
38
72
|
|
|
@@ -83,18 +117,19 @@ class Backend(ABC):
|
|
|
83
117
|
def prepare_args(self, path: str, **kwargs):
|
|
84
118
|
"""
|
|
85
119
|
prepare parameter args required to be passed to remote AG, i.e. init args and fit args
|
|
86
|
-
The args will be saved as a
|
|
120
|
+
The args will be saved as a JSON file
|
|
87
121
|
|
|
88
122
|
Parameters
|
|
89
123
|
----------
|
|
90
124
|
path: str
|
|
91
|
-
Path to save the
|
|
125
|
+
Path to save the JSON file
|
|
92
126
|
"""
|
|
93
127
|
assert self.predictor_type is not None
|
|
94
128
|
config = self._construct_ag_args(**kwargs)
|
|
129
|
+
payload = dumps_ag_args(config)
|
|
95
130
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
96
|
-
with open(path, "
|
|
97
|
-
|
|
131
|
+
with open(path, "w") as f:
|
|
132
|
+
f.write(payload)
|
|
98
133
|
|
|
99
134
|
def _construct_ag_args(**kwargs):
|
|
100
135
|
raise NotImplementedError
|
{autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/backend_factory.py
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
1
3
|
from .backend import Backend
|
|
2
4
|
from .constant import RAY_AWS, TABULAR_RAY_AWS
|
|
3
5
|
from .multimodal_sagemaker_backend import MultiModalSagemakerBackend
|
|
@@ -5,6 +7,8 @@ from .sagemaker_backend import SagemakerBackend
|
|
|
5
7
|
from .tabular_sagemaker_backend import TabularSagemakerBackend
|
|
6
8
|
from .timeseries_sagemaker_backend import TimeSeriesSagemakerBackend
|
|
7
9
|
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
8
12
|
|
|
9
13
|
class BackendFactory:
|
|
10
14
|
_SAGEMAKER_BACKENDS = {
|
|
@@ -20,6 +24,10 @@ class BackendFactory:
|
|
|
20
24
|
if backend in BackendFactory._SAGEMAKER_BACKENDS:
|
|
21
25
|
return BackendFactory._SAGEMAKER_BACKENDS[backend]
|
|
22
26
|
if backend in BackendFactory._RAY_BACKEND_NAMES:
|
|
27
|
+
logger.warning(
|
|
28
|
+
f"The '{backend}' backend is experimental and not fully supported. Use at your own risk; "
|
|
29
|
+
"for production workloads prefer the 'sagemaker' backend."
|
|
30
|
+
)
|
|
23
31
|
try:
|
|
24
32
|
from .ray_aws_backend import RayAWSBackend, TabularRayAWSBackend
|
|
25
33
|
except ImportError as e:
|
|
@@ -17,7 +17,6 @@ from ..data import FormatConverterFactory
|
|
|
17
17
|
from ..endpoint.endpoint import Endpoint
|
|
18
18
|
from ..job.ray_job import RayFitJob
|
|
19
19
|
from ..scripts import ScriptManager
|
|
20
|
-
from ..utils.constants import CLOUD_RESOURCE_PREFIX
|
|
21
20
|
from ..utils.dlc_utils import parse_framework_version, retrieve_image_uri
|
|
22
21
|
from ..utils.ec2 import get_latest_ami
|
|
23
22
|
from ..utils.iam import get_instance_profile_arn
|
|
@@ -143,7 +142,7 @@ class RayBackend(Backend):
|
|
|
143
142
|
If `custom_image_uri` is set, this argument will be ignored.
|
|
144
143
|
job_name: str, default = None
|
|
145
144
|
Name of the launched training job.
|
|
146
|
-
If None,
|
|
145
|
+
If None, AutoGluon Cloud creates one with a predictor-specific prefix.
|
|
147
146
|
instance_type: str, default = 'ml.m5.2xlarge'
|
|
148
147
|
Instance type the predictor will be trained on with SageMaker.
|
|
149
148
|
instance_count: Union[int, str], default = "auto",
|
|
@@ -211,7 +210,7 @@ class RayBackend(Backend):
|
|
|
211
210
|
image_uri = self._get_image_uri(
|
|
212
211
|
framework_version=framework_version, custom_image_uri=custom_image_uri, instance_type=instance_type
|
|
213
212
|
)
|
|
214
|
-
ag_args_path = os.path.join(self.local_output_path, "job", "ag_args.
|
|
213
|
+
ag_args_path = os.path.join(self.local_output_path, "job", "ag_args.json")
|
|
215
214
|
self.prepare_args(
|
|
216
215
|
path=ag_args_path, predictor_init_args=predictor_init_args, predictor_fit_args=predictor_fit_args
|
|
217
216
|
)
|
|
@@ -257,7 +256,7 @@ class RayBackend(Backend):
|
|
|
257
256
|
cluster_manager.setup_connection()
|
|
258
257
|
time.sleep(10) # waiting for connection to setup
|
|
259
258
|
if job_name is None:
|
|
260
|
-
job_name =
|
|
259
|
+
job_name = self.resource_prefix + "-" + get_utc_timestamp_now()
|
|
261
260
|
job = RayFitJob(output_path=self.cloud_output_path + "/model")
|
|
262
261
|
self._fit_job = job
|
|
263
262
|
|
{autogluon_cloud-0.5.0 → autogluon_cloud-0.6.0}/src/autogluon/cloud/backend/sagemaker_backend.py
RENAMED
|
@@ -2,7 +2,6 @@ import copy
|
|
|
2
2
|
import json
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
-
import pickle
|
|
6
5
|
import shutil
|
|
7
6
|
import tarfile
|
|
8
7
|
import tempfile
|
|
@@ -28,8 +27,8 @@ from ..utils.ag_sagemaker import (
|
|
|
28
27
|
AutoGluonRepackInferenceModel,
|
|
29
28
|
)
|
|
30
29
|
from ..utils.aws_utils import resolve_execution_role, setup_sagemaker_session
|
|
31
|
-
from ..utils.constants import
|
|
32
|
-
from ..utils.dlc_utils import parse_framework_version
|
|
30
|
+
from ..utils.constants import VALID_ACCEPT
|
|
31
|
+
from ..utils.dlc_utils import infer_sagemaker_ami_version, parse_framework_version
|
|
33
32
|
from ..utils.misc import MostRecentInsertedOrderedDict
|
|
34
33
|
from ..utils.serializers import AutoGluonSerializationWrapper
|
|
35
34
|
from ..utils.tag_utils import build_tags
|
|
@@ -208,7 +207,7 @@ class SagemakerBackend(Backend):
|
|
|
208
207
|
If `custom_image_uri` is set, this argument will be ignored.
|
|
209
208
|
job_name: str, default = None
|
|
210
209
|
Name of the launched training job.
|
|
211
|
-
If None,
|
|
210
|
+
If None, AutoGluon Cloud creates one with a predictor- or model-specific prefix.
|
|
212
211
|
instance_type: str, default = 'ml.m5.2xlarge'
|
|
213
212
|
Instance type the predictor will be trained on with SageMaker.
|
|
214
213
|
instance_count: int, default = 1
|
|
@@ -224,13 +223,14 @@ class SagemakerBackend(Backend):
|
|
|
224
223
|
Use `get_fit_job_status` to get job status.
|
|
225
224
|
autogluon_sagemaker_estimator_kwargs: dict, default = dict()
|
|
226
225
|
Any extra arguments needed to initialize AutoGluonSagemakerEstimator
|
|
227
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
226
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/training/estimators.html#sagemaker.estimator.Estimator for all options
|
|
228
227
|
fit_kwargs:
|
|
229
228
|
Any extra arguments needed to pass to fit.
|
|
230
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
229
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/training/estimators.html#sagemaker.estimator.Estimator.fit for all options
|
|
231
230
|
extra_ag_args: Optional[Dict[str, Any]], default = None
|
|
232
|
-
Additional entries to merge into ``ag_args.
|
|
233
|
-
train script (e.g. ``predict_after_fit``, or ``id_column`` /
|
|
231
|
+
Additional entries to merge into ``ag_args.json``. Use this to ship caller-specific metadata to the
|
|
232
|
+
train script (e.g. ``predict_after_fit``, ``save_predictor``, or ``id_column`` /
|
|
233
|
+
``timestamp_column`` for time series).
|
|
234
234
|
"""
|
|
235
235
|
if data_channels.get("train_data") is None:
|
|
236
236
|
raise ValueError("`data_channels['train_data']` is required.")
|
|
@@ -251,7 +251,7 @@ class SagemakerBackend(Backend):
|
|
|
251
251
|
logger.log(20, f"Training with framework_version=={framework_version}")
|
|
252
252
|
|
|
253
253
|
if not job_name:
|
|
254
|
-
job_name = sagemaker.utils.unique_name_from_base(
|
|
254
|
+
job_name = sagemaker.utils.unique_name_from_base(self.resource_prefix)
|
|
255
255
|
|
|
256
256
|
if instance_count == "auto":
|
|
257
257
|
instance_count = 1
|
|
@@ -314,7 +314,7 @@ class SagemakerBackend(Backend):
|
|
|
314
314
|
f"`predictions_path` must be a full S3 URL ending in '.csv' or '.parquet' "
|
|
315
315
|
f"(e.g. 's3://bucket/key/predictions.parquet'), got {predictions_path!r}."
|
|
316
316
|
)
|
|
317
|
-
ag_args_path = os.path.join(self.local_output_path, "utils", "ag_args.
|
|
317
|
+
ag_args_path = os.path.join(self.local_output_path, "utils", "ag_args.json")
|
|
318
318
|
self.prepare_args(path=ag_args_path, **ag_args)
|
|
319
319
|
inputs = self._upload_fit_artifact(
|
|
320
320
|
data_channels=data_channels,
|
|
@@ -338,7 +338,7 @@ class SagemakerBackend(Backend):
|
|
|
338
338
|
volume_size=volume_size,
|
|
339
339
|
framework_version=framework_version,
|
|
340
340
|
py_version=py_version,
|
|
341
|
-
base_job_name="
|
|
341
|
+
base_job_name=f"{self.resource_prefix}-train",
|
|
342
342
|
output_path=output_path,
|
|
343
343
|
code_location=code_location,
|
|
344
344
|
inputs=inputs,
|
|
@@ -387,7 +387,7 @@ class SagemakerBackend(Backend):
|
|
|
387
387
|
If None, will deploy the most recent trained predictor trained with `fit()`.
|
|
388
388
|
endpoint_name: str
|
|
389
389
|
The endpoint name to use for the deployment.
|
|
390
|
-
If None,
|
|
390
|
+
If None, AutoGluon Cloud creates one with a predictor- or model-specific prefix.
|
|
391
391
|
framework_version: str, default = `latest`
|
|
392
392
|
Inference container version of autogluon.
|
|
393
393
|
If `latest`, will use the latest available container version.
|
|
@@ -400,7 +400,7 @@ class SagemakerBackend(Backend):
|
|
|
400
400
|
custom_image_uri: Optional[str], default = None,
|
|
401
401
|
Custom image to use to deploy endpoint with.
|
|
402
402
|
If not specified, with use official DLC image:
|
|
403
|
-
https://github.
|
|
403
|
+
https://aws.github.io/deep-learning-containers/reference/available_images/#autogluon
|
|
404
404
|
volume_size: int, default = None
|
|
405
405
|
The size, in GB, of the ML storage volume attached to individual inference instance associated with the production variant.
|
|
406
406
|
Currenly only Amazon EBS gp2 storage volumes are supported.
|
|
@@ -409,10 +409,10 @@ class SagemakerBackend(Backend):
|
|
|
409
409
|
To be noticed, the function won't return immediately because there are some preparations needed prior deployment.
|
|
410
410
|
model_kwargs: dict, default = dict()
|
|
411
411
|
Any extra arguments needed to initialize Sagemaker Model
|
|
412
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
412
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/model.html#model for all options
|
|
413
413
|
deploy_kwargs:
|
|
414
414
|
Any extra arguments needed to pass to deploy.
|
|
415
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
415
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/model.html#sagemaker.model.Model.deploy for all options
|
|
416
416
|
fm_serve_config: Optional[Dict[str, Any]], default = None
|
|
417
417
|
Configuration dict passed to the FM serve script via the AG_FM_SERVE_CONFIG env var.
|
|
418
418
|
inference_mode: {"realtime", "serverless"}, default = "realtime"
|
|
@@ -434,7 +434,7 @@ class SagemakerBackend(Backend):
|
|
|
434
434
|
# Needed to infer the container image (CPU vs GPU) downstream — serverless is CPU-only.
|
|
435
435
|
instance_type = "ml.m5.2xlarge"
|
|
436
436
|
if not endpoint_name:
|
|
437
|
-
endpoint_name = sagemaker.utils.unique_name_from_base(
|
|
437
|
+
endpoint_name = sagemaker.utils.unique_name_from_base(self.resource_prefix)
|
|
438
438
|
|
|
439
439
|
# Resolve container image
|
|
440
440
|
if custom_image_uri:
|
|
@@ -539,6 +539,13 @@ class SagemakerBackend(Backend):
|
|
|
539
539
|
)
|
|
540
540
|
deploy_kwargs = copy.deepcopy(deploy_kwargs or {})
|
|
541
541
|
self._resolve_tags(deploy_kwargs, extra_tags)
|
|
542
|
+
inference_ami_version = infer_sagemaker_ami_version(
|
|
543
|
+
custom_image_uri,
|
|
544
|
+
instance_type,
|
|
545
|
+
image_scope="inference",
|
|
546
|
+
)
|
|
547
|
+
if inference_ami_version is not None:
|
|
548
|
+
deploy_kwargs.setdefault("inference_ami_version", inference_ami_version)
|
|
542
549
|
|
|
543
550
|
instance_kwargs = {
|
|
544
551
|
"instance_type": instance_type,
|
|
@@ -793,7 +800,7 @@ class SagemakerBackend(Backend):
|
|
|
793
800
|
If `custom_image_uri` is set, this argument will be ignored.
|
|
794
801
|
job_name: str, default = None
|
|
795
802
|
Name of the launched training job.
|
|
796
|
-
If None,
|
|
803
|
+
If None, AutoGluon Cloud creates one with a predictor- or model-specific prefix.
|
|
797
804
|
instance_count: int, default = 1,
|
|
798
805
|
Number of instances used to do batch transform.
|
|
799
806
|
instance_type: str, default = 'ml.m5.2xlarge'
|
|
@@ -814,14 +821,14 @@ class SagemakerBackend(Backend):
|
|
|
814
821
|
If `persist` is `False`, file would first be downloaded to this path and then removed.
|
|
815
822
|
model_kwargs: dict, default = dict()
|
|
816
823
|
Any extra arguments needed to initialize Sagemaker Model
|
|
817
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
824
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/model.html#model for all options
|
|
818
825
|
transformer_kwargs: dict
|
|
819
826
|
Any extra arguments needed to pass to transformer.
|
|
820
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
827
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/transformer.html#sagemaker.transformer.Transformer for all options.
|
|
821
828
|
transform_kwargs:
|
|
822
829
|
Any extra arguments needed to pass to transform.
|
|
823
830
|
Please refer to
|
|
824
|
-
https://sagemaker.readthedocs.io/en/
|
|
831
|
+
https://sagemaker.readthedocs.io/en/v2/api/inference/transformer.html#sagemaker.transformer.Transformer.transform for all options.
|
|
825
832
|
|
|
826
833
|
Returns
|
|
827
834
|
-------
|
|
@@ -898,7 +905,7 @@ class SagemakerBackend(Backend):
|
|
|
898
905
|
If `custom_image_uri` is set, this argument will be ignored.
|
|
899
906
|
job_name: str, default = None
|
|
900
907
|
Name of the launched training job.
|
|
901
|
-
If None,
|
|
908
|
+
If None, AutoGluon Cloud creates one with a predictor- or model-specific prefix.
|
|
902
909
|
instance_count: int, default = 1,
|
|
903
910
|
Number of instances used to do batch transform.
|
|
904
911
|
instance_type: str, default = 'ml.m5.2xlarge'
|
|
@@ -919,14 +926,14 @@ class SagemakerBackend(Backend):
|
|
|
919
926
|
If `persist` is `False`, file would first be downloaded to this path and then removed.
|
|
920
927
|
model_kwargs: dict, default = dict()
|
|
921
928
|
Any extra arguments needed to initialize Sagemaker Model
|
|
922
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
929
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/model.html#model for all options
|
|
923
930
|
transformer_kwargs: dict
|
|
924
931
|
Any extra arguments needed to pass to transformer.
|
|
925
|
-
Please refer to https://sagemaker.readthedocs.io/en/
|
|
932
|
+
Please refer to https://sagemaker.readthedocs.io/en/v2/api/inference/transformer.html#sagemaker.transformer.Transformer for all options.
|
|
926
933
|
transform_kwargs:
|
|
927
934
|
Any extra arguments needed to pass to transform.
|
|
928
935
|
Please refer to
|
|
929
|
-
https://sagemaker.readthedocs.io/en/
|
|
936
|
+
https://sagemaker.readthedocs.io/en/v2/api/inference/transformer.html#sagemaker.transformer.Transformer.transform for all options.
|
|
930
937
|
|
|
931
938
|
|
|
932
939
|
Returns
|
|
@@ -1015,9 +1022,9 @@ class SagemakerBackend(Backend):
|
|
|
1015
1022
|
return load_pd.load(local_path)
|
|
1016
1023
|
|
|
1017
1024
|
def _download_ag_args_from_job(self) -> Dict[str, Any]:
|
|
1018
|
-
"""Fetch and
|
|
1025
|
+
"""Fetch and parse the ``ag_args.json`` that was uploaded as the ``ag_args`` channel.
|
|
1019
1026
|
|
|
1020
|
-
Each training job carries the exact
|
|
1027
|
+
Each training job carries the exact config it was launched with as an input channel,
|
|
1021
1028
|
making this the authoritative source — independent of local-disk lifetime.
|
|
1022
1029
|
"""
|
|
1023
1030
|
job_name = self._fit_job.job_name
|
|
@@ -1029,12 +1036,12 @@ class SagemakerBackend(Backend):
|
|
|
1029
1036
|
f"Training job {job_name!r} has no `ag_args` input channel — cannot recover predictions_path."
|
|
1030
1037
|
)
|
|
1031
1038
|
bucket, key = s3_path_to_bucket_prefix(ag_args_uri)
|
|
1032
|
-
assert key.endswith(".
|
|
1039
|
+
assert key.endswith(".json"), f"Expected ag_args channel to point to a .json file, got {ag_args_uri!r}"
|
|
1033
1040
|
with tempfile.TemporaryDirectory(prefix="ag_args_") as tmpdir:
|
|
1034
1041
|
local_path = os.path.join(tmpdir, os.path.basename(key))
|
|
1035
1042
|
self.sagemaker_session.boto_session.client("s3").download_file(bucket, key, local_path)
|
|
1036
|
-
with open(local_path, "
|
|
1037
|
-
return
|
|
1043
|
+
with open(local_path, "r") as f:
|
|
1044
|
+
return json.load(f)
|
|
1038
1045
|
|
|
1039
1046
|
def _construct_ag_args(self, predictor_init_args, predictor_fit_args, leaderboard, **kwargs):
|
|
1040
1047
|
config = dict(
|
|
@@ -1251,7 +1258,7 @@ class SagemakerBackend(Backend):
|
|
|
1251
1258
|
predictor_path = self._upload_predictor(predictor_path, cloud_key_prefix + "/predictor")
|
|
1252
1259
|
|
|
1253
1260
|
if not job_name:
|
|
1254
|
-
job_name = sagemaker.utils.unique_name_from_base(
|
|
1261
|
+
job_name = sagemaker.utils.unique_name_from_base(self.resource_prefix)
|
|
1255
1262
|
|
|
1256
1263
|
if test_data_image_column is not None:
|
|
1257
1264
|
logger.warning("Batch inference with image modality could be slow because of some technical details.")
|
|
@@ -1404,7 +1411,7 @@ class SagemakerBackend(Backend):
|
|
|
1404
1411
|
self.sagemaker_session = setup_sagemaker_session()
|
|
1405
1412
|
self._region = self.sagemaker_session.boto_region_name
|
|
1406
1413
|
if hasattr(self, "_endpoint_saved") and self._endpoint_saved is not None:
|
|
1407
|
-
self.
|
|
1414
|
+
self.attach_endpoint(self._endpoint_saved)
|
|
1408
1415
|
self._endpoint_saved = None
|
|
1409
1416
|
self._fit_job.session = self.sagemaker_session
|
|
1410
1417
|
for job in self._batch_transform_jobs:
|