Utilice el plugin de vLLM/SGLang del agente de Python de Application Monitoring para rastrear solicitudes, recopilar métricas clave y monitorear el rendimiento del motor de inference.
ARMS admite la observability únicamente para vLLM/SGLang framework.
Integración con PAI-EAS
Elastic Algorithm Service (EAS) es un producto de PAI diseñado para inference en línea. Permite desplegar servicios de modelos en grupos de recursos públicos o dedicados para realizar inference en tiempo real sobre hardware heterogéneo, como CPU y GPU.
Paso 1: Preparar las variables de entorno
export ARMS_APP_NAME=xxx # The name of the EAS application.
export ARMS_REGION_ID=xxx # The region ID of your Alibaba Cloud account.
export ARMS_LICENSE_KEY=xxx # The Alibaba Cloud license key.
Paso 2: Modificar el comando de ejecución de PAI-EAS
Inicie sesión en la PAI console. En la barra de navegación superior, seleccione la región de destino y luego vaya al workspace correspondiente.
En el panel de navegación izquierdo, elija .
En la pestaña Inference Service, localice la aplicación objetivo y haga clic en Update dentro de la columna Actions.
-
Modifique el comando de ejecución.
Este ejemplo utiliza el modelo DeepSeek-R1-Distill-Qwen-7B.
Comando original de vLLM:
gpu_count=$(nvidia-smi --query-gpu=count --format=csv,noheader | wc -l);vllm serve /model_dir --host 0.0.0.0 --port 8000 --root-path '/' --trust-remote-code --gpu-memory-utilization 0.95 --max-model-len 32768 --tensor-parallel-size $gpu_count --served-model-name DeepSeek-R1-Distill-Qwen-7BComando de vLLM para la integración con Application Monitoring:
gpu_count=$(nvidia-smi --query-gpu=count --format=csv,noheader | wc -l);pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ ; pip3 config set install.trusted-host mirrors.aliyun.com; pip3 install aliyun-bootstrap;ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;ARMS_APP_NAME=qwq32 ARMS_LICENSE_KEY=it0kjz0oxz@3115ad****** ARMS_REGION_ID=cn-hangzhou aliyun-instrument vllm serve /model_dir --host 0.0.0.0 --port 8000 --root-path '/' --trust-remote-code --gpu-memory-utilization 0.95 --max-model-len 32768 --tensor-parallel-size $gpu_count --served-model-name DeepSeek-R1-Distill-Qwen-7BDescripción de los comandos agregados:
-
Configure el repositorio PyPI. Ajuste esta configuración según sea necesario.
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ ; pip3 config set install.trusted-host mirrors.aliyun.com; -
Descargue el instalador del agente.
pip3 install aliyun-bootstrap; -
Instale el agente mediante el instalador.
Reemplace
cn-hangzhoupor su región real.ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;
Comando original de SGLang:
python -m sglang.launch_server --model-path /model_dirComando para integrar SGLang con Application Monitoring:
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ ; pip3 config set install.trusted-host mirrors.aliyun.com; pip3 install aliyun-bootstrap;ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;ARMS_APP_NAME=qwq32 ARMS_LICENSE_KEY=it0kjz0oxz@3115ad****** ARMS_REGION_ID=cn-hangzhou aliyun-instrument python -m sglang.launch_server --model-path /model_dirDescripción de los comandos:
-
Configure el repositorio PyPI. Ajuste esta configuración según sea necesario.
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ ; pip3 config set install.trusted-host mirrors.aliyun.com; -
Descargue el instalador del agente.
pip3 install aliyun-bootstrap; -
Instale el agente.
Reemplace
cn-hangzhoupor su región real.ARMS_REGION_ID=cn-hangzhou aliyun-bootstrap -a install;
-
Haga clic en Update.
Integración de modelos para escenarios generales
ARMS solo es compatible con las versiones oficiales de vLLM (V0 y V1) y SGLang. Las versiones modificadas no son compatibles. Para consultar la lista detallada de versiones compatibles, véase Large Language Model (LLM) Service.
ARMS admite escenarios de completion y chat; recopila dos spans para solicitudes sin streaming y tres para solicitudes con streaming.
Escenarios compatibles | Procesamiento de datos | Contenido recopilado | vLLM V0 | vLLM V1 | SGLang |
Chat o completion | Streaming | span |
|
|
|
key metrics TTFT/TPOP | Compatible | No compatible | Compatible | ||
Sin streaming | span |
|
|
| |
key metrics TTFT/TPOP | No aplica | No aplica | No aplica | ||
Embedding | http | No compatible | No compatible | No compatible | |
Rerank | http | No compatible | No compatible | No compatible | |
Spans y atributos importantes
Relacionados con llm_request:
|
Atributo |
Descripción |
|
gen_ai.latency.e2e |
Tiempo de extremo a extremo |
|
gen_ai.latency.time_in_queue |
Tiempo en cola |
|
gen_ai.latency.time_in_scheduler |
Tiempo de programación |
|
gen_ai.latency.time_to_first_token |
Tiempo hasta el primer token |
|
gen_ai.request.id |
ID de solicitud |