Skip to content

Commit c9966d2

Browse files
Yadan-WeiYadan Wei
andauthored
Feature: Add XGBoost 3.0-5 to v2 (#5406)
* add xgboost 3.0-5 to v2 * fix pip install env * fix test * fix test * change model load version --------- Co-authored-by: Yadan Wei <yadanwei@amazon.com>
1 parent c0b4e0a commit c9966d2

File tree

4 files changed

+91
-4
lines changed

4 files changed

+91
-4
lines changed

src/sagemaker/image_uri_config/xgboost.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,48 @@
395395
"us-west-2": "246618743249"
396396
},
397397
"repository": "sagemaker-xgboost"
398+
},
399+
"3.0-5": {
400+
"registries": {
401+
"af-south-1": "510948584623",
402+
"ap-east-1": "651117190479",
403+
"ap-northeast-1": "354813040037",
404+
"ap-northeast-2": "366743142698",
405+
"ap-northeast-3": "867004704886",
406+
"ap-south-1": "720646828776",
407+
"ap-south-2": "628508329040",
408+
"ap-southeast-1": "121021644041",
409+
"ap-southeast-2": "783357654285",
410+
"ap-southeast-3": "951798379941",
411+
"ap-southeast-4": "106583098589",
412+
"ca-central-1": "341280168497",
413+
"ca-west-1": "190319476487",
414+
"cn-north-1": "450853457545",
415+
"cn-northwest-1": "451049120500",
416+
"eu-central-1": "492215442770",
417+
"eu-central-2": "680994064768",
418+
"eu-north-1": "662702820516",
419+
"eu-south-1": "978288397137",
420+
"eu-south-2": "104374241257",
421+
"eu-west-1": "141502667606",
422+
"eu-west-2": "764974769150",
423+
"eu-west-3": "659782779980",
424+
"il-central-1": "898809789911",
425+
"me-central-1": "272398656194",
426+
"me-south-1": "801668240914",
427+
"sa-east-1": "737474898029",
428+
"us-east-1": "683313688378",
429+
"us-east-2": "257758044811",
430+
"us-gov-east-1": "237065988967",
431+
"us-gov-west-1": "414596584902",
432+
"us-iso-east-1": "833128469047",
433+
"us-isob-east-1": "281123927165",
434+
"us-isof-east-1": "108575199400",
435+
"us-isof-south-1": "124985052026",
436+
"us-west-1": "746614075791",
437+
"us-west-2": "246618743249"
438+
},
439+
"repository": "sagemaker-xgboost"
398440
}
399441
}
400442
},
@@ -794,6 +836,48 @@
794836
"us-west-2": "246618743249"
795837
},
796838
"repository": "sagemaker-xgboost"
839+
},
840+
"3.0-5": {
841+
"registries": {
842+
"af-south-1": "510948584623",
843+
"ap-east-1": "651117190479",
844+
"ap-northeast-1": "354813040037",
845+
"ap-northeast-2": "366743142698",
846+
"ap-northeast-3": "867004704886",
847+
"ap-south-1": "720646828776",
848+
"ap-south-2": "628508329040",
849+
"ap-southeast-1": "121021644041",
850+
"ap-southeast-2": "783357654285",
851+
"ap-southeast-3": "951798379941",
852+
"ap-southeast-4": "106583098589",
853+
"ca-central-1": "341280168497",
854+
"ca-west-1": "190319476487",
855+
"cn-north-1": "450853457545",
856+
"cn-northwest-1": "451049120500",
857+
"eu-central-1": "492215442770",
858+
"eu-central-2": "680994064768",
859+
"eu-north-1": "662702820516",
860+
"eu-south-1": "978288397137",
861+
"eu-south-2": "104374241257",
862+
"eu-west-1": "141502667606",
863+
"eu-west-2": "764974769150",
864+
"eu-west-3": "659782779980",
865+
"il-central-1": "898809789911",
866+
"me-central-1": "272398656194",
867+
"me-south-1": "801668240914",
868+
"sa-east-1": "737474898029",
869+
"us-east-1": "683313688378",
870+
"us-east-2": "257758044811",
871+
"us-gov-east-1": "237065988967",
872+
"us-gov-west-1": "414596584902",
873+
"us-iso-east-1": "833128469047",
874+
"us-isob-east-1": "281123927165",
875+
"us-isof-east-1": "108575199400",
876+
"us-isof-south-1": "124985052026",
877+
"us-west-1": "746614075791",
878+
"us-west-2": "246618743249"
879+
},
880+
"repository": "sagemaker-xgboost"
797881
}
798882
}
799883
},

src/sagemaker/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ def _generate_framework_script(
19271927
# Some py3 containers has typing, which may breaks pip install
19281928
pip uninstall --yes typing
19291929
1930-
pip install -r requirements.txt
1930+
python -m pip install -r requirements.txt
19311931
fi
19321932
19331933
{entry_point_command} {entry_point} "$@"

tests/integ/test_xgboost.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ def test_xgboost_serverless_inference(
137137
model_data=model_data,
138138
role=ROLE,
139139
entry_point=os.path.join(DATA_DIR, "xgboost_abalone", "abalone.py"),
140-
framework_version="1.5-1",
140+
# XGBoost changed its default model format:
141+
# - Old XGBoost (< 2.0): Default save format was binary
142+
# - New XGBoost (>= 2.0): Default save format is JSON/UBJSON
143+
framework_version="3.0-5",
141144
)
142145

143146
xgboost.deploy(

tests/unit/test_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ def test_generate_framework_script(pipeline_session):
11791179
# Some py3 containers has typing, which may breaks pip install
11801180
pip uninstall --yes typing
11811181
1182-
pip install -r requirements.txt
1182+
python -m pip install -r requirements.txt
11831183
fi
11841184
11851185
python process.py "$@"
@@ -1226,7 +1226,7 @@ def test_generate_framework_script_with_codeartifact(pipeline_session):
12261226
# Some py3 containers has typing, which may breaks pip install
12271227
pip uninstall --yes typing
12281228
1229-
pip install -r requirements.txt
1229+
python -m pip install -r requirements.txt
12301230
fi
12311231
12321232
python process.py "$@"

0 commit comments

Comments
 (0)