|
| 1 | +<!-- |
| 2 | +SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 3 | +SPDX-License-Identifier: Apache-2.0 |
| 4 | +--> |
| 5 | + |
| 6 | +# Fixed Schedule Benchmarking |
| 7 | + |
| 8 | +Fixed schedule benchmarking provides precise timing control by executing requests at specific timestamps. |
| 9 | +This mode is ideal for simulating exact traffic patterns, testing temporal performance characteristics, |
| 10 | +and reproducing time-sensitive scenarios. |
| 11 | + |
| 12 | +## Overview |
| 13 | + |
| 14 | +Fixed schedule mode enables: |
| 15 | + |
| 16 | +- **Precise Timing**: Execute requests at exact millisecond intervals |
| 17 | +- **Traffic Simulation**: Replicate real-world traffic patterns |
| 18 | +- **Performance Analysis**: Identify how response times vary with request timing |
| 19 | +- **Load Testing**: Test system behavior under controlled temporal stress patterns |
| 20 | + |
| 21 | +## Fixed Schedule File Format |
| 22 | + |
| 23 | +Fixed schedule files use JSONL format with timestamp-based entries: |
| 24 | + |
| 25 | +```jsonl |
| 26 | +{"timestamp": 0, "input_length": 100, "output_length": 200, "hash_ids": [1001]} |
| 27 | +{"timestamp": 500, "input_length": 200, "output_length": 400, "hash_ids": [1002]} |
| 28 | +{"timestamp": 1000, "input_length": 550, "output_length": 500, "hash_ids": [1003, 1005]} |
| 29 | +``` |
| 30 | + |
| 31 | +**Field Descriptions:** |
| 32 | +- `timestamp`: Milliseconds from schedule start when request should be sent |
| 33 | +- `input_length`: Number of tokens in the input prompt |
| 34 | +- `input_text`: Exact text to send in the request (provided instead of input_length) |
| 35 | +- `output_length`: Maximum number of tokens in the response (optional) |
| 36 | +- `hash_ids`: Hash block identifiers to simulate text reuse with 512-token blocks (optional) |
| 37 | + |
| 38 | +## Basic Fixed Schedule Execution |
| 39 | + |
| 40 | +### Setting Up the Server |
| 41 | + |
| 42 | +```bash |
| 43 | +# Start vLLM server for fixed schedule testing |
| 44 | +docker pull vllm/vllm-openai:latest |
| 45 | +docker run --gpus all -p 8000:8000 vllm/vllm-openai:latest \ |
| 46 | + --model Qwen/Qwen3-0.6B \ |
| 47 | + --host 0.0.0.0 --port 8000 & |
| 48 | +``` |
| 49 | + |
| 50 | +```bash |
| 51 | +# Wait for server to be ready |
| 52 | +timeout 900 bash -c 'while [ "$(curl -s -o /dev/null -w "%{http_code}" localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d "{\"model\":\"Qwen/Qwen3-0.6B\",\"messages\":[{\"role\":\"user\",\"content\":\"test\"}],\"max_tokens\":1}")" != "200" ]; do sleep 2; done' || { echo "vLLM not ready after 15min"; exit 1; } |
| 53 | +``` |
| 54 | + |
| 55 | +### Running Basic Fixed Schedule |
| 56 | + |
| 57 | +<!-- aiperf-run-vllm-default-openai-endpoint-server --> |
| 58 | +```bash |
| 59 | +# Create a fixed schedule with precise timing |
| 60 | +cat > precise_schedule.jsonl << 'EOF' |
| 61 | +{"timestamp": 0, "input_length": 100, "hash_ids": [3001]} |
| 62 | +{"timestamp": 500, "input_length": 200, "hash_ids": [3002]} |
| 63 | +{"timestamp": 750, "input_length": 150, "hash_ids": [3003]} |
| 64 | +{"timestamp": 1000, "input_length": 300, "hash_ids": [3004]} |
| 65 | +{"timestamp": 1250, "input_length": 180, "hash_ids": [3005]} |
| 66 | +{"timestamp": 2000, "input_length": 400, "hash_ids": [3006]} |
| 67 | +{"timestamp": 2500, "input_length": 250, "hash_ids": [3007]} |
| 68 | +{"timestamp": 3000, "input_length": 350, "hash_ids": [3008]} |
| 69 | +{"timestamp": 4000, "input_length": 500, "hash_ids": [3009]} |
| 70 | +{"timestamp": 5000, "input_length": 600, "hash_ids": [3010, 3050]} |
| 71 | +EOF |
| 72 | +# Run basic fixed schedule benchmarking |
| 73 | +aiperf profile \ |
| 74 | + --model Qwen/Qwen3-0.6B \ |
| 75 | + --endpoint-type chat \ |
| 76 | + --endpoint /v1/chat/completions \ |
| 77 | + --streaming \ |
| 78 | + --url localhost:8000 \ |
| 79 | + --input-file precise_schedule.jsonl \ |
| 80 | + --custom-dataset-type mooncake_trace \ |
| 81 | + --fixed-schedule-auto-offset |
| 82 | +``` |
| 83 | +<!-- /aiperf-run-vllm-default-openai-endpoint-server --> |
| 84 | + |
| 85 | +**Key Parameters:** |
| 86 | +- `--fixed-schedule-auto-offset`: Automatically adjusts timestamps to start from 0 |
| 87 | + |
| 88 | +## Advanced Schedule Patterns |
| 89 | + |
| 90 | +### Time Window Execution |
| 91 | + |
| 92 | +Execute only a portion of the schedule using start and end offsets: |
| 93 | + |
| 94 | +<!-- aiperf-run-vllm-default-openai-endpoint-server --> |
| 95 | +```bash |
| 96 | +# Execute schedule from 2s to 6s window |
| 97 | +aiperf profile \ |
| 98 | + --model Qwen/Qwen3-0.6B \ |
| 99 | + --endpoint-type chat \ |
| 100 | + --endpoint /v1/chat/completions \ |
| 101 | + --streaming \ |
| 102 | + --url localhost:8000 \ |
| 103 | + --input-file precise_schedule.jsonl \ |
| 104 | + --custom-dataset-type mooncake_trace \ |
| 105 | + --fixed-schedule-start-offset 2000 \ |
| 106 | + --fixed-schedule-end-offset 4000 |
| 107 | +``` |
| 108 | +<!-- /aiperf-run-vllm-default-openai-endpoint-server --> |
| 109 | + |
| 110 | +**Windowing Parameters:** |
| 111 | +- `--fixed-schedule-start-offset 2000`: Start execution at 2000ms timestamp |
| 112 | +- `--fixed-schedule-end-offset 4000`: End execution at 4000ms timestamp |
| 113 | + |
| 114 | + |
| 115 | +## Use Cases |
| 116 | + |
| 117 | +> [!IMPORTANT] |
| 118 | +> **When to Use Fixed Schedule Benchmarking:** |
| 119 | +> - **Traffic Replay**: Reproduce exact timing patterns from production logs |
| 120 | +> - **Temporal Analysis**: Study how performance varies with request timing |
| 121 | +> - **Peak Load Testing**: Test system behavior during known high-traffic periods |
| 122 | +> - **SLA Validation**: Verify performance under specific timing constraints |
| 123 | +> - **Capacity Planning**: Model future load based on projected growth patterns |
| 124 | +> - **Regression Testing**: Ensure temporal performance characteristics remain stable |
| 125 | +
|
| 126 | +## Related Tutorials |
| 127 | + |
| 128 | +- [Trace Benchmarking](trace-benchmarking.md) - For deterministic request patterns |
| 129 | +- [Time-based Benchmarking](time-based-benchmarking.md) - For duration-based testing |
| 130 | +- [Request Cancellation](request-cancellation.md) - For timeout testing |
0 commit comments