Commit b0e8e83
Avishek Goswami
refactor: replace scheduler factory functions with mixin pattern
Replace _create_pooling_scheduler() and _create_chunked_prefill_scheduler()
factory functions with PoolingSpyreMixin and ChunkedPrefillSpyreMixin classes.
Each mixin uses _is_async_scheduler() (isinstance check) to detect the concrete
base class at runtime and adjust behaviour accordingly, instead of capturing
is_async via a closure variable.
Concrete classes use simple multiple inheritance:
class PoolingSpyreScheduler(PoolingSpyreMixin, Scheduler): pass
class AsyncPoolingSpyreScheduler(PoolingSpyreMixin, AsyncScheduler): pass
class ChunkedPrefillSpyreScheduler(ChunkedPrefillSpyreMixin, Scheduler): pass
class AsyncChunkedPrefillSpyreScheduler(ChunkedPrefillSpyreMixin, AsyncScheduler): pass
Side effects:
- __module__/__name__/__qualname__ fixup blocks removed (no longer needed)
- _async_warning_logged flag removed (debug log emitted each call is fine)
- TYPE_CHECKING import removed (unused after refactor)
Signed-off-by: Avishek Goswami <[email protected]>1 parent d2b3b1f commit b0e8e83
8 files changed
Lines changed: 1354 additions & 590 deletions
File tree
- tests
- utils
- v1/core
- vllm_spyre
- v1
- core
- worker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
| |||
0 commit comments