Continuous Batching Analysis
Continuous Batching ์ฌ์ธต ๋ถ์
Dynamic Scheduler ยท Decode Slot Refill ยท Chunked Prefill ยท PagedAttention ยท Fairness vs Throughput
Continuous batching์ ๋์ฝ๋ฉ ๋ฐฐ์น๋ฅผ 'ํ ๋ฒ ๊ณ ์ ํ๊ณ ๋๋ ๋๊น์ง ์ ์ง'ํ๋ ๋์ , ํ ํฐ์ด ๋๋๋ ์๊ฐ๋ง๋ค ๋น ์ฌ๋กฏ์ ์ ์์ฒญ์ผ๋ก ์ฆ์ ์ฑ์ฐ๋ ๋์ ์ค์ผ์ค๋ง ๊ธฐ๋ฒ์ ๋๋ค. ๋์ฝ๋ฉ์ด ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ด๋์ธ LLM ์๋น์์๋ ์ด ๋จ์ํ ์ ์ฑ ์ฐจ์ด๊ฐ GPU ํ์ฉ๋์ ์ฒ๋ฆฌ๋์ ํฌ๊ฒ ๋ฐ๊พธ๋ฉฐ, ์ค๋๋ vLLM๋ฅ ์์ง์ ๊ธฐ๋ณธ ์ด์ ๋ชจ๋๊ฐ ๋์์ต๋๋ค.
ORCA๋ iteration-level scheduling๊ณผ selective batching์ผ๋ก ๊ฐ์ ๋ฌธ์ ๋ฅผ ๋จผ์ ํ์๊ณ , vLLM์ chunked prefill๋ก decode ์ฐ์ ์ ์ฑ ์ ์กฐ์ ํ๋ฉฐ, TensorRT-LLM์ in-flight batching๊ณผ chunked context๋ก ์ด๋ฅผ ์ ํํํฉ๋๋ค. ์ด ๋ฌธ์๋ ์ ์ ๋ฐฐ์น์ ๋ญ๋น โ ์ฐ์ ๋ฐฐ์น ๋ฃจํ โ prefill/decode ๊ฐ์ญ โ ๋น๊ต/๋ถ์ โ ์ฅ๋จ์ โ ๊ด๋ จ ๊ธฐ์ ์ ์์๋ก ๋ถ์ํฉ๋๋ค.
์ค์ ์ด์์์๋ ์ค์ผ์ค๋ฌ๋ง ์ ์ง ๋ค๊ณ ๋๋์ง ์์ต๋๋ค. ๋น ์ฌ๋กฏ์ ๋ค์ ์ฑ์ฐ๋ ์๋์ ํจ๊ป KV cache๋ฅผ ์ผ๋ง๋ ์ ํ์ ์ํค๋์ง, ๊ธด prefill์ ์ผ๋ง๋ ์๊ฒ ์ชผ๊ฐ decode์ ๊ณต์กด์ํค๋์ง, ๊ทธ๋ฆฌ๊ณ SLA๊ฐ ๋ค๋ฅธ ์์ฒญ ์ฌ์ด์์ fairness๋ฅผ ์ด๋ป๊ฒ ์ ์งํ๋์ง๊ฐ ์ ์ฒด ์ฒด๊ฐ ์ฑ๋ฅ์ ์ข์ฐํฉ๋๋ค.
1. ์ ์ ์ ๋ฐฐ์น๋ก๋ ๋์ฝ๋ฉ GPU๋ฅผ ์ถฉ๋ถํ ์ฑ์ฐ์ง ๋ชปํ๋๊ฐ
๋์ฝ๋ฉ์ ์ํ์ค๋ง๋ค ๋งค ์คํ ํ ํ ํฐ์ฉ๋ง ์ ์งํ๋ฏ๋ก, ์ด๋ค ์์ฒญ์ ๋นจ๋ฆฌ ๋๋๊ณ ์ด๋ค ์์ฒญ์ ์ค๋ ๋จ์ต๋๋ค. ์ ์ ๋ฐฐ์น๋ ํ ๋ฒ ๋ฐฐ์น๋ฅผ ๋ฌถ์ ๋ค ๋๋ ๋๊น์ง ์ ์งํ๋ฏ๋ก, ์งง์ ์์ฒญ์ด ๋จผ์ ๋๋ ์๋ฆฌ๋ ๋ฐฐ์น ์ข ๋ฃ ์ ๊น์ง ๋น์ด ์๊ฒ ๋ฉ๋๋ค.
์ด ๋น ์ฌ๋กฏ์ ๊ณง GPU ๋ฉ๋ชจ๋ฆฌ ๋์ญํญ์ ๋ญ๋น์ ๋๋ค. ํนํ ์จ๋ผ์ธ ์๋น์ฒ๋ผ ์์ฒญ ๊ธธ์ด๊ฐ ํฌ๊ฒ ๋ค๋ฅผ ๋๋ ๋ฐฐ์น ๋ด๋ถ์ tail request ํ๋๊ฐ ์ ์ฒด ๋ฐฐ์น๋ฅผ ์ค๋ ๋ถ์ก์ GPU utilization์ ๋จ์ด๋จ๋ฆฝ๋๋ค.
๊ทธ๋ฆผ 1. ์ ์ ๋ฐฐ์น์ ์ฐ์ ๋ฐฐ์น์ ์ฌ๋กฏ ์ฌํ์ฉ ์ฐจ์ด
Decode๋ ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ด๋
๋์ฝ๋ฉ ๋จ๊ณ๋ ์ด๋ฏธ ๊ณ์ฐ๋ KV ์บ์๋ฅผ ์ฝ์ด ๋ค์ ํ ํฐ ํ๋๋ฅผ ์์ฑํ๋ฏ๋ก, FLOP๋ณด๋ค ๋ฉ๋ชจ๋ฆฌ ์ด๋์ด ๋ณ๋ชฉ์ด ๋ฉ๋๋ค. ๋ฐ๋ผ์ ๊ฐ์ ์๊ฐ์ ๋ ๋ง์ ์ํ์ค๋ฅผ active set์ ๋ด์๋๋ ๊ฒ์ด ์ฒ๋ฆฌ๋๊ณผ ๊ฑฐ์ ์ง๊ฒฐ๋ฉ๋๋ค.
2. ํต์ฌ ๊ฐ๋
- ์์ฒญ(request) / ์ํ์ค(sequence): ์๋ฒ ์ ์ฅ์์๋ ํ ํด๋ผ์ด์ธํธ ์์ฒญ์ด ํ๋์ ์ํ์ค์ ๋๋ค.
- ready queue: ์์ง ์คํ๋์ง ์์๊ฑฐ๋ ๋ค์ ๊ธฐํ๋ฅผ ๊ธฐ๋ค๋ฆฌ๋ ์์ฒญ ์งํฉ์ ๋๋ค.
- active set: ํ์ฌ decode step์ ์ฐธ์ฌ ์ค์ธ ์์ฒญ ์งํฉ์ ๋๋ค.
- slot refill: ์๋ฃ๋ ์์ฒญ์ด ๋น ์ง ์๋ฆฌ๋ก ์ ์์ฒญ์ ์ฆ์ ์ฑ์ ๋ฃ๋ ๋์์ ๋๋ค.
- token budget: ํ ๋ฒ์ iteration์ ๋ฃ์ ์ ์๋ ํ ํฐ ์ ์ ํ์
๋๋ค(
max_num_batched_tokens,max_num_tokens). - KV budget: ์ ์์ฒญ์ ๋ฐ์๋ค์ผ ์ ์๋ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ ์ ๋๋ค. ๊ฒฐ๊ตญ admission์ compute๋ณด๋ค memory ๋ฌธ์ ์ ๊ฐ๊น์ต๋๋ค.
- fairness: ์งง์ ์์ฒญ์ ๊ณ์ ์ฐ๋ํ๋ฉด ๊ธด ์์ฒญ์ด ๋ฐ๋ฆฌ๊ณ , ํฐ ์์ฒญ์ ์ ์งํ๋ฉด ์งง์ ์์ฒญ์ TTFT๊ฐ ๋๋น ์ง๋๋ค.
3. Continuous Batching์ ํต์ฌ ๋ฃจํ
์ฐ์ ๋ฐฐ์น๋ ๊ฐ decode step ์ดํ finished request๋ฅผ ์ ๊ฑฐํ๊ณ , ๋น์ด ์๋ slot ์๋งํผ ready queue์์ ์ ์์ฒญ์ ๋์ด์ active set์ ๋ณด์ถฉํฉ๋๋ค. ์ฆ ๋ฐฐ์น๊ฐ '์ธ์ ๋จ์'๊ฐ ์๋๋ผ 'ํ ํฐ ์คํ ๋จ์'๋ก ์ฌ๊ตฌ์ฑ๋ฉ๋๋ค.
์ด๋ ์ค์ผ์ค๋ฌ๋ ์ด๋ค ์์ฒญ์ ๋จ๊ธฐ๊ณ ์ด๋ค ์์ฒญ์ ๋ค์ผ์ง, prefill์ ์ง๊ธ ์ํํ ์ง ๋ค์ ํด์ผ๋ก ๋ฏธ๋ฃฐ์ง, active sequence budget๊ณผ KV cache budget์ ์ด๋ป๊ฒ ๋๋์ง๋ฅผ ๋งค๋ฒ ํ๋จํด์ผ ํฉ๋๋ค.
- ํ์ฌ iteration์ decode๋ฅผ ์คํํฉ๋๋ค.
- ์๋ฃ๋ ์์ฒญ์ ์ฆ์ ์ ๊ฑฐํฉ๋๋ค.
- ๋จ์ budget์ ๊ณ์ฐํด ready queue์์ ์ ์์ฒญ์ ๋ฝ์ต๋๋ค.
- prefill์ ํ์ํ๋ฉด chunk๋ก ๋๋ decode ์ฌ์ด์ ๋ผ์ ๋ฃ์ต๋๋ค.
- ๋ค์ iteration์์ ๋ค์ ๊ฐ์ ๊ณผ์ ์ ๋ฐ๋ณตํฉ๋๋ค.
๊ทธ๋ฆผ 2. ready queue -> active set -> finished slot refill๋ก ์ด์ด์ง๋ ์ค์ผ์ค๋ฌ ๋ฃจํ
Queue์ Active Set
ํต์ฌ ์ํ๋ ready queue, active decode set, ๊ทธ๋ฆฌ๊ณ free slot/KV block pool์ ๋๋ค. ์์ฒญ admission์ ๊ฒฐ๊ตญ 'compute slot'์ด ์๋๋ผ 'KV cache๋ฅผ ๊ฐ๋นํ ์ ์๋๊ฐ'์ ๋ฌธ์ ์ ๊ฒฐํฉ๋๋ฏ๋ก, ๋ฐฐ์น ์ค์ผ์ค๋ฌ๋ ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ์์ ๋ถ๋ฆฌ๋ ์ ์์ต๋๋ค.
4. Prefill๊ณผ Decode๋ฅผ ์์ ๋์ ๋ฌธ์
๊ธด ํ๋กฌํํธ์ prefill์ ์ฐ์ฐ์ง์ฝ์ ์ด๊ณ , decode๋ ๋ฉ๋ชจ๋ฆฌ์ง์ฝ์ ์ ๋๋ค. ๋์ ๊ฐ์ ๋ฐฐ์น ์์ ์์ผ๋ฉด TTFT๋ ์ข์์ง ์ ์์ง๋ง, ํฐ prefill์ด ๋์ฝ๋ฉ์ inter-token latency๋ฅผ ํ๋ค ์ ์์ต๋๋ค.
๊ทธ๋์ ์ต์ ์์ง๋ค์ ๊ธด prefill์ ์ฌ๋ฌ chunk๋ก ๋๋์ด decode step ์ฌ์ด์ ๋ผ์ ๋ฃ๋ chunked prefill์ ์ฌ์ฉํฉ๋๋ค. ์ด๋ throughput๋ง ๊ทน๋ํํ๋ ๋์ latency๋ ํจ๊ป ์ ์ดํ๋ ค๋ ํํ์ ๋๋ค.
Chunked Prefill / Chunked Context
- vLLM์ chunked prefill๋ก ํฐ prefill์ ์ฌ๋ฌ chunk๋ก ๋๋ decode์ ๊ฐ์ batch์ ๋ฃ์ต๋๋ค.
- TensorRT-LLM์ chunked context๋ฅผ ํตํด context phase๋ฅผ ์ฌ๋ฌ iteration์ผ๋ก ๋๋๊ณ generation phase์ ํจ๊ป ์ฒ๋ฆฌํฉ๋๋ค.
- ๋ ๋ฐฉ์ ๋ชจ๋ ๊ธด ํ๋กฌํํธ๊ฐ ์ ์ฒด ๋ฐฐ์น๋ฅผ ์ค๋ ์ ์ ํ๋ ๋ฌธ์ ๋ฅผ ์ค์ด๊ณ , mixed workload์์ ITL์ ์์ ํํฉ๋๋ค.
๊ทธ๋ฆผ 3. giant prefill๊ณผ chunked prefill์ ์ฐจ์ด
5. ๋น๊ต/๋ถ์
Continuous batching์ ์ผ๋ฐ์ ์ผ๋ก throughput(tokens/s)๊ณผ GPU utilization์ ํฌ๊ฒ ์ฌ๋ฆฌ์ง๋ง, ๊ทธ ๋๊ฐ๋ก ์ค์ผ์ค๋ง ๋ณต์ก๋์ fairness ๋ฌธ์ ๊ฐ ์๊น๋๋ค. ์งง์ ์์ฒญ์ ๋๋ฌด ์์ฃผ ์ฐ๋ํ๋ฉด ๊ธด ์์ฒญ์ด ๊ตถ๊ณ , ๋ฐ๋๋ก ํฐ ๋ฐฐ์น๋ฅผ ์ ์งํ๋ ค๊ณ ๊ธฐ๋ค๋ฆฌ๋ฉด TTFT๊ฐ ๋๋น ์ง๋๋ค.
์ฆ continuous batching์ ๋จ์ํ batching trick์ด ์๋๋ผ, throughputยทTTFTยทITLยทtail latency ์ฌ์ด์ multi-objective control ๋ฌธ์ ์ ๋๋ค. admission control, chunked prefill, prefix caching ๊ฐ์ ๋ณด์ ๊ธฐ๋ฒ์ด ํจ๊ป ํ์ํ ์ด์ ๊ฐ ์ฌ๊ธฐ์ ์์ต๋๋ค.
| ๋ฐฉ์ | ์ค์ผ์ค๋ง ๋จ์ | TTFT | ITL / ์ฒ๋ฆฌ๋ | ํน์ง |
|---|---|---|---|---|
| Static batching | request ๋จ์ | ๋๊ธฐ ์๊ฐ์ด ๊ธธ์ด์ง๊ธฐ ์ฝ๋ค | ์ฌ๋กฏ ๋ญ๋น๊ฐ ์ปค์ ๋ถ๋ฆฌํ๋ค | ๊ตฌํ์ ๋จ์ํ์ง๋ง tail request์ ์ทจ์ฝํ๋ค |
| Continuous batching | token iteration ๋จ์ | ์ ์์ฒญ์ ๋นจ๋ฆฌ ๋ฐ์๋ค์ด๊ธฐ ์ฝ๋ค | GPU ํ์ฉ๋๊ฐ ๋๋ค | ์๋ฃ ์์ฒญ์ ์ฌ๋กฏ์ ์ฆ์ ์ฌํ์ฉํ๋ค |
| Continuous batching + chunked prefill | token iteration + chunk | ๊ธด ํ๋กฌํํธ์์ ๋ ์์ ์ ์ด๋ค | mixed workload์ ์ ๋ฆฌํ๋ค | prefill/decode ์ถฉ๋์ ์ค์ธ๋ค |
| ์์ง/๋ ผ๋ฌธ | ๋ฐฐ์น ์ด์ ๊ด์ | ๋ฉ๋ชจ๋ฆฌ ์ด์ ๊ด์ | ์ค๋ฌด์ ํฌ์ธํธ |
|---|---|---|---|
| ORCA | iteration-level scheduling, selective batching | ์์ฒญ๋ณ ์ํ๋ฅผ ์ธ๋ฐํ๊ฒ ์ถ์ | ์จ๋ผ์ธ ์๋น์์ ์ ์ ๋ฐฐ์น์ ๋นํจ์จ์ ๋จผ์ ๊ตฌ์กฐ์ ์ผ๋ก ์ง์ ํ๋ค |
| vLLM | continuous batching, chunked prefill | PagedAttention ๊ธฐ๋ฐ KV block ๊ด๋ฆฌ | ๋์ ์ฒ๋ฆฌ๋์ ์ ์งํ๋ฉด์๋ ์์ฒญ ๊ธธ์ด ํธ์ฐจ๋ฅผ ๊ฒฌ๋๊ธฐ ์ฝ๋ค |
| TensorRT-LLM | in-flight batching, chunked context | ์คํ๊ธฐ์ ์ค์ผ์ค๋ฌ๋ฅผ ํตํฉํด ์ ํํ | ์ด์ ํ๋ผ๋ฏธํฐ(max_batch_size, max_num_tokens) ์กฐ์ ์ด ์ค์ํ๋ค |
๊ทธ๋ฆผ 4. throughput ๊ฐ์ ๊ณผ latency/fairness trade-off
6. ์ฅ๋จ์
| ์ฅ์ | ๋จ์ |
|---|---|
| ๋น ์ฌ๋กฏ์ ์ฆ์ ์ฌ์ฌ์ฉํด GPU utilization์ ๋์ธ๋ค | ์ค์ผ์ค๋ฌ ์ํ๊ฐ ๋ณต์กํด์ง๋ค |
| ์งง์ ์์ฒญ์ ๋๊ธฐ ์๊ฐ์ ์ค์ด๊ธฐ ์ฝ๋ค | ๊ธด ์์ฒญ๊ณผ ์งง์ ์์ฒญ ์ฌ์ด์ fairness๋ฅผ ์กฐ์ ํด์ผ ํ๋ค |
| PagedAttention๊ณผ ๊ฒฐํฉํ๋ฉด KV cache ๋จํธํ๋ฅผ ์ค์ด๊ธฐ ์ข๋ค | prefill์ด ๊ธธ๋ฉด decode ์ง์ฐ์ด ํ๋ค๋ฆด ์ ์๋ค |
| chunked prefill๊ณผ ํจ๊ป ์ฐ๋ฉด mixed workload์ ๊ฐํ๋ค | admission control๊ณผ memory budget ๊ด๋ฆฌ๊ฐ ํ์๋ค |
7. PagedAttention๊ณผ์ ๊ฒฐํฉ
์ฐ์ ๋ฐฐ์น๊ฐ ์ ๋์ํ๋ ค๋ฉด request slot๋ง์ด ์๋๋ผ KV cache๋ ์ธ๋ฐํ๊ฒ ์ฌํ์ฉ๋์ด์ผ ํฉ๋๋ค. ๊ทธ๋ ์ง ์์ผ๋ฉด ์งง์ ์์ฒญ์ด ๋น ์ ธ๋ ๊ทธ ์๋ฆฌ์ ๋จ์ ์ฐ์ ๋ฉ๋ชจ๋ฆฌ ์กฐ๊ฐ์ ์ ์์ฒญ์ด ๋ฐ๋ก ์ธ ์ ์์ด ์ธ๋ถ ๋จํธํ๊ฐ ์๊น๋๋ค.
PagedAttention์ KV๋ฅผ ๊ณ ์ ํฌ๊ธฐ block์ผ๋ก ์ชผ๊ฐ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ , continuous batching์ ๊ทธ block pool์ ๋์ ํ์ ์จ๋ก ์ฌ์ฉํฉ๋๋ค. ์ค๋๋ LLM ์๋น ์์ง์์ ๋ ๊ธฐ๋ฒ์ด ๊ฑฐ์ ํญ์ ํจ๊ป ์ธ๊ธ๋๋ ์ด์ ์ ๋๋ค.
๊ทธ๋ฆผ 5. ์ฐ์ ๋ฐฐ์น ์ค์ผ์ค๋ฌ์ KV ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ์์ ๊ฒฐํฉ
์ด ๊ฒฐํฉ ๊ตฌ์กฐ๋ ์คํ๋ก๋ฉ์ด๋ prefix caching ๊ฐ์ ์์ ๊ธฐ๋ฅ์๋ ๊ทธ๋๋ก ์ด์ด์ง๋๋ค. ์ฆ continuous batching์ ๋จ๋ ๊ธฐ๋ฒ์ด๋ผ๊ธฐ๋ณด๋ค, KV block allocator์ admission policy ์์์ ์๋ํ๋ ์ด์ ๊ณ์ธต์ผ๋ก ๋ณด๋ ํธ์ด ์ ํํฉ๋๋ค.
8. ๊ด๋ จ ๊ธฐ์
| ์๋ฃ | ํต์ฌ |
|---|---|
| PagedAttention Analysis | KV block ์ฌ์ฌ์ฉ๊ณผ ๋จํธํ ์ํ์ ๊ธฐ๋ฐ |
| KV Cache Offloading Analysis | KV budget ํ์ฅ๊ณผ admission control์ ๋ณด์ ์ถ |
| Prefix Caching Analysis | prefill ์ค๋ณต์ ์ค์ฌ continuous batching๊ณผ ๊ฒฐํฉํ๊ธฐ ์ข๋ค |
| Speculative Decoding Analysis | decode ๋จ๊ณ์ ํ ํฐ ์ ์ง์ ๊ฐ์ํ๋ ๋ณด์ ๊ธฐ๋ฒ |
| LLM Inference Scheduler Analysis | queue, backpressure, admission์ ํจ๊ป ๋ณด๋ ์์ ๊ด์ |
Orca: A Distributed Serving System for Transformer-Based Generative Models |
iteration-level scheduling, selective batching, 36.9x throughput improvement |
vLLM Optimization and Tuning |
chunked prefill, preemption, max_num_batched_tokens ์กฐ์ |
TensorRT-LLM: Paged Attention, IFB, and Request Scheduling |
in-flight batching, chunked context, max_batch_size, max_num_tokens |
Efficient Memory Management for Large Language Model Serving with PagedAttention |
KV cache fragmentation ์ํ์ throughput ํฅ์ |
๊ทธ๋ฆผ 6. KV block ์ถ์ํ๊ฐ ์คํ๋ก๋ฉ๊ณผ ๋ฉ๋ชจ๋ฆฌ ํฐ์ด๋ง์ผ๋ก ํ์ฅ๋๋ ๋ฐฉ์
๊ทธ๋ฆผ 7. ์ค์ ์๋น ์คํ์์ ์ฐ์ ๋ฐฐ์น ์ค์ผ์ค๋ฌ๊ฐ ์ฐจ์งํ๋ ์์น
9. ํต์ฌ ์ ๋ฆฌ
Continuous batching์ ๋ณธ์ง์ '๋ฐฐ์น๋ฅผ ์ค๋ ์ ์งํ๋ ๊ฒ'์ด ์๋๋ผ '๋น ์๋ฆฌ๋ฅผ ํ ํฐ ๋จ์๋ก ์ฆ์ ๋ค์ ์ฐ๋ ๊ฒ'์ ๋๋ค. ๋์ฝ๋ฉ์ด ๋ฉ๋ชจ๋ฆฌ ๋ฐ์ด๋๋ผ๋ ์ฌ์ค ๋๋ฌธ์ ์ด ์ ์ฑ ์ ์ฒ๋ฆฌ๋์ ๋งค์ฐ ํฐ ์ํฅ์ ์ค๋๋ค.
๋ค๋ง ์ค์ ์์คํ ์์๋ prefill ๊ฐ์ญ, fairness, active KV budget, prefix sharing๊น์ง ํจ๊ป ๋ค๋ค์ผ ํ๋ฏ๋ก, continuous batching์ ์ค์ผ์ค๋ฌ ํ ์ค์ง๋ฆฌ ์ต์ ํ๊ฐ ์๋๋ผ ์๋น ์์ง์ ์ด์ ์ฒ ํ์ ๊ฐ๊น์ต๋๋ค. ORCA์ iteration-level scheduling, vLLM์ chunked prefill, TensorRT-LLM์ in-flight batching์ ๊ฐ์ ๋ฌธ์ ๋ฅผ ์๋ก ๋ค๋ฅธ ์์ง์์ ํ์ด๋ธ ์ฌ๋ก์ ๋๋ค.
๊ทธ๋ฆผ 8. ์ ์ ๋ฐฐ์น๊ฐ tail request ๋๋ฌธ์ GPU๋ฅผ ๋๋ฆฌ๋ ์ด์
๊ทธ๋ฆผ 9. ๋งค iteration๋ง๋ค ready queue์ active set์ ์ฌ๊ตฌ์ฑํ๋ ์ค์ผ์ค๋ฌ ๋ฃจํ
๊ทธ๋ฆผ 10. giant prefill๊ณผ chunked prefill์ latency ์ฐจ์ด
๊ทธ๋ฆผ 11. ์ฐ์ ๋ฐฐ์น๊ฐ ๊ฐ์ ํ๋ ์งํ์ ์๋ก ์๊ธฐ๋ ์ด์ ๋น์ฉ
ํต์ฌ์ throughput ํ๋๋ง ์ฌ๋ฆฌ๋ ๊ฒ์ด ์๋๋ผ, decode ์ค์ฌ ์ํฌ๋ก๋์์ ์ฌ๋กฏ ํ์ ์จ๊ณผ ๋ฉ๋ชจ๋ฆฌ ํ์ ์จ์ ๋์์ ๋์ด์ฌ๋ฆฌ๋ ๊ฒ์ ๋๋ค. ๊ทธ๋์ continuous batching์ ํ๊ฐํ ๋๋ tokens/s๋ง์ด ์๋๋ผ TTFT, ITL, tail latency, KV ์ฌ์ฉ๋ฅ ์ ํจ๊ป ๋ด์ผ ํฉ๋๋ค.