计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
tensorrt-optimization【效率与协作】Authoritative guide to inference optimization using TensorRT, focusing on quantization, layer fusion, and memory bandwidth optimization for LLMs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
TensorRT (TRT) transforms neural networks into hyper-optimized, platform-specific engines. The objective is to maximize throughput and minimize latency through aggressive graph-level transformations and reduced precision numerics. The AI agent must approach TRT not as a library, but as an adversarial compiler that strips away abstraction overheads.
TRT intrinsically merges sequential operations (e.g., Conv+Bias+ReLU or MatMul+Add+GeLU) into monolithic kernels. The agent must architect networks that exploit known fusion patterns. Avoid idiosyncratic topologies that fragment the execution graph, causing excessive kernel launch overhead and intermediate VRAM materialization.
Deploying FP32 is computationally negligent.
Large Language Models are uniformly memory-bandwidth bound during generation. Optimization mandates maximizing KV cache locality and utilizing Inflight Batching (Continuous Batching) to saturate SMs while amortizing memory fetches across request queues. PagedAttention paradigms should be coupled with TRT-LLM to eliminate memory fragmentation.
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
flowchart TD
A[Network Definition / ONNX] --> B[Graph Optimization]
B --> C[Layer & Tensor Fusion]
C --> D[Precision Calibration]
subgraph PrecisionManagement
D --> E[FP16/FP8 Selection]
D --> F[INT8 Calibration]
end
E --> G[Engine Compilation]
F --> G
G --> H[Execution Engine Serialization]
H --> I[Inference Deployment & Batching]