Skip to content

Commit 95d4a27

Browse files
committed
feat(serve): size workloads from an endpoint's traffic
Add read_endpoint_traffic(), which reads the traffic one model on an endpoint served over the last 1 to 7 days: the busiest hour's concurrency for the whole deployment (ConcurrentRequestsPerCopy or ConcurrentRequestsPerModel times the current copies or instances) and, with detailed observability on, the request count and the mean and standard deviation of the prompt and generated tokens of the requests a vLLM container completed. The token histograms are read through CloudWatch's Prometheus-compatible query API with the session's credentials. The histograms are cumulative, so each series' traffic in the window is its newest snapshot in the window less its last one before it, read with one instant query a day. An adapter's requests run in its base component's container, which publishes the concurrency and the token histograms for them, so an adapter reads its base component, and finding the component skips adapters. Add Workload.from_endpoint(), which builds a synthetic workload from them, so a benchmark or recommendation job can be sized from what an endpoint serves today.
1 parent 94899a9 commit 95d4a27

4 files changed

Lines changed: 1089 additions & 0 deletions

File tree

‎sagemaker-serve/src/sagemaker/serve/ai_inference_recommender/__init__.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
compare_benchmarks,
4040
)
4141
from sagemaker.serve.ai_inference_recommender.secrets import Secret
42+
from sagemaker.serve.ai_inference_recommender.traffic import (
43+
EndpointTraffic,
44+
TokenStats,
45+
read_endpoint_traffic,
46+
)
4247
from sagemaker.serve.ai_inference_recommender.workload import Workload
4348
from sagemaker.serve.ai_inference_recommender._model_builder_methods import (
4449
start_benchmark,
@@ -51,15 +56,18 @@
5156
"BenchmarkMetrics",
5257
"BenchmarkResult",
5358
"BenchmarkSearchResult",
59+
"EndpointTraffic",
5460
"FeatureGatedError",
5561
"InferenceFramework",
5662
"PerformanceTarget",
5763
"RecommendationJob",
5864
"Secret",
65+
"TokenStats",
5966
"Workload",
6067
"WorkloadValidationError",
6168
"compare_benchmarks",
6269
"list_benchmarks",
6370
"list_recommendations",
71+
"read_endpoint_traffic",
6472
"start_benchmark",
6573
]

0 commit comments

Comments
 (0)