damccorm commented on code in PR #40907: URL: https://github.com/apache/beam/pull/40907#discussion_r4486257466
########## sdks/python/apache_beam/ml/inference/autoscaling_metrics.py: ########## @@ -0,0 +1,575 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +"""Capacity-based autoscaling signal for model handlers that run a model server. + +Dataflow's GPU autoscaling reads the process-wide distribution +``num_loaded_models_<tag>`` in the ``BeamML_ModelManager`` namespace as how +many requests each worker can handle, and sizes the pool roughly as +``ceil(backlog / value)``. ``ModelManager`` publishes the number of loaded +model copies there. A handler that serves inference through an out-of-process +model server (vLLM, Triton, ...) always has exactly one copy per worker, so it +publishes an estimate of the worker's capacity under that metric instead. + +Nothing here depends on a particular model server. A handler for a model server +that exposes a completed-requests counter and an in-flight gauge creates a +:class:`NumLoadedModelsPublisher`, supplying only what it knows: the two metric +names, how to find the server's port, and the RunInference model identifier:: Review Comment: I don't think this is quite true. There are some specific requirements here that the model server must have a metrics endpoint publishing Prometheus metrics, right? Instead of `NumLoadedModelsPublisher` should it be `PrometheusNumLoadedModelsPublisher` or something similar? We should also be clearer on the requirements here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
