Alterna · learning material
17.4 Several queries use common computing
One request may end before another, and the planner changes the size of the computer, not the weight of the model.
What this material covers
- Batch composition can change between decode tics
Content and key concepts
On the previous page, how one option is chosen.
One request may end before another, and the planner changes the size of the computer, not the weight of the model.
The first start-up process the prefix. Each subsequent one adds one entry; K/V past entries can be saved. Sample and compressed storage solve different tasks.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
Batch composition can change between decode tics
If you're static batching, all requests start together, and the short ones can wait long. Continuous batching removes completed sections and adds new ones so that each activity will service the relevant set. Scheduler must take into account the available KV-memory, token Budget, priority and fireness, and not just the maximum batches. F09.
In simplified fixture, three requests have residues.
[2,1,3]
. For tic, each active request produces one token, so action counts
[3,2,1]
The real iteration time is not required to be constant:
W
t
o
k
e
n
s
=
∑
t
B
t
,
t
h
r
o
u
g
h
p
u
t
=
completed output tokens
wall time
.
W_{tokens}=\sum_t B_t,
\qquad throughput=\frac{\text{completed output tokens}}{\text{wall time}}.
W
t
o
k
e
n
s
=
t
∑
B
t
,
t
h
ro
ug
h
p
u
t
=
wall time
completed output tokens
.
That's what the model shows.
Timeline distinguishes between waiting, prefill, decoded and completed. A good triughput can coexist with a bad latincy separate target, so the dashboard shows queue time, TTFT and inter-token latecy separately. The admission control should reject or delay the request to allocation, rather than fall in the midst of energy without a clear error.
Scope of applicability.
The training tic does not model different prompt ength, specific decoding, preemption, prefix caching or hardware occulancy. Aggressive batching can increase the latecy. Priorities without agling create starvation; fireness policy should be observed and tested.
remaining_17d=[2,1,3]; active_counts_17d=[]
while any(remaining_17d):
active_counts_17d.append(sum(value>0 for value in remaining_17d))
remaining_17d=[max(0,value-1) for value in remaining_17d]
assert active_counts_17d==[3,2,1] and sum(active_counts_17d)==6
The code repeats the operations just taken care of.
Completely checked Python-example Chapter
Available with a separate file; the short piece shown does not replace its implementation.
Scheduler uses slots together, without re-learning the model.
Close balance storage. How does this question continue?
Python examples of chapter 17
Academic base