Transformers documentation
TensorRT-LLM
시작하기
기본 클래스
모델
Preprocessors
추론
Pipeline API
Generate API
최적화
모델과 대화하기
서빙
학습
하드웨어
양자화
생태계 통합
리소스
API
You are viewing v5.24.0 version. A newer version v5.24.1 is available.
TensorRT-LLM
TensorRT-LLM은 NVIDIA GPU에서 LLM 추론을 최적화합니다. 모델을 in-flight batching, paged KV caching, tensor parallelism을 지원하는 TensorRT 엔진으로 컴파일합니다. AutoDeploy은 변경 사항 없이 Transformers 모델을 그대로 받아들이며, 모델을 최적화된 런타임으로 자동으로 변환합니다.
Hub에서 모델 ID를 build_and_run_ad.py에 전달하여 Transformers 모델을 실행합니다.
cd examples/auto_deploy
python build_and_run_ad.py --model meta-llama/Llama-3.2-1BUnder the hood, AutoDeploy creates an LLM class. It loads the model configuration with AutoConfig.from_pretrained() and extracts any parallelism metadata stored in tp_plan. AutoModelForCausalLM.from_pretrained() loads the model with the config and enables Transformers’ built-in tensor parallelism.
from tensorrt_llm._torch.auto_deploy import LLM
llm = LLM(model="meta-llama/Llama-3.2-1B")TensorRT-LLM은 torch.export를 사용하여 모델 그래프를 추출하고 최적화를 적용합니다. Transformers의 attention을 TensorRT-LLM attention 커널로 대체하고 모델을 최적화된 실행 백엔드로 컴파일합니다.
리소스
- 자세한 사용 가이드는 TensorRT-LLM 문서를 참고하세요.
- AutoDeploy 가이드에는 고급 예제를 포함하여 작동 원리가 설명되어 있습니다.