Table of Contents
🌏 中文版
NVIDIA Triton Inference Server is an open-source model server. It exposes consistent HTTP/REST and gRPC interfaces over TensorRT, ONNX Runtime, PyTorch, Python, and other backends, centralizing model loading, versions, batching, instances, pipelines, and metrics.
Triton's goal is not to maximize tokens per second for one model family. It is a platform for serving image classifiers, embeddings, rankers, speech models, and custom Python processing together. SGLang or vLLM is often more direct for a single LLM. Triton's abstraction pays off when a product has a heterogeneous model pipeline.
The model repository is a deployment contract
Triton loads models from a model repository. Each model gets a directory, numbered subdirectories identify versions, and config.pbtxt declares inputs, outputs, batch size, backend, and scheduling behavior.
models/
└── sentiment/
├── config.pbtxt
└── 1/
└── model.onnx
name: "sentiment"
platform: "onnxruntime_onnx"
max_batch_size: 32
input [{ name: "input_ids" data_type: TYPE_INT64 dims: [128] }]
output [{ name: "logits" data_type: TYPE_FP32 dims: [2] }]
dynamic_batching {
preferred_batch_size: [8, 16]
max_queue_delay_microseconds: 2000
}
This configuration affects compatibility and latency. dims excludes the batch dimension, and client names and dtypes must match. A delivery pipeline should validate metadata and readiness endpoints before sending a fixed set of golden requests.
Dynamic batching trades waiting time for throughput
The dynamic batcher combines compatible requests for one model. Processing several inputs together is often more efficient on a GPU, but the batcher may wait for requests to arrive. Preferred sizes and queue delay therefore trade tail latency for throughput.
Do not start with the largest batch that fits in memory. Hold input shapes and arrival rates constant, test batching off, a short delay, and a longer delay, then compare p95 latency, throughput, and queue time. Offline jobs, interactive APIs, and real-time audio need different policies.
Other schedulers cover models that do not batch normally, while sequence models use correlation IDs and the sequence batcher. Explicit scheduling semantics are one reason to use Triton instead of wrapping a model in Flask.
Instance groups determine resource placement
A model can have several instances on one GPU or instances spread across GPUs and CPUs. More instances may increase concurrency, but duplicated weights consume memory and kernels may compete. Use Model Analyzer or a workload-specific test to find the right count.
Triton's architecture also includes model control, health endpoints, and Prometheus metrics. Observe request success, queue time, compute input, compute infer, compute output, and GPU utilization to separate scheduling, preprocessing, and execution bottlenecks.
Ensembles form an in-server inference DAG
Ensemble models connect preprocessing, inference, and postprocessing while keeping intermediate tensors inside the server. Image resize → classification → label lookup and tokenizer → encoder → ranker are natural examples.
An ensemble is not a general workflow engine. Database transactions, human approval, long-running jobs, complex retries, and compensating actions belong in application code, a task queue, or Ray Serve. Packing all business logic into a Python backend creates a model-serving monolith.
Startup and the security boundary
The official container can mount a repository and start the server:
docker run --gpus all --rm \
-p 8000:8000 -p 8001:8001 -p 8002:8002 \
-v "$PWD/models:/models" \
nvcr.io/nvidia/tritonserver:<release>-py3 \
tritonserver --model-repository=/models
Replace <release> with an image tag your team has validated and pinned. Do not expose inference ports directly to the public internet. TLS, authentication, tenant quotas, and request-size limits normally sit in a reverse proxy or service mesh. Treat the model repository as executable supply-chain material, especially when Python backends are enabled.
Where Triton fits
Triton fits teams that already operate GPU infrastructure, serve several model formats, and want consistent observability and batching controls. It is a poor fit for one low-traffic model, a team without GPU operations capacity, or a workload whose main need is LLM-specific prefix caching and token scheduling.
Before adopting it, put the two most important models in a repository, load-test them with real inputs and SLOs, then restart the server and introduce a bad model version deliberately. A demo proves that a model can run. Safe updates, latency diagnosis, and recovery prove that the platform is operable.
References
Loading...