# DINOv2/CLIP on Ryzen AI MAX+ NPU — BF16 doesn't work, here's what does

**URL:** <https://devcommunity.amd.com/t/dinov2-clip-on-ryzen-ai-max-npu-bf16-doesnt-work-heres-what-does/453>\
**Category:** AMD Ryzen AI\
**Tags:** ryzen-ai\
**Created:** [April 11, 2026, 2:43pm UTC](https://devcommunity.amd.com/t/dinov2-clip-on-ryzen-ai-max-npu-bf16-doesnt-work-heres-what-does/453 "2026-04-11T14:43:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Taylor1](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@John\_Taylor1](https://devcommunity.amd.com/u/John_Taylor1)\
**Post date:** [April 11, 2026, 2:43pm UTC](https://devcommunity.amd.com/t/dinov2-clip-on-ryzen-ai-max-npu-bf16-doesnt-work-heres-what-does/453/1 "2026-04-11T14:43:16Z")

</div>

Been running vision models on my EVO-X2 for a research project and hit the same wall everyone hits. Figured I’d write up what actually fixed it since the docs sent me in the wrong direction for a while.

**Short version: use XINT8, not BF16**

BF16 sounds like the right choice for a transformer model but it silently kills NPU performance. DINOv2 has 2 LayerNorms per block, 12 blocks. In BF16 every single one falls back to CPU. You end up with ~48 CPU/NPU transfers per forward pass and the model is basically running on CPU anyway.

XINT8 keeps LayerNorm on chip. That’s the whole fix.

Before/after on my machine (Ryzen AI MAX+ 395, 128GB, no GPU):

- DINOv2-S: 53ms with BF16 → 0.86ms with XINT8

- V-JEPA 2-L: 1849ms, no XINT8 path yet (the 5D video input breaks things)

- Small custom CNN: 0.34ms NPU

**Also the quantization tool changed**

If you’re still using vai\_q\_onnx it’s deprecated. Quark replaced it:

python

```auto
from quark.onnx import quantize
from quark.onnx.quantization.config import Config, QuantizationConfig

quantize(
    model='dinov2s.onnx',
    output_model_path='dinov2s_xint8.onnx',
    config=Config(global_quant_config=QuantizationConfig(
        quant_format='QDQ',
        quant_mode='XINT8'
    ))
)

```

**One more thing** – check your vaip\_config.json has `target: XDNA2` not `XDNA`. Strix Halo is XDNA2 and it matters.

Put the export/quantize/benchmark scripts on GitHub if anyone wants them: [github.com/taylorjohn/strix-halo-vision-npu](http://github.com/taylorjohn/strix-halo-vision-npu)

Background on why I care: I’m building a navigation world model that runs the full perception stack on this hardware simultaneously. The encoder I trained on it (26K params) beats V-JEPA 2 ViT-G (1B params) on robot navigation benchmarks. Running everything at 1.32ms total. Paper in progress

---

<div class="post-metadata">

**Author:** ![Hakob\_Arzumanyan](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/hakob_arzumanyan/32/214_2.png) [@Hakob\_Arzumanyan](https://devcommunity.amd.com/u/Hakob_Arzumanyan)\
**Post date:** [April 13, 2026, 12:35pm UTC](https://devcommunity.amd.com/t/dinov2-clip-on-ryzen-ai-max-npu-bf16-doesnt-work-heres-what-does/453/2 "2026-04-13T12:35:31Z")

</div>

Hello,

These results show how XINT8 is the best choice for running vision models on the latest Ryzen AI chips. By keeping LayerNorm on the NPU chip, AMD hardware avoids slow data transfers and stays very fast. Great mentioning the Quark tool for quantization and setting the target to XDNA2, which allows the NPU to reach its full speed for research. It is great to see these huge speed improvements. Thanks.
