Skip to content

Commit 853b8a7

Browse files
eliteproxvictorges
andauthored
streamdiffusion: Upgrade to tensorrt 10.12 and cuda 10.6 (#646)
* Fix params for streamdfiffusion models * update streamdiffusion version and move install order * Update to latest commit on ryan/feat/cnet-spike-trt * Fix tensorrt==10.9 installation * Upgrade to CUDA 12.6 and tensorrt 10.12 * Update streamdiffusion version Also use a tag 😎 --------- Co-authored-by: Victor Elias <[email protected]>
1 parent 407aed4 commit 853b8a7

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

runner/app/live/StreamDiffusionWrapper/wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def create_prefix(
579579
unet_model = UNet(
580580
fp16=True,
581581
device=str(stream.device),
582-
max_batch_size=stream.trt_unet_batch_size,
582+
max_batch=stream.trt_unet_batch_size,
583583
min_batch_size=stream.trt_unet_batch_size,
584584
embedding_dim=stream.text_encoder.config.hidden_size,
585585
unet_dim=stream.unet.config.in_channels,
@@ -602,7 +602,7 @@ def create_prefix(
602602
stream.vae.forward = stream.vae.decode
603603
vae_decoder_model = VAE(
604604
device=str(stream.device),
605-
max_batch_size=self.batch_size
605+
max_batch=self.batch_size
606606
if self.mode == "txt2img"
607607
else stream.frame_bff_size,
608608
min_batch_size=self.batch_size
@@ -630,7 +630,7 @@ def create_prefix(
630630
vae_encoder = TorchVAEEncoder(stream.vae).to(torch.device("cuda"))
631631
vae_encoder_model = VAEEncoder(
632632
device=str(stream.device),
633-
max_batch_size=self.batch_size
633+
max_batch=self.batch_size
634634
if self.mode == "txt2img"
635635
else stream.frame_bff_size,
636636
min_batch_size=self.batch_size

runner/docker/Dockerfile.live-base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Based on https://github.com/huggingface/api-inference-community/blob/main/docker_images/diffusers/Dockerfile
2-
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
2+
FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04
33

44
ENV DEBIAN_FRONTEND=noninteractive
55
ENV NVIDIA_VISIBLE_DEVICES=all

runner/docker/Dockerfile.live-base-streamdiffusion

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG BASE_IMAGE=livepeer/ai-runner:live-base
22
FROM ${BASE_IMAGE}
33

44
# Install Miniconda and create the 'comfystream' environment
5-
ARG PYTHON_VERSION=3.10
5+
ARG PYTHON_VERSION=3.11
66
ENV CONDA_DIR /workspace/miniconda3
77
ENV PATH $CONDA_DIR/bin:$PATH
88

@@ -23,19 +23,27 @@ ENV PIP_PREFER_BINARY=1
2323

2424
# Install StreamDiffusion dependencies into the comfystream environment
2525
RUN conda run -n comfystream pip install --no-cache-dir \
26-
torch==2.1.0 \
27-
torchvision==0.16.0 \
28-
xformers===0.0.22.post7 \
29-
--index-url https://download.pytorch.org/whl/cu121
30-
31-
# Install StreamDiffusion @ b623251 (latest at time of writing) into the comfystream environment
32-
RUN conda run -n comfystream pip install git+https://github.com/cumulo-autumn/StreamDiffusion.git@b623251#egg=streamdiffusion[tensorrt]
33-
34-
# Install TensorRT extension and ensure compatible dependencies into the comfystream environment
35-
RUN conda run -n comfystream pip install --no-cache-dir --force-reinstall \
36-
huggingface-hub==0.25.2 \
37-
transformers==4.38.2
38-
RUN conda run -n comfystream python -m streamdiffusion.tools.install-tensorrt
26+
torch==2.7.0 \
27+
torchvision==0.22.0 \
28+
torchaudio==2.7.0 \
29+
xformers===0.0.30 \
30+
--index-url https://download.pytorch.org/whl/cu126
31+
32+
# Install StreamDiffusion @ v0.0.1-cnet (latest with controlnet support) into the comfystream environment
33+
RUN conda run -n comfystream pip install git+https://github.com/livepeer/[email protected]#egg=streamdiffusion[tensorrt]
34+
35+
# Pin versions of ONNX runtime which are too loose on streamdiffusion setup.py
36+
RUN conda run -n comfystream pip install --no-cache-dir \
37+
onnx==1.18.0 onnxruntime==1.22.0 onnxruntime-gpu==1.22.0
38+
39+
# Install TensorRT bindings and libraries into the comfystream environment
40+
# TODO: update install-tensorrt script in streamdiffusion and use it instead of this
41+
RUN conda run -n comfystream pip install --no-cache-dir --upgrade --root-user-action=ignore \
42+
tensorrt==10.12.0.36 \
43+
tensorrt-cu12-bindings==10.12.0.36 \
44+
tensorrt-cu12-libs==10.12.0.36 \
45+
polygraphy==0.49.24 \
46+
onnx-graphsurgeon==0.5.8
3947

4048
WORKDIR /app
4149

runner/requirements.live-ai.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ nvidia-ml-py==12.560.30
1212
pynvml==12.0.0
1313
opencv-python==4.10.0.84
1414
av==14.4.0
15-
peft==0.11.1
15+
peft==0.15.2

0 commit comments

Comments
 (0)