🌟 Summary (single-line synopsis)
Ultralytics 8.3.253 adds explicit Vulkan GPU device selection for NCNN inference (plus safer PaddlePaddle/NCNN dependency handling) to improve cross-vendor GPU acceleration and reliability ⚡🖥️🛠️
📊 Key Changes
- NCNN + Vulkan device targeting (main feature) ⚡
- You can now pass a device string like
device="vulkan:0"ordevice="vulkan:1"to choose which Vulkan-capable GPU NCNN uses (helpful on AMD/Intel/non-NVIDIA systems and multi-GPU setups). select_device()now accepts"vulkan..."device strings and leaves them unchanged so they flow cleanly into inference setup.- NCNN backend (
ultralytics/nn/autobackend.py) now:- enables Vulkan compute when
devicestarts with"vulkan", - calls
net.set_vulkan_device(<id>), - then sets
device=torch.device("cpu")to keep the rest of the pipeline consistent (NCNN handles the GPU work internally).
- enables Vulkan compute when
- You can now pass a device string like
- Docs update for Vulkan acceleration 📚
- The NCNN integration guide now explicitly documents Vulkan GPU acceleration and shows Python/CLI examples for
device=vulkan:<id>.
- The NCNN integration guide now explicitly documents Vulkan GPU acceleration and shows Python/CLI examples for
- More robust dependency guardrails 🧩
- Excludes PaddlePaddle 3.3.0 (
!=3.3.0) in both export and inference paths due to an upstream breakage 🛑. - ARM64 NCNN installs from Git source instead of PyPI (PyPI packages are currently broken), improving install success on ARM devices (e.g., Raspberry Pi) 🧱.
- Excludes PaddlePaddle 3.3.0 (
🎯 Purpose & Impact
- Better performance options on non-NVIDIA GPUs 🚀
- Vulkan selection unlocks GPU-accelerated NCNN inference on AMD/Intel and other Vulkan-supported hardware—great for desktops and edge devices where CUDA isn’t available.
- Multi-GPU control and predictability 🎛️
- Users with multiple Vulkan devices can reliably choose which GPU runs inference, reducing surprises and improving resource management.
- Smoother installs and fewer “mysterious failures” ✅
- The PaddlePaddle version exclusion and ARM64 NCNN source install reduce breakages caused by known-bad upstream releases.
Example usage (NCNN model with Vulkan):
from ultralytics import YOLO
model = YOLO("yolo11n_ncnn_model")
results = model("image.jpg", device="vulkan:0") # pick Vulkan GPU 0What's Changed
- NCNN source build and Paddle 3.3.0 exclusions by @glenn-jocher in #23173
ultralytics 8.3.253Add support to select Vulkan device when using NCNN by @Faerbit in #23164
New Contributors
Full Changelog: v8.3.252...v8.3.253