Views
No views yet
flash_attention_2 (maximum throughput)sdpa (no flash-attn build needed)| Model | GPU | Attention | VRAM | Speed | Use Case |
|---|---|---|---|---|---|
| Qwen3-VL-2B | RTX 3090/4090 | flash_attention_2 | ~6 GB | ~12 FPS | Real-time on consumer HW |
| Qwen3-VL-2B | MI250X/MI300X | sdpa | ~6 GB | ~8 FPS | ROCm deployment |
| Qwen3-VL-4B | A100/H100 | flash_attention_2 | ~12 GB | ~8 FPS | Production quality |
| Qwen3-VL-4B | MI300X | sdpa | ~12 GB | ~6 FPS | ROCm high quality |
| Component | Original | This Port |
|---|---|---|
| Model | Qwen2.5-VL-7B-Instruct | Qwen3-VL-2B/4B-Instruct |
| Attention | flash_attention_2 (CUDA only) | SDPA + flash_attention_2 (both!) |
| Transformers | 4.50.0–4.52.4 | 4.57.0+ (from source) |
| Vision Attn | flash_attn_varlen_func | chunked SDPA |
| ViT Patch Size | 14×14 | 16×16 |
| RoPE | mrope (standard) | mrope_interleaved |
| DeepStack | ❌ | ✅ (layers 5, 11, 17) |
| Max Context | 128K | 256K |
1conda create -n streaming_qwen3 python=3.11 -y
2conda activate streaming_qwen3
3
4# PyTorch with CUDA
5pip install torch torchvision
6
7# Transformers from source (Qwen3-VL requires 4.57.0+)
8pip install git+https://github.com/huggingface/transformers
9
10# Flash Attention 2 (recommended for CUDA)
11pip install flash-attn --no-build-isolation
12
13# Other deps
14pip install -r requirements.txt1conda create -n streaming_qwen3 python=3.11 -y
2conda activate streaming_qwen3
3
4# PyTorch with ROCm
5pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6.2
6
7# Transformers from source
8pip install git+https://github.com/huggingface/transformers
9
10# No flash-attn needed! SDPA works out of the box.
11pip install -r requirements.txt1python -m streaming_vlm.inference.inference \
2 --model_path Qwen/Qwen3-VL-2B-Instruct \
3 --video_path /path/to/football_match.mp4 \
4 --output_path ./commentary.vtt \
5 --fps 4 \
6 --attn_implementation flash_attention_2 \
7 --window_size 24 \
8 --text_sliding_window 7681python -m streaming_vlm.inference.inference \
2 --model_path Qwen/Qwen3-VL-2B-Instruct \
3 --video_path /path/to/match.mp4 \
4 --interactive \
5 --attn_implementation flash_attention_21from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "s23deepak/streaming-vlm-qwen3-rocm"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)1@misc{xu2025streamingvlmrealtimeunderstandinginfinite,
2 title={StreamingVLM: Real-Time Understanding for Infinite Video Streams},
3 author={Ruyi Xu and Guangxuan Xiao and Yukang Chen and Liuning He and Kelly Peng and Yao Lu and Song Han},
4 year={2025},
5 eprint={2510.09608},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2510.09608},
9}