Accelerating Vision-Language Models: BridgeTower on Habana Gaudi2
Fine-tuning the 866M-parameter BridgeTower vision-language model with Optimum Habana on Gaudi2 reaches 847.7 samples/s, about 1.4x faster than H100 and 2.45x faster than A100 80GB, mostly because image data loading is the bottleneck. Raising Transformers' dataloader_num_workers from 0 to 1 or 2 gives easy speedups: 1.28x on Gaudi2, 1.79x on H100 and 1.52x on A100. Gaudi2's media pipeline (--mediapipe_dataloader) adds about 1.10x more by sending encoded images to the device for decoding and augmentation. The tradeoff is higher device memory use, and there is no gain if the accelerators are already saturated. Full reproduction commands are provided.
Related posts
- Fast Inference on Large Language Models: BLOOMZ on Habana Gaudi2 Accelerator
Hugging Face mediumAdeptBLOOMZ (176B parameters, 352 GB in 16-bit) runs inference on a single 8-HPU Habana Gaudi2 server using Optimum Habana with Habana's DeepSpeed-inference fork, HPU graphs and a KV cache. In batch-1 greedy generation of 100 tokens, Gaudi2 is 1.42x faster than an 8x A100 80GB setup on the 176B model (3.1 s vs 4.4 s) and 2.89x faster on BLOOMZ-7B. Unlike A100, Gaudi2 benefits from model parallelism on the 7B model. First-gen Gaudi (AWS DL1, about $13/hr) offers better price-performance than A100 for the 7B checkpoint, and the post includes commands to reproduce the benchmark or run generation over any Hugging Face dataset.
- Hugging Face on AMD Instinct MI300 GPU
Hugging Face easyNoviceHugging Face's transformers and text-generation-inference (TGI) now run on AMD Instinct MI300X GPUs with no code changes, backed by a Kubernetes-scheduled CI pipeline that runs tens of thousands of unit tests on MI250 and MI300 hardware. TGI optimizations for MI300 include Flash Attention v2, Paged Attention, GPTQ/AWQ kernels, fused kernels, and PyTorch's ROCm TunableOp. TunableOp tunes GEMMs during server warmup and gives an 8-10% decode latency gain on small inputs. On Llama 3 70B, MI300X on Azure delivers 2-3x faster time to first token and 2x faster decoding than MI250, and roughly 2x faster LoRA fine-tuning. Its 192 GB HBM3 also fits the full ~140 GB fp16 model on a single GPU.
- Text-Generation Pipeline on Intel® Gaudi® 2 AI Accelerator
Hugging Face mediumAdeptOptimum Habana's custom GaudiTextGenerationPipeline runs Llama 2 text generation (7b, 13b, 70b) on Intel Gaudi 2 with a few lines of code, handling pre- and post-processing end to end. Setup covers gated-model access, pinned versions of optimum-habana and Habana's DeepSpeed fork, and CLI runs with HPU graphs, KV cache and sampling parameters. Llama-2-70b uses DeepSpeed across 8 devices. The pipeline can also be embedded in Python scripts or wrapped by LangChain's HuggingFacePipeline, validated only against LangChain 0.0.191.
- Preference Optimization for Vision Language Models
Hugging Face hardMasterTRL now supports direct preference optimization (DPO) for vision language models, trained on chosen/rejected answer pairs rather than fixed labels. A walkthrough fine-tunes Idefics2-8b on the RLAIF-V dataset, formatting image-plus-question prompts with the processor's chat template. Full float32 DPO training would need about 160 GB (policy, reference model, gradients, AdamW states), but bfloat16 plus LoRA cuts trainable parameters to 55M and memory to roughly 32 GB. Batch size 2 with 32 gradient accumulation steps and gradient checkpointing fits activations, and training is judged by rising accuracy and reward margin.
- AMD + 🤗: Large Language Models Out-of-the-Box Acceleration with AMD GPU
Hugging Face easyNoviceHugging Face Transformers now runs all models and tasks on AMD Instinct GPUs with no code changes versus NVIDIA, backed by ROCm support for Flash Attention v2, vLLM Paged Attention, DeepSpeed, GPTQ via AutoGPTQ, ONNX Runtime's ROCMExecutionProvider, and Optimum-Benchmark. Text Generation Inference gains initial MI210/MI250 support through a ROCm Docker image, with GeMM kernel tuning to reach performance parity. Benchmarks show one MI250 (two 64 GB ROCm devices) delivering over 2.33x the decode throughput and half the prefill latency of an A100 at large batch sizes. Its 128 GB memory also fits Llama 70B workloads that run out of memory on two A100-80GBs.