|
| 1 | + |
| 2 | +# Metrics vLLM-Omni: |
| 3 | + |
| 4 | +You can use these metrics in production to monitor the health and performance of the vLLM-omni system. Typical scenarios include: |
| 5 | +- **Performance Monitoring**: Track throughput (e.g., `e2e_avg_tokens_per_s`), latency (e.g., `e2e_total_ms`), and resource utilization to verify that the system meets expected standards. |
| 6 | +- **Debugging and Troubleshooting**: Use detailed per-request metrics to diagnose issues, such as high transfer times or unexpected token counts. |
| 7 | + |
| 8 | +## How to Enable and View Metrics |
| 9 | + |
| 10 | +### 1. Start the Service with Metrics Logging |
| 11 | + |
| 12 | +```bash |
| 13 | +vllm serve /workspace/models/Qwen3-Omni-30B-A3B-Instruct --omni --port 8014 --log-stats |
| 14 | +``` |
| 15 | + |
| 16 | +### 2. Send a Request |
| 17 | + |
| 18 | +```bash |
| 19 | +python openai_chat_completion_client_for_multimodal_generation.py --query-type use_image |
| 20 | +``` |
| 21 | + |
| 22 | +### 3. What You Will See |
| 23 | + |
| 24 | +With `--log-stats` enabled, the server will output detailed metrics logs after each request. Example output: |
| 25 | + |
| 26 | + |
| 27 | +#### Overall Summary |
| 28 | + |
| 29 | +| Field | Value | |
| 30 | +|-----------------------------|--------------| |
| 31 | +| e2e_requests | 1 | |
| 32 | +| e2e_wall_time_ms | 41,299.190 | |
| 33 | +| e2e_total_tokens | 5,202 | |
| 34 | +| e2e_avg_time_per_request_ms | 41,299.190 | |
| 35 | +| e2e_avg_tokens_per_s | 125.959 | |
| 36 | +| e2e_stage_0_wall_time_ms | 10,192.289 | |
| 37 | +| e2e_stage_1_wall_time_ms | 30,541.409 | |
| 38 | +| e2e_stage_2_wall_time_ms | 207.496 | |
| 39 | + |
| 40 | +#### RequestE2EStats |
| 41 | + |
| 42 | +| Field | Value | |
| 43 | +|-------------------------|------------| |
| 44 | +| e2e_total_ms | 41,299.133 | |
| 45 | +| e2e_total_tokens | 5,202 | |
| 46 | +| transfers_total_time_ms | 245.895 | |
| 47 | +| transfers_total_kbytes | 138,089.939| |
| 48 | + |
| 49 | +#### StageRequestStats |
| 50 | + |
| 51 | +| Field | 0 | 1 | 2 | |
| 52 | +|------------------------|--------|--------|--------| |
| 53 | +| audio_generated_frames | 0 | 0 | 525,525| |
| 54 | +| batch_id | 38 | 274 | 0 | |
| 55 | +| batch_size | 1 | 1 | 1 | |
| 56 | +| num_tokens_in | 4,860 | 4,826 | 4,384 | |
| 57 | +| num_tokens_out | 67 | 275 | 0 | |
| 58 | +| postprocess_time_ms | 256.158| 0.491 | 0.000 | |
| 59 | +| stage_gen_time_ms | 9,910.007|30,379.198|160.745| |
| 60 | + |
| 61 | +#### TransferEdgeStats |
| 62 | + |
| 63 | +| Field | 0->1 | 1->2 | |
| 64 | +|---------------------|-------------|------------| |
| 65 | +| size_kbytes | 109,277.349 | 28,812.591 | |
| 66 | +| tx_time_ms | 78.701 | 18.790 | |
| 67 | +| rx_decode_time_ms | 111.865 | 31.706 | |
| 68 | +| in_flight_time_ms | 2.015 | 2.819 | |
| 69 | + |
| 70 | + |
| 71 | +These logs include: |
| 72 | +- **Overall summary**: total requests, wall time, average tokens/sec, etc. |
| 73 | +- **E2E table**: per-request latency and token counts. |
| 74 | +- **Stage table**: per-stage batch and timing details. |
| 75 | +- **Transfer table**: data transfer and timing for each edge. |
| 76 | + |
| 77 | +You can use these logs to monitor system health, debug performance, and analyze request-level metrics as described above. |
| 78 | + |
| 79 | + |
| 80 | +## Metrics Scope: Offline vs Online Inference |
| 81 | + |
| 82 | +For **offline inference** (batch mode), the summary includes both system-level metrics (aggregated across all requests) and per-request metrics. In this case, `e2e_requests` can be greater than 1, reflecting multiple completed requests in a batch. |
| 83 | + |
| 84 | +For **online inference** (serving mode), the summary is always per-request. `e2e_requests` is always 1, and only request-level metrics are reported for each completion. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Parameter Details |
| 89 | + |
| 90 | +| Field | Meaning | |
| 91 | +|---------------------------|----------------------------------------------------------------------------------------------| |
| 92 | +| `e2e_requests` | Number of completed requests. | |
| 93 | +| `e2e_wall_time_ms` | Wall-clock time span from run start to last completion, in ms. | |
| 94 | +| `e2e_total_tokens` | Total tokens counted across all completed requests (stage0 input + all stage outputs). | |
| 95 | +| `e2e_avg_time_per_request_ms` | Average wall time per request: `e2e_wall_time_ms / e2e_requests`. | |
| 96 | +| `e2e_avg_tokens_per_s` | Average token throughput over wall time: `e2e_total_tokens * 1000 / e2e_wall_time_ms`. | |
| 97 | +| `e2e_stage_{i}_wall_time_ms` | Wall-clock time span for stage i, in ms. Each stage's wall time is reported as a separate field, e.g., `e2e_stage_0_wall_time_ms`, `e2e_stage_1_wall_time_ms`, etc. | |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## E2E Table (per request) |
| 102 | + |
| 103 | +| Field | Meaning | |
| 104 | +|---------------------------|-----------------------------------------------------------------------| |
| 105 | +| `e2e_total_ms` | End-to-end latency in ms. | |
| 106 | +| `e2e_total_tokens` | Total tokens for the request (stage0 input + all stage outputs). | |
| 107 | +| `transfers_total_time_ms` | Sum of transfer edge `total_time_ms` for this request. | |
| 108 | +| `transfers_total_kbytes` | Sum of transfer kbytes for this request. | |
| 109 | + |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Stage Table (per stage event / request) |
| 114 | + |
| 115 | +| Field | Meaning | |
| 116 | +|---------------------------|-------------------------------------------------------------------------------------------------| |
| 117 | +| `batch_id` | Batch index. | |
| 118 | +| `batch_size` | Batch size. | |
| 119 | +| `num_tokens_in` | Input tokens to the stage. | |
| 120 | +| `num_tokens_out` | Output tokens from the stage. | |
| 121 | +| `stage_gen_time_ms` | Stage compute time in ms, excluding postprocessing time (reported separately as `postprocess_time_ms`). | |
| 122 | +| `image_num` | Number of images generated (for diffusion/image stages). | |
| 123 | +| `resolution` | Image resolution (for diffusion/image stages). | |
| 124 | +| `postprocess_time_ms` | Diffusion/image: post-processing time in ms. | |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## Transfer Table (per edge / request) |
| 129 | + |
| 130 | +| Field | Meaning | |
| 131 | +|----------------------|---------------------------------------------------------------------------| |
| 132 | +| `size_kbytes` | Total kbytes transferred. | |
| 133 | +| `tx_time_ms` | Sender transfer time in ms. | |
| 134 | +| `rx_decode_time_ms` | Receiver decode time in ms. | |
| 135 | +| `in_flight_time_ms` | In-flight time in ms. | |
| 136 | + |
| 137 | + |
| 138 | +## Expectation of the Numbers (Verification) |
| 139 | + |
| 140 | +**Formulas:** |
| 141 | +- `e2e_total_tokens = Stage0's num_tokens_in + sum(all stages' num_tokens_out)` |
| 142 | +- `transfers_total_time_ms = sum(tx_time_ms + rx_decode_time_ms + in_flight_time_ms)` for every edge |
| 143 | + |
| 144 | +**Using the example above:** |
| 145 | + |
| 146 | +### e2e_total_tokens |
| 147 | +- Stage0's `num_tokens_in`: **4,860** |
| 148 | +- Stage0's `num_tokens_out`: **67** |
| 149 | +- Stage1's `num_tokens_out`: **275** |
| 150 | +- Stage2's `num_tokens_out`: **0** |
| 151 | + |
| 152 | +So, |
| 153 | +``` |
| 154 | +e2e_total_tokens = 4,860 + 67 + 275 + 0 = 5,202 |
| 155 | +``` |
| 156 | +This matches the table value: `e2e_total_tokens = 5,202`. |
| 157 | + |
| 158 | +### transfers_total_time_ms |
| 159 | +For each edge: |
| 160 | +- 0->1: tx_time_ms (**78.701**) + rx_decode_time_ms (**111.865**) + in_flight_time_ms (**2.015**) = **192.581** |
| 161 | +- 1->2: tx_time_ms (**18.790**) + rx_decode_time_ms (**31.706**) + in_flight_time_ms (**2.819**) = **53.315** |
| 162 | + |
| 163 | +Sum: 192.581 + 53.315 = **245.896** |
| 164 | + |
| 165 | +The table shows `transfers_total_time_ms = 245.895`, which matches the calculation (difference is due to rounding). |
0 commit comments