# Inferencja i infrastruktura

EN: **Inference and ML systems** · id `systems`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › Inferencja i infrastruktura

## Description

- PL: Uruchamianie, przyspieszanie i utrzymywanie modeli.
- EN: Running, accelerating and maintaining models.

## In one sentence

- PL: To sposoby uruchamiania, przyspieszania i utrzymywania modeli na komputerach, serwerach oraz małych urządzeniach.
- EN: These methods run, accelerate and maintain models on computers, servers and small devices.

## Problem it solves

- PL: Model odpowiada zbyt wolno, nie mieści się w pamięci albo trudno go niezawodnie udostępnić wielu osobom.
- EN: A model responds too slowly, does not fit in memory or is hard to serve reliably to many people.

## What it does

- PL: Łączy dobór sprzętu, oszczędny zapis, planowanie zapytań, pomiary i kontrolę wersji, dopasowując działanie do zasobów oraz potrzeb użytkowników.
- EN: It combines hardware choice, compact representations, request scheduling, measurement and version control to match resources and user needs.

## Everyday example

- PL: Uruchamiasz asystenta dla zespołu i sprawdzasz, jak zmieniają się czas odpowiedzi, pamięć oraz koszt przy większym ruchu.
- EN: You launch a team assistant and check how response time, memory and cost change as traffic grows.

## This concerns you if you…

- PL: chcesz uruchomić model na własnym sprzęcie
- PL: odpowiedzi muszą działać szybko i powtarzalnie
- EN: want to run a model on your own hardware
- EN: need fast and reliable responses

## Keywords

vLLM · SGLang · CUDA · Triton · NCCL · PagedAttention · GGUF · GPTQ · AWQ · FSDP · MLflow · ONNX · LiteRT · TTFT · TPOT

## How it works

- PL: Graf modelu mapuje się na operacje sprzętowe, a harmonogram zarządza pamięcią, współbieżnością i komunikacją. Serwowanie oraz potoki utrzymania łączą tę ścieżkę z wersjami danych, pomiarami i kontrolą zasobów w rzeczywistym obciążeniu.
- EN: A model graph is mapped to hardware operations, while scheduling manages memory, concurrency and communication. Serving and maintenance pipelines connect execution to data versions, measurements and resource controls under actual workloads.

## Limits

- PL: Zysk pojedynczego kernela nie gwarantuje poprawy całej usługi. Kolejki, transfery, pamięć i zgodność operatorów mogą dominować; optymalizacja wymaga pomiaru wraz z jakością wyników.
- EN: Faster kernels do not guarantee service-wide improvements. Queues, transfers, memory and operator compatibility can dominate; optimisation requires measurement alongside output quality.

## Key terms

- PL: **kernel**: Funkcja wykonująca określoną operację na akceleratorze.
- PL: **harmonogram wykonania**: Plan kolejności i współbieżności zadań korzystających z ograniczonych zasobów.
- EN: **kernel**: A function performing a specified operation on an accelerator.
- EN: **execution schedule**: A plan ordering and overlapping tasks that share limited resources.

## Know first

- [Algebra liniowa: wektory i macierze (Linear algebra: vectors and matrices)](https://aiatlasgraph.com/t/linearalgebra.md)
- [Workflow i udział człowieka (Workflows and human-in-the-loop)](https://aiatlasgraph.com/t/workflows.md)

## Subtopics (7 direct, 41 in total)

- [AI lokalnie i na urządzeniach (Edge and on-device AI)](https://aiatlasgraph.com/t/edge.md): Running on limited hardware and without a permanent cloud.
  - [Eksport modeli i środowiska uruchomieniowe na urządzeniach (Model export and on-device runtimes)](https://aiatlasgraph.com/t/ondeviceruntimes.md): Moving a trained model from a training framework into a lightweight runtime on a phone, browser or embedded device: exporting or converting it to a supported format and delegating compute to the CPU, GPU or NPU.
  - [Modele językowe na telefonie i laptopie (On-device language models)](https://aiatlasgraph.com/t/ondevicellm.md): Language models optimised to run locally on a phone or laptop, often using an NPU, quantisation and other memory-saving techniques. On-device processing can keep data local and support offline use; hybrid architectures may route selected requests to a cloud model.
  - [TinyML — modele na mikrokontrolerach (TinyML on microcontrollers)](https://aiatlasgraph.com/t/tinyml.md): Running neural networks on microcontrollers with kilobytes of memory and milliwatts of power: co-designing tiny architectures with a lean inference engine, and quantising to 8 bits or fewer.
- [Akceleratory (AI hardware)](https://aiatlasgraph.com/t/hardware.md): Hardware for inference and training.
  - [Model roofline: obliczenia czy przepustowość pamięci (Roofline model and arithmetic intensity)](https://aiatlasgraph.com/t/roofline.md): A simple performance model: attainable throughput is bounded by the minimum of peak compute and memory bandwidth multiplied by arithmetic intensity (operations per byte). Within the model's assumptions, it helps determine whether an operation is compute-bound or memory-bandwidth-bound.
  - [Pamięć HBM i ściana pamięci (High-bandwidth memory and the memory wall)](https://aiatlasgraph.com/t/memorywall.md): Accelerator compute grows faster than memory bandwidth, so moving weights and KV cache from HBM can become a bottleneck. This is especially important during LLM token generation, particularly at small batch sizes.
  - [Połączenia między układami i sieć klastra (Accelerator interconnects and cluster networking)](https://aiatlasgraph.com/t/interconnects.md): Ways accelerators exchange data: fast links within a server or pod (scale-up) and networking between servers (scale-out), using topologies such as torus or fat-tree. Their bandwidth and latency strongly affect how training and inference scale across many chips.
  - [Wyspecjalizowane akceleratory AI (TPU, NPU) (Specialised AI accelerators (ASICs and NPUs))](https://aiatlasgraph.com/t/customaccelerators.md): Specialised chips or compute blocks optimised for neural-network operations, often using multiply-accumulate arrays and low-precision arithmetic. They include datacenter accelerators such as TPUs and NPUs integrated into phones and laptops.
- [GPU i obliczenia rozproszone (GPU and distributed computing)](https://aiatlasgraph.com/t/compute.md): Using accelerators and many devices.
  - [Języki i kompilatory kerneli (Kernel languages and compilers)](https://aiatlasgraph.com/t/kerneldsl.md): Writing kernels one level above raw CUDA: tiles, templates, compilers.
  - [Kernele mnożenia macierzy (GEMM) (Matrix multiplication kernels (GEMM))](https://aiatlasgraph.com/t/gemm.md): The heart of AI compute: squeezing near-peak hardware throughput out of matrix multiplication.
  - [Komunikacja między GPU (Multi-GPU communication)](https://aiatlasgraph.com/t/collectives.md): Moving data between many GPUs: collective operations and topology.
  - [Profilowanie i optymalizacja kerneli (Kernel profiling and optimisation)](https://aiatlasgraph.com/t/profiling.md): Measuring where time goes, and ways to win it back.
  - [Programowanie GPU (CUDA) (GPU programming (CUDA))](https://aiatlasgraph.com/t/gpuprog.md): The GPU execution model: threads, blocks, the memory hierarchy.
  - [Rdzenie tensorowe i niska precyzja (Tensor cores and low precision)](https://aiatlasgraph.com/t/tensorcores.md): Matrix-multiply units and the number formats that feed them.
  - [Strategie zrównoleglania treningu (Training parallelism strategies)](https://aiatlasgraph.com/t/parallelism.md): How to split a model and its data across devices.
- [Kwantyzacja i kompresja (Quantization and compression)](https://aiatlasgraph.com/t/compression.md): Cutting memory and compute cost.
  - [Kwantyzacja samych wag (Weight-only quantization)](https://aiatlasgraph.com/t/weightquant.md): Storing weights in low precision with layer-by-layer calibration to keep quality at 4 bits and below.
  - [Kwantyzacja wag i aktywacji (Weight and activation quantization)](https://aiatlasgraph.com/t/actquant.md): Lowering precision for activations too. Requires taming outlier values that break the scale.
  - [Przycinanie wag i rzadkość (pruning) (Pruning and sparsity)](https://aiatlasgraph.com/t/pruning.md): Setting selected weights to zero to obtain a sparse model; pruning may be unstructured or follow a hardware-friendly pattern such as 2:4. The quality-sparsity trade-off depends on the model, calibration data and method; SparseGPT and Wanda are examples of one-shot LLM pruning without retraining.
- [MLOps i LLMOps (MLOps and LLMOps)](https://aiatlasgraph.com/t/mlops.md): Keeping deployments repeatable and observable.
  - [Automatyczne retrenowanie i CI/CD dla ML (Continuous training and CI/CD for ML)](https://aiatlasgraph.com/t/continuoustraining.md): Automating an ML pipeline: retraining and redeploying a model after a defined trigger such as a schedule, new data, quality degradation or detected drift, while testing and deploying the pipeline itself like code.
  - [Bramka LLM: jedno API do wielu modeli (LLM gateway (AI gateway))](https://aiatlasgraph.com/t/llmgateway.md): An intermediate layer in front of many providers and self-hosted models: one unified API, central keys and access control, rate limits and budgets, fallbacks, load balancing and cost logging.
  - [Magazyn cech (feature store) (Feature store)](https://aiatlasgraph.com/t/featurestore.md): A shared feature platform for training and production: an offline store with feature history for building training sets and an online store serving current features at low latency. Shared definitions and point-in-time joins help limit training-serving skew and leakage from the future.
  - [Rejestr i wersjonowanie modeli (Model registry and versioning)](https://aiatlasgraph.com/t/modelregistry.md): A central registry of model versions with metadata and lineage to experiment runs. Mutable aliases such as champion or production can decouple production-version selection from deployment code and make promotion or rollback easier.
  - [Wersjonowanie i rejestr promptów (Prompt management and versioning)](https://aiatlasgraph.com/t/promptversioning.md): Storing prompts as immutable, numbered versions with metadata and a production alias. Linking versions to traces and evaluations supports comparison; when an application loads prompts dynamically through an alias, rollback is possible without redeploying code.
  - [Śledzenie eksperymentów (parametry, metryki, artefakty) (Experiment tracking)](https://aiatlasgraph.com/t/experimenttracking.md): Logging training runs — hyperparameters, metrics, artefacts, and code and data versions — to support result comparison, lineage and reconstruction of experiment conditions.
- [Serwowanie i dekodowanie (Serving and decoding)](https://aiatlasgraph.com/t/serving.md): Handling requests and generating responses.
  - [Ciągłe batchowanie (Continuous batching)](https://aiatlasgraph.com/t/contbatch.md): Adding requests to a running batch instead of waiting for it to finish.
  - [Dekodowanie spekulatywne (Speculative decoding)](https://aiatlasgraph.com/t/specdec.md): A cheap model guesses several tokens ahead; the big one only verifies them.
  - [Metryki wydajności inferencji LLM (TTFT, TPOT, przepustowość) (Inference performance metrics (TTFT, TPOT, throughput, goodput))](https://aiatlasgraph.com/t/inferencemetrics.md): Core measures of LLM serving speed: time to first token (TTFT), average time for subsequent output tokens (TPOT/ITL), throughput in tokens or requests per second, and goodput — requests served within defined SLOs.
  - [Rozdzielenie fazy prefill i decode (Disaggregated prefill and decode)](https://aiatlasgraph.com/t/disaggregation.md): Running prompt processing (prefill, compute-bound) and token generation (decode, memory-bound) on separate GPU pools, transferring the KV cache between them, so TTFT and per-token latency can be tuned independently.
  - [Serwowanie wielu adapterów LoRA na jednym modelu (Multi-LoRA serving)](https://aiatlasgraph.com/t/multilora.md): One base model in GPU memory serves requests for many fine-tuned variants at once: a LoRA adapter is selected per request, and adapters are loaded and swapped on the fly.
  - [Strategie dekodowania (Decoding strategies)](https://aiatlasgraph.com/t/decoding.md): How the next token is picked from the model's distribution.
  - [Zarządzanie KV cache (KV cache management)](https://aiatlasgraph.com/t/kvcache.md): The attention cache during generation: paging, sharing, compression.
- [Uruchamianie własnych modeli (Self-hosted model inference)](https://aiatlasgraph.com/t/selfhosting.md): Serving a model with your own weights from a local runtime or server.
  - [Autoskalowanie i zimny start wdrożeń (Autoscaling model deployments and cold starts)](https://aiatlasgraph.com/t/autoscaling.md): Matching the number of model replicas to bursty traffic, including scale-to-zero. For GPU deployments, one major challenge is cold start: provisioning a machine, pulling the image and loading model weights.
  - [Lokalne uruchamianie LLM na własnym komputerze (Running LLMs locally on consumer hardware)](https://aiatlasgraph.com/t/localllm.md): Running open models on a laptop or desktop computer. One common path uses quantised GGUF files and selects a quantisation level that fits available memory; a local API server is an optional way to expose the model to applications.
  - [Silniki serwowania modeli językowych (LLM) (LLM inference engines and servers)](https://aiatlasgraph.com/t/inferenceengines.md): Server software for serving LLMs efficiently to many users. Depending on the implementation, it may combine continuous batching, paged KV cache and shared-prefix reuse, and often exposes APIs compatible with popular interfaces plus metrics.
  - [Szacowanie pamięci GPU (wagi i KV cache) (Estimating GPU memory for deployment)](https://aiatlasgraph.com/t/gpumemory.md): Working out how much GPU memory a deployment needs: weights (parameters × bytes per parameter at a given precision) plus a KV cache that grows with context length and concurrent requests, plus headroom for overhead.

## Sources

- [Stanford CS336 · Language Modeling from Scratch (2025)](<https://cs336.stanford.edu/spring2025/>) `cs336` · reference: Budowa modeli, dane, trening, systemy, inferencja i post-training.
- [Full Stack Deep Learning (2022, archiwum)](<https://fullstackdeeplearning.com/course/2022/>) `fsdl` · reference: Pełny cykl systemu ML: dane, testy, wdrażanie, monitoring, zespoły i etyka.
- [FSDL · LLM Bootcamp (2023, archiwum)](<https://fullstackdeeplearning.com/llm-bootcamp/spring-2023/>) `bootcamp` · reference: Aplikacje LLM, prompting, retrieval, UX i LLMOps.

---

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