Commit ad14178
authored
[GuideLLM Refactor] scheduler package updates, rewrites, and tests expansion (#354)
## **Summary**
Introduces a comprehensive constraints system and enhanced timing
control for the scheduler refactor. The implementation moves from
hardcoded execution limits to a flexible, composable constraint system
that enables sophisticated benchmark stopping criteria. Additionally,
request timing calculations are moved from precalculated to per-request
basis, enabling dynamic rate adjustments and better distributed
coordination.
## **Details**
- **Added constraints system** (`constraints.py`): Implements
Protocol-based constraint architecture with support for request limits,
duration limits, error thresholds, and sliding window error rates
- `MaxNumberConstraint`: Limits execution based on request count
- `MaxDurationConstraint`: Limits execution based on time duration
- `MaxErrorsConstraint`: Limits execution based on absolute error count
- `MaxErrorRateConstraint`: Limits execution based on sliding window
error rate
- `MaxGlobalErrorRateConstraint`: Limits execution based on global error
rate
- `ConstraintsInitializerFactory`: Registry system for constraint
creation and serialization
- **Refactored core objects** (`objects.py`): Replaced `result.py` and
expanded capabilities
- Made scheduler package fully generic, decoupling from backend-specific
types
- Added `BackendInterface` protocol for type-safe backend integration
- Enhanced `ScheduledRequestInfo` with comprehensive timing and status
tracking
- Added `SchedulerState` for distributed state coordination
- Introduced `SchedulerUpdateAction` for constraint-based control
signals
- **Enhanced scheduling strategies** (`strategy.py`): Introduced request
timing abstractions
- Added `ScheduledRequestTimings` base class for timing implementations
- `LastCompletionRequestTimings`: For synchronous and concurrent
strategies
- `NoDelayRequestTimings`: For maximum throughput strategies
- `ConstantRateRequestTimings`: For fixed-rate scheduling
- `PoissonRateRequestTimings`: For stochastic request patterns
- Strategies now create per-worker timing instances instead of
precalculated schedules
- **Added environment abstractions** (`environment.py`): Coordination
layer for distributed execution
- `Environment` protocol for distributed synchronization
- `NonDistributedEnvironment` implementation for single-node execution
- **Worker process management** (`worker.py`, `worker_group.py`):
Distributed request processing infrastructure
- Individual worker process management with lifecycle coordination
- Multi-process orchestration with state synchronization
- Constraint evaluation and graceful shutdown coordination
## **Test Plan**
- Full unit tests and some integration tests added and passing
## **Related Issues**
- Part of scheduler refactor initiative to support distributed
benchmarking
---
- [x] "I certify that all code in this PR is my own, except as noted
below."
## **Use of AI**
- [x] Includes AI-assisted code completion
- [x] Includes code generated by an AI application
- [ ] Includes AI-generated tests (NOTE: AI written tests should have a
docstring that includes `## WRITTEN BY AI ##`)File tree
20 files changed
+9298
-1496
lines changed- src/guidellm
- benchmark
- scheduler
- tests/unit/scheduler
20 files changed
+9298
-1496
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
6 | 28 | | |
7 | 29 | | |
8 | | - | |
| 30 | + | |
9 | 31 | | |
10 | 32 | | |
11 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
12 | 39 | | |
| 40 | + | |
13 | 41 | | |
14 | 42 | | |
15 | 43 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 44 | | |
| 45 | + | |
| 46 | + | |
26 | 47 | | |
27 | 48 | | |
28 | 49 | | |
29 | 50 | | |
| 51 | + | |
| 52 | + | |
30 | 53 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
35 | 76 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
40 | 81 | | |
| 82 | + | |
| 83 | + | |
41 | 84 | | |
42 | 85 | | |
43 | 86 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
47 | 90 | | |
0 commit comments