Commit 3f7f7ac
Scheduler refactor [utils]: auto_importer, pydantic_utils, registry, singleton (#289)
## Summary
This PR introduces four new utility modules that provide foundational
capabilities for auto-discovery, registry patterns, singleton
management, and enhanced Pydantic utilities. It additionally
consolidates the pydantic utility classes from guidellm.objects into the
dedicated guidellm.utils module containing the new additions. This
change improves code organization and establishes the foundation for
upcoming scheduler refactoring work.
## Details
- **Moved core
utilities** from `guidellm.objects.pydantic` to `guidellm.utils.pydantic_utils`
- **Added `AutoImporterMixin`** for dynamic module discovery within
packages
- **Added `RegistryMixin`** for object registration with optional
auto-discovery
- **Added singleton
mixins** (`SingletonMixin`, `ThreadSafeSingletonMixin`) for instance
management
- **Enhanced Pydantic
utilities** with `ReloadableBaseModel`, `StandardBaseDict`,
and `PydanticClassRegistryMixin` for polymorphic model serialization
- **Updated all imports** across the codebase to reference new module
locations
- **Added comprehensive test coverage** for all new utility modules
- **Removed obsolete** `guidellm.objects.pydantic` module and associated
tests
## Test Plan
- Run existing test suite to ensure no regressions from import changes
- Execute new utility module test suites covering smoke, sanity, and
regression scenarios
## Related Issues
---
- [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 ##`)
---------
Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]>1 parent a99d1bc commit 3f7f7ac
File tree
25 files changed
+2651
-152
lines changed- src/guidellm
- backend
- benchmark
- objects
- request
- scheduler
- utils
- tests/unit
- objects
- utils
25 files changed
+2651
-152
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
43 | | - | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments