File size: 1,106 Bytes
bff78c9
b678162
 
bff78c9
b678162
bff78c9
 
4d798a0
b678162
4d798a0
b678162
4d798a0
b678162
 
4d798a0
 
 
 
b678162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: vdpm
app_file: gradio_demo.py
sdk: gradio
sdk_version: 5.17.1
---

## V-DPM Low-VRAM Multi-View Inference

Multi-view modification of V-DPM with low-vram modification to improve inference speed on consumer graphics cards and allow longer sequences to finish. Tested on 3070Ti, H200, PRO 6000,

First, clone the repository and setup a virtual environment with [uv](https://github.com/astral-sh/uv):


Original model's aggregator stores intermediate outputs of all 24 attention blocks, but only 4 of them is used by prediction heads. Made it return only that 4.
del unused intermediate tensors to free memory for subsequent code
@torch.compile some functions (e.g. MLP with GELU, LayerNorm)
torch.cuda.empty_cache() when helpful


```bash
git clone git@github.com:eldar/vdpm.git
cd vdpm
uv venv --python 3.12
. .venv/bin/activate

# Install PyTorch with CUDA 11.8 first
uv pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu118

# Then install remaining dependencies
uv pip install -r requirements.txt
```

## Gradio demo
```bash
python gradio_demo.py
```