- Eliminate core/ directory into cache/, runtime/, network/ subpackages plus flat modules
- Split cache.py (647 lines) into cache/{buffer,strategy,pool}.py by layer
- Add explicit ContiguousStrategy, make AllocationStrategy a real ABC
- Move TaskCacheState to cache/strategy.py, drop string forward references
- Rename api/ to network/, server.py to app.py
- Move sample.py into runtime/ alongside executor and graph
- Simplify TaskCacheManager.__init__ to single pool param
- Expose pool.strategy and pool.req_pool as public properties
- Fix KVCache import in attention_backend.py (TYPE_CHECKING guard)
- Fix steady-state decode reading uninitialized position_ids on first step
26 lines
606 B
Python
26 lines
606 B
Python
"""Execution primitives: forward passes, CUDA graphs, and sampling."""
|
|
|
|
from astrai.inference.runtime.executor import Executor
|
|
from astrai.inference.runtime.graph import CudaGraphContext
|
|
from astrai.inference.runtime.sample import (
|
|
BaseSamplingStrategy,
|
|
FrequencyPenaltyStrategy,
|
|
SamplingPipeline,
|
|
TemperatureStrategy,
|
|
TopKStrategy,
|
|
TopPStrategy,
|
|
sample,
|
|
)
|
|
|
|
__all__ = [
|
|
"Executor",
|
|
"CudaGraphContext",
|
|
"BaseSamplingStrategy",
|
|
"FrequencyPenaltyStrategy",
|
|
"SamplingPipeline",
|
|
"TemperatureStrategy",
|
|
"TopKStrategy",
|
|
"TopPStrategy",
|
|
"sample",
|
|
]
|