feat(serve): add SageMaker GenAI inference benchmarking and recommendation#5874
Open
ZealSV wants to merge 4 commits into
Open
feat(serve): add SageMaker GenAI inference benchmarking and recommendation#5874ZealSV wants to merge 4 commits into
ZealSV wants to merge 4 commits into
Conversation
c0cfc77 to
747baeb
Compare
747baeb to
bb8c26a
Compare
bb8c26a to
1d9b769
Compare
…ation
Adds sagemaker.serve.ai_inference_recommender, a thin ergonomic layer
over sagemaker-core's AIBenchmarkJob, AIRecommendationJob, and
AIWorkloadConfig resources.
ModelBuilder gains a new entry point and extends two existing verbs:
# Benchmark a deployed endpoint
job = mb.start_benchmark(endpoint=ep, workload=Workload.synthetic(...))
result = BenchmarkResult.from_job(job)
# Recommendation flow extends optimize() and deploy()
mb.optimize(workload=..., performance_target="throughput",
instance_types=["ml.g6.12xlarge"])
endpoint = mb.deploy(role=role) # top recommendation
endpoint = mb.deploy(role=role, recommendation_index=2) # alternative
print(result) and print(mb.recommendations[0]) render their data as
tables.
Public surface added under sagemaker.serve:
* Workload -- typed factory; extras pass through **params, validated
server-side.
* BenchmarkResult / BenchmarkMetrics / BenchmarkMetric -- parses the
AIPerf output.tar.gz from S3.
* Secret -- opt-in helper for tokens >512 chars (Secrets Manager).
* BenchmarkJob, RecommendationJob -- re-exports without the AI prefix.
* FeatureGatedError, WorkloadValidationError -- typed exceptions.
Pin-mode and workload-mode optimize() kwargs are mutually exclusive.
Recommendation deploy uses the ModelPackage path (auto-approves the
package the rec job publishes).
Includes 51 unit tests and 2 slow_test integ tests
(tests/integ/test_ai_inference_recommender_integration.py) verified
end-to-end against real AWS.
Rebased onto upstream to pick up aws#5860 (preserve falsy values in
sagemaker-core serialize), required so optimize_model=False reaches
the wire.
1d9b769 to
31f40bd
Compare
…ation
Adds sagemaker.serve.ai_inference_recommender, a thin ergonomic layer
over sagemaker-core's AIBenchmarkJob, AIRecommendationJob, and
AIWorkloadConfig resources.
ModelBuilder gains a new entry point and extends two existing verbs:
# Benchmark a deployed endpoint
job = mb.start_benchmark(endpoint=ep, workload=Workload.synthetic(...))
result = BenchmarkResult.from_job(job)
# Recommendation flow extends optimize() and deploy()
mb.optimize(workload=..., performance_target="throughput",
instance_types=["ml.g6.12xlarge"])
endpoint = mb.deploy(role=role) # top recommendation
endpoint = mb.deploy(role=role, recommendation_index=2) # alternative
print(result) and print(mb.recommendations[0]) render their data as
tables.
Public surface added under sagemaker.serve:
* Workload -- typed factory; extras pass through **params, validated
server-side.
* BenchmarkResult / BenchmarkMetrics / BenchmarkMetric -- parses the
AIPerf output.tar.gz from S3.
* Secret -- opt-in helper for tokens >512 chars (Secrets Manager).
* BenchmarkJob, RecommendationJob -- re-exports without the AI prefix.
* FeatureGatedError, WorkloadValidationError -- typed exceptions.
Pin-mode and workload-mode optimize() kwargs are mutually exclusive.
Recommendation deploy uses the ModelPackage path (auto-approves the
package the rec job publishes).
Includes 51 unit tests and 2 slow_test integ tests
(tests/integ/test_ai_inference_recommender_integration.py) verified
end-to-end against real AWS.
Rebased onto upstream to pick up aws#5860 (preserve falsy values in
sagemaker-core serialize), required so optimize_model=False reaches
the wire.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds sagemaker.serve.ai_inference_recommender, a thin ergonomic layer
over sagemaker-core's AIBenchmarkJob, AIRecommendationJob, and
AIWorkloadConfig resources.
ModelBuilder gains a new entry point and extends two existing verbs:
Benchmark a deployed endpoint
job = mb.start_benchmark(endpoint=ep, workload=Workload.synthetic(...))
result = BenchmarkResult.from_job(job)
Recommendation flow extends optimize() and deploy()
mb.optimize(workload=..., performance_target="throughput",
instance_types=["ml.g6.12xlarge"])
endpoint = mb.deploy(role=role) # top recommendation
endpoint = mb.deploy(role=role, recommendation_index=2) # alternative
print(result) and print(mb.recommendations[0]) render their data as
tables.
Public surface added under sagemaker.serve:
server-side.
AIPerf output.tar.gz from S3.
Pin-mode and workload-mode optimize() kwargs are mutually exclusive.
Recommendation deploy uses the ModelPackage path (auto-approves the
package the rec job publishes).
Includes 51 unit tests and 2 slow_test integ tests
(tests/integ/test_ai_inference_recommender_integration.py) verified
end-to-end against real AWS.
Rebased onto upstream to pick up #5860 (preserve falsy values in
sagemaker-core serialize), required so optimize_model=False reaches
the wire.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.