Instructions to use kittn/eupe_vitb16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kittn/eupe_vitb16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="kittn/eupe_vitb16")# Load model directly from transformers import AutoImageProcessor, AutoModel processor = AutoImageProcessor.from_pretrained("kittn/eupe_vitb16") model = AutoModel.from_pretrained("kittn/eupe_vitb16", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Clarify exact parity under bf16 autocast
Browse files
README.md
CHANGED
|
@@ -60,7 +60,7 @@ If you want to minimize the discrepancy versus the original EUPE inference path,
|
|
| 60 |
|
| 61 |
The stock Hugging Face DINOv3 implementation is internally correct and self-consistent, but it does not match the DINOv3 / EUPE reference implementations bitwise. The mismatch comes from the reference code persisting bf16-rounded RoPE `periods` in the checkpoint and computing angles as `coords / periods`, while Hugging Face reconstructs fp32 `inv_freq` from `rope_theta` and computes `coords * inv_freq`.
|
| 62 |
|
| 63 |
-
If you want bitwise equivalence with the DINOv3 / EUPE references
|
| 64 |
|
| 65 |
```python
|
| 66 |
import math
|
|
@@ -92,5 +92,4 @@ def forward(self, pixel_values):
|
|
| 92 |
|
| 93 |
rope.forward = MethodType(forward, rope)
|
| 94 |
```
|
| 95 |
-
|
| 96 |
-
Under `bf16` autocast, this still helps, but the remaining drift is no longer just RoPE.
|
|
|
|
| 60 |
|
| 61 |
The stock Hugging Face DINOv3 implementation is internally correct and self-consistent, but it does not match the DINOv3 / EUPE reference implementations bitwise. The mismatch comes from the reference code persisting bf16-rounded RoPE `periods` in the checkpoint and computing angles as `coords / periods`, while Hugging Face reconstructs fp32 `inv_freq` from `rope_theta` and computes `coords * inv_freq`.
|
| 62 |
|
| 63 |
+
If you want bitwise equivalence with the DINOv3 / EUPE references, run the following after loading `model` in the example above. It patches the already-loaded Hugging Face model to use the exact bf16-rounded `periods` and the reference RoPE forward:
|
| 64 |
|
| 65 |
```python
|
| 66 |
import math
|
|
|
|
| 92 |
|
| 93 |
rope.forward = MethodType(forward, rope)
|
| 94 |
```
|
| 95 |
+
This restores bitwise equivalence in both pure fp32 and `bf16` autocast.
|
|
|