# Ciągłe batchowanie

EN: **Continuous batching** · id `contbatch`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Inferencja i infrastruktura](https://aiatlasgraph.com/t/systems.md) › [Serwowanie i dekodowanie](https://aiatlasgraph.com/t/serving.md) › Ciągłe batchowanie

## Description

- PL: Dosypywanie zapytań do trwającej partii zamiast czekania na jej koniec.
- EN: Adding requests to a running batch instead of waiting for it to finish.

## In one sentence

- PL: To dołączanie nowych zapytań do wspólnej pracy modelu, gdy inne zapytania już się kończą.
- EN: This adds new requests to a model's shared workload as other requests finish.

## Problem it solves

- PL: Krótkie rozmowy zwalniają miejsce, ale nowe pytania czekają, aż zakończy się najdłuższa odpowiedź w grupie.
- EN: Short conversations free up space, but new questions wait until the group's longest response finishes.

## What it does

- PL: Po kolejnych krokach generowania zakończone zapytania są usuwane, a wolne miejsca zajmują nowe, utrzymując sprzęt przy pracy.
- EN: After generation steps, completed requests leave and new ones take free slots, keeping hardware occupied.

## Everyday example

- PL: Gdy jedna osoba dostanie krótką odpowiedź, serwer od razu dołącza następne pytanie do nadal obsługiwanych rozmów.
- EN: When one person receives a short answer, the server adds another question to the conversations still being processed.

## This concerns you if you…

- PL: obsługujesz zapytania o różnej długości
- PL: chcesz zmniejszyć bezczynność sprzętu
- EN: serve requests of different lengths
- EN: want to reduce hardware idle time

## Keywords

iteration-level scheduling · dynamic batching · token scheduler · chunked prefill · in-flight batching · vLLM

## How it works

- PL: Po każdym kroku harmonogram usuwa zakończone sekwencje i dodaje oczekujące zapytania do aktywnej partii. Wykonanie grupuje aktualne tokeny oraz dostępny prefill, zamiast czekać na zakończenie najdłuższej odpowiedzi przed kolejną partią.
- EN: After each step, scheduling removes completed sequences and adds waiting requests to the active batch. Execution groups current tokens and available prefill instead of awaiting the longest answer before starting another batch.

## Limits

- PL: Pamięć stanu ogranicza liczbę aktywnych sekwencji. Duży prefill może opóźniać trwające generowanie; priorytety i limity muszą równoważyć przepustowość, sprawiedliwość oraz czas odpowiedzi.
- EN: State memory limits active sequence counts. Large prefills can delay ongoing generation; priorities and limits must balance throughput, fairness and response latency.

## Key terms

- PL: **partia dynamiczna**: Grupa sekwencji, której skład może zmieniać się między krokami.
- PL: **planista tokenów**: Mechanizm przydzielający pracę sekwencjom w kolejnych iteracjach.
- EN: **dynamic batch**: A sequence group whose membership can change between steps.
- EN: **token scheduler**: A mechanism allocating work to sequences across successive iterations.

## Know first

- [Architektura zdarzeniowa (Event-driven AI)](https://aiatlasgraph.com/t/eventdriven.md)
- [Profilowanie i optymalizacja kerneli (Kernel profiling and optimisation)](https://aiatlasgraph.com/t/profiling.md)

## Examples

- PL: harmonogram na poziomie iteracji · przepustowość
- EN: iteration-level scheduling · throughput

## Related topics

Untyped, symmetric "see also" links.

- [Silniki serwowania modeli językowych (LLM) (LLM inference engines and servers)](https://aiatlasgraph.com/t/inferenceengines.md)
- [Uruchamianie własnych modeli (Self-hosted model inference)](https://aiatlasgraph.com/t/selfhosting.md)

## Sources

- [Performance Engineering for AI Infra — learning guide](<https://github.com/wafer-ai/gpu-perf-engineering-resources>) `wafer-gpu` · GitHub repository · tiered curriculum (Tier 1–3) · MIT licence · by Wafer (wafer-ai): Company material with a hiring note, but the evidence is mostly primary sources. Table of contents sieved: only topics became nodes; tiers kept as link labels.

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/contbatch · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
