NVIDIA Triton Inference Server: High-Performance ML Serving
Triton is NVIDIA's production inference server for maximizing GPU throughput. Serve TensorRT, ONNX, PyTorch, and TensorFlow models from a single server with dynamic batching, concurrent execution, and enterprise-grade monitoring.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
JSON Formatter & Validator
Format, beautify, and validate JSON online. Paste your JSON to instantly pretty-print it with 2-space, 4-space, or tab indentation. Minify JSON too. Free, runs in your browser.
Open free tool →
Regex Tester
Free regex tester. Test regular expressions against multiple strings with expected match/no-match assertions — see instant pass/fail results. Built-in presets for email, URL, IPv4, and phone. Pro: unl
Open free tool →
Base64 Encoder & Decoder
Free Base64 Encoder & Decoder. Convert text, images, and any file to Base64 and back. Supports URL-safe Base64, image data URIs, and file download from Base64. Runs 100% in your browser — no data sent
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Best AI Code Review Tools 2026: CodeRabbit, Sourcery, DeepCode & Bito Compared
Compare top AI code review tools for 2026: CodeRabbit, Sourcery, DeepCode, and Bito. Features, pricing, GitHub/GitLab integration, and choosing the right tool for your team.
AI Code Review Tools 2026: GitHub Copilot, CodeRabbit, Qodo Merge Ranked
Compare AI code review tools for 2026: GitHub Copilot code review, CodeRabbit, Qodo Merge, Sourcery, and PR-Agent. Pricing, accuracy, and GitHub integration.
AI Coding Tools Comparison 2026: GitHub Copilot vs Cursor vs Windsurf vs Cline
Comprehensive comparison of the best AI coding tools in 2026: GitHub Copilot, Cursor, Windsurf, and Cline. Pricing, features, model support, and real-world benchmarks.
AI Pair Programming in 2026: GitHub Copilot vs Cursor vs Claude Code
Master AI pair programming in 2026. Compare GitHub Copilot, Cursor, and Claude Code for autocomplete, chat, and agentic workflows. Includes setup guides and productivity tips.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →Model Repository Layout
Triton uses a directory-based model repository. Each model needs a config.pbtxt and versioned model files:
model_repository/
├── bert-onnx/
│ ├── config.pbtxt # Model configuration
│ └── 1/
│ └── model.onnx # Model file (version 1)
├── resnet50-tensorrt/
│ ├── config.pbtxt
│ └── 1/
│ └── model.plan # TensorRT engine
└── gpt2-pytorch/
├── config.pbtxt
└── 1/
└── model.pt # TorchScript model
# config.pbtxt for ONNX model
name: "bert-onnx"
backend: "onnxruntime"
max_batch_size: 64
input [
{
name: "input_ids"
data_type: TYPE_INT64
dims: [ -1 ] # -1 = dynamic sequence length
},
{
name: "attention_mask"
data_type: TYPE_INT64
dims: [ -1 ]
}
]
output [
{
name: "logits"
data_type: TYPE_FP32
dims: [ 2 ]
}
]
dynamic_batching {
preferred_batch_size: [ 16, 32, 64 ]
max_queue_delay_microseconds: 5000
}
instance_group [
{ count: 2 kind: KIND_GPU gpus: [ 0 ] }
] Dynamic Batching & Concurrent Execution
Start Triton and send inference requests via Python client:
# Start Triton (using NVIDIA Docker image)
# docker run --gpus all --rm -p 8000:8000 -p 8001:8001 -p 8002:8002 \
# -v $(pwd)/model_repository:/models \
# nvcr.io/nvidia/tritonserver:24.01-py3 \
# tritonserver --model-repository=/models
import tritonclient.http as httpclient
import numpy as np
# Create client
client = httpclient.InferenceServerClient(url="localhost:8000")
print("Server ready:", client.is_server_ready())
print("Model ready:", client.is_model_ready("bert-onnx"))
# Prepare inputs
input_ids = np.array([[101, 2023, 2003, 1037, 3231, 102]], dtype=np.int64)
attention_mask = np.ones_like(input_ids, dtype=np.int64)
inputs = [
httpclient.InferInput("input_ids", input_ids.shape, "INT64"),
httpclient.InferInput("attention_mask", attention_mask.shape, "INT64"),
]
inputs[0].set_data_from_numpy(input_ids)
inputs[1].set_data_from_numpy(attention_mask)
outputs = [httpclient.InferRequestedOutput("logits")]
# Send request — Triton dynamically batches with other concurrent requests
result = client.infer("bert-onnx", inputs, outputs=outputs)
logits = result.as_numpy("logits")
print(f"Predicted class: {logits.argmax()}") Benchmarking with perf_analyzer
Find the optimal concurrency and batch size before production traffic hits:
# Install perf_analyzer (inside Triton container or via SDK)
# pip install tritonclient[all]
# Sweep concurrency from 1 to 16, measure for 5 seconds each
perf_analyzer \
-m bert-onnx \
-u localhost:8000 \
--concurrency-range 1:16:2 \
--measurement-interval 5000 \
--input-data zero \
--shape input_ids:1,128 \
--shape attention_mask:1,128 \
-f perf_results.csv
# Example output:
# Concurrency: 1, Throughput: 245 infer/sec, p95 latency: 12.3 ms
# Concurrency: 4, Throughput: 820 infer/sec, p95 latency: 14.1 ms
# Concurrency: 8, Throughput: 1240 infer/sec, p95 latency: 19.8 ms
# Concurrency: 16, Throughput: 1380 infer/sec, p95 latency: 35.6 ms
# → Sweet spot: concurrency=8 (1240 infer/sec, p95 < 20ms)
# Build TensorRT engine for 2-5x speedup
trtexec \
--onnx=model.onnx \
--saveEngine=model.plan \
--fp16 \
--minShapes=input_ids:1x64 \
--optShapes=input_ids:16x128 \
--maxShapes=input_ids:64x512 Triton vs TorchServe vs BentoML vs Ray Serve
| Feature | Triton | TorchServe | BentoML | Ray Serve |
|---|---|---|---|---|
| Raw GPU throughput | Best (TensorRT) | Good | Good | Good |
| Framework support | TRT/ONNX/PT/TF/OV | PyTorch only | All (agnostic) | All (agnostic) |
| Dynamic batching | Built-in (server-side) | Partial | Adaptive batching | Manual |
| Concurrent instances | instance_group count | worker threads | Runner replicas | Deployment replicas |
| Kubernetes native | Helm + operator | Manual YAML | Helm chart | KubeRay operator |
| Learning curve | High (protobuf config) | Medium | Low | Medium |
| Best for | Max throughput, NVIDIA | Simple PyTorch | Multi-framework APIs | Distributed + LLM |
Frequently Asked Questions
What is NVIDIA Triton Inference Server?▼
NVIDIA Triton Inference Server is an open-source, production-grade inference serving platform optimized for NVIDIA GPUs. It supports multiple ML frameworks (TensorRT, ONNX Runtime, PyTorch TorchScript, TensorFlow SavedModel, OpenVINO) from a single server. Triton's key strength is maximizing GPU utilization through dynamic batching, concurrent model execution, and TensorRT optimization.
What is TensorRT and how does it work with Triton?▼
TensorRT is NVIDIA's inference optimization library that compiles models into GPU-optimized execution engines. It performs layer fusion, precision calibration (FP32 → FP16 → INT8), and kernel auto-tuning for specific GPU architectures. When you deploy a TensorRT engine via Triton, inference latency drops 2-5x compared to the raw framework. The tradeoff: TensorRT engines are GPU-arch-specific and must be rebuilt for each GPU type.
How does Triton's dynamic batching work?▼
Triton's dynamic batcher collects incoming inference requests over a configurable window (max_queue_delay_microseconds) and forms batches automatically. Unlike static batching where the client sends a pre-formed batch, dynamic batching is transparent to the client — each client sends one sample and Triton decides the batch size at runtime. This is critical for latency-sensitive workloads where clients cannot wait to form batches themselves.
What is concurrent model execution in Triton?▼
Triton can load multiple instances of a model simultaneously on the same GPU (instance_group count). If one model instance is waiting for memory transfers, another instance can be executing computation, keeping the GPU fully utilized. For small models on large GPUs, running 4-8 concurrent instances dramatically improves throughput without increasing per-request latency.
How do I use perf_analyzer to benchmark Triton?▼
perf_analyzer is the official Triton benchmarking tool. Run: perf_analyzer -m model_name -u localhost:8000 --concurrency-range 1:16 --measurement-interval 5000. This sweeps concurrency from 1 to 16 clients, measuring throughput (inferences/sec) and latency (p50/p95/p99) at each level. Use the output to find the concurrency sweet spot before moving to production.
What is the Triton model repository layout?▼
Triton uses a filesystem-based model repository. Each model has a directory with a config.pbtxt (defines input/output tensors, backends, batching settings) and versioned subdirectories (1/, 2/, ...) containing the model files. Triton polls the repository for changes, allowing hot-swapping model versions without restart. The repository can be on local disk, S3, GCS, or Azure Blob.