mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-21 00:23:30 -05:00
Run quartodoc build against the refactored package (engine/ extracted from core/, infra->infrastructure): regenerate the API reference so every stub points at the new paths. Adds engine.*/infrastructure.* stubs, removes the 41 stale core.solver.* / core.engine.* / core.scenarios.* / core.config.* / core.evaluation.* / infra*.qmd orphans, and refreshes the package pages (core now primitives-only) + index. Verified: all 47 documented symbols resolve in the new package; every index link resolves; zero stale mlsysim.core.<engine-mod> / mlsysim.infra references anywhere in docs/. (objects.json inventory is gitignored -- regenerated at build.)
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
# engine.solver.ContinuousBatchingModel { #mlsysim.engine.solver.ContinuousBatchingModel }
|
|
|
|
```python
|
|
engine.solver.ContinuousBatchingModel()
|
|
```
|
|
|
|
Analyzes production LLM serving with Continuous Batching and PagedAttention.
|
|
|
|
Traditional static batching suffers from severe memory fragmentation and
|
|
padding waste. This model simulates the throughput improvements achieved by
|
|
iteration-level scheduling and non-contiguous KV cache allocation.
|
|
|
|
Literature Source:
|
|
1. Kwon et al. (2023), "Efficient Memory Management for Large Language Model
|
|
Serving with PagedAttention."
|
|
2. Yu et al. (2022), "ORCA: A Distributed Serving System for
|
|
Transformer-Based Generative Models."
|
|
|
|
## Methods
|
|
|
|
| Name | Description |
|
|
| --- | --- |
|
|
| [solve](#mlsysim.engine.solver.ContinuousBatchingModel.solve) | Calculates continuous batching throughput and PagedAttention memory. |
|
|
|
|
### solve { #mlsysim.engine.solver.ContinuousBatchingModel.solve }
|
|
|
|
```python
|
|
engine.solver.ContinuousBatchingModel.solve(
|
|
model,
|
|
hardware,
|
|
seq_len,
|
|
max_batch_size=1,
|
|
page_size=16,
|
|
precision='fp16',
|
|
efficiency=0.5,
|
|
)
|
|
```
|
|
|
|
Calculates continuous batching throughput and PagedAttention memory.
|