Views
No views yet

| Accelerator | Baseline (non-optimized) | NVIDIA TensorRT (optimized) | Percentage improvement |
|---|---|---|---|
| A10 | 9399 ms | 8160 ms | ~13% |
| A100 | 3704 ms | 2742 ms | ~26% |
| H100 | 2496 ms | 1471 ms | ~41% |
| Accelerator | Baseline (non-optimized) | NVIDIA TensorRT (optimized) | Percentage improvement |
|---|---|---|---|
| A10 | 0.10 images/sec | 0.12 images/sec | ~20% |
| A100 | 0.27 images/sec | 0.36 images/sec | ~33% |
| H100 | 0.40 images/sec | 0.68 images/sec | ~70% |
| Accelerator | CLIP | Unet | VAE | Total |
|---|---|---|---|---|
| A100 | 1.08 ms | 192.02 ms | 228.34 ms | 426.16 ms |
| H100 | 0.78 ms | 102.8 ms | 126.95 ms | 234.22 ms |
1git clone https://github.com/rajeevsrao/TensorRT.git
2cd TensorRT
3git checkout release/9.2
4docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:23.11-py3 /bin/bash1git lfs install
2git clone https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt
3cd stable-diffusion-xl-1.0-tensorrt
4git lfs pull
5cd ..1cd demo/Diffusion
2python3 -m pip install --upgrade pip
3pip3 install -r requirements.txt
4python3 -m pip install --pre --upgrade --extra-index-url https://pypi.nvidia.com tensorrtengine_xl_base and engine_xl_refiner specific to the accelerator being run on and are reused for later invocations.python3 demo_txt2img_xl.py \
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" \
--build-static-batch \
--use-cuda-graph \
--num-warmup-runs 1 \
--width 1024 \
--height 1024 \
--denoising-steps 30 \
--onnx-base-dir /workspace/stable-diffusion-xl-1.0-tensorrt/sdxl-1.0-base \
--onnx-refiner-dir /workspace/stable-diffusion-xl-1.0-tensorrt/sdxl-1.0-refinerpython3 demo_txt2img_xl.py \
""Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"" \
--version=xl-1.0 \
--onnx-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm \
--engine-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm/engine-sdxl-lcm-nocfg \
--scheduler LCM \
--denoising-steps 4 \
--guidance-scale 0.0 \
--seed 42
python3 demo_txt2img_xl.py \
""Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"" \
--version=xl-1.0 \
--onnx-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcmlora \
--engine-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm/engine-sdxl-lcmlora-nocfg \
--scheduler LCM \
--lora-path latent-consistency/lcm-lora-sdxl \
--lora-scale 1.0 \
--denoising-steps 4 \
--guidance-scale 0.0 \
--seed 42