mudler commited on
Commit
85b49ee
·
verified ·
1 Parent(s): 7d04c64

add benchmarks + plots to model card

Browse files
Files changed (1) hide show
  1. README.md +39 -10
README.md CHANGED
@@ -23,30 +23,59 @@ inference engine for open-vocabulary detection / visual grounding, no Python at
23
 
24
  **Brought to you by the [LocalAI](https://github.com/mudler/LocalAI) team.**
25
 
26
- The detections are **identical to the official PyTorch implementation** (the engine is
27
- parity-gated against it), and run faster on CPU. See the
28
- [benchmarks](https://github.com/mudler/locate-anything.cpp/blob/master/benchmarks/BENCHMARK.md).
29
 
30
  ## Files
31
 
32
  | File | Bits (LM) | Size | Notes |
33
  | ---- | --------- | ---- | ----- |
34
  | `locate-anything-f16.gguf` | f16 | ~9.2 GB | LM matmuls in f16, everything else f32 |
35
- | `locate-anything-q8_0.gguf` | q8_0 | ~6.3 GB | near-lossless; **box-identical** to f32 |
36
- | `locate-anything-q6_k.gguf` | q6_k | ~5.5 GB | |
37
- | `locate-anything-q5_k.gguf` | q5_k | ~5.1 GB | |
38
  | `locate-anything-q4_k.gguf` | q4_k | ~4.7 GB | smallest; sub-pixel box drift |
39
 
40
  The full-precision `f32` GGUF (~15 GB) is reproducible from the HF weights with
41
  `scripts/convert_locateanything_to_gguf.py` in the repo.
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ## Quantization policy
44
 
45
  Only the Qwen2 language-model matmuls (`attn_{q,k,v,o}`, `ffn_{gate,up,down}`, `lm.output`)
46
  are quantized. The MoonViT vision tower, the projector, all norms and biases, and the two
47
  host-read f32 tensors (`lm.tok_embd`, `vit.pos_emb`) stay **f32** — so the parity-sensitive
48
- vision path is untouched. `q8_0` is byte-identical on box output; lower bit-widths trade a
49
- little box precision for size.
50
 
51
  ## Usage
52
 
@@ -60,8 +89,8 @@ locate-anything-cli detect \
60
  # -> {"detections":[{"label":"person","box":[...]}, ...]} + an annotated PNG
61
  ```
62
 
63
- Decode modes: `--mode hybrid` (default), `slow`, `fast`. Separate categories in the prompt
64
- with `</c>`.
65
 
66
  ## License
67
 
 
23
 
24
  **Brought to you by the [LocalAI](https://github.com/mudler/LocalAI) team.**
25
 
26
+ The detections are the same as the official PyTorch implementation (the engine is
27
+ parity-gated against it), and it runs faster on CPU and GPU.
 
28
 
29
  ## Files
30
 
31
  | File | Bits (LM) | Size | Notes |
32
  | ---- | --------- | ---- | ----- |
33
  | `locate-anything-f16.gguf` | f16 | ~9.2 GB | LM matmuls in f16, everything else f32 |
34
+ | `locate-anything-q8_0.gguf` | q8_0 | ~6.3 GB | near-lossless; **box-identical** to f32 — recommended |
35
+ | `locate-anything-q6_k.gguf` | q6_k | ~5.5 GB | box-identical to f32 |
36
+ | `locate-anything-q5_k.gguf` | q5_k | ~5.1 GB | sub-pixel box drift |
37
  | `locate-anything-q4_k.gguf` | q4_k | ~4.7 GB | smallest; sub-pixel box drift |
38
 
39
  The full-precision `f32` GGUF (~15 GB) is reproducible from the HF weights with
40
  `scripts/convert_locateanything_to_gguf.py` in the repo.
41
 
42
+ ## Performance
43
+
44
+ Same detections as the official model, faster. Full methodology, the warm/median setup,
45
+ parity checks, and more images are in the repo's
46
+ [`benchmarks/BENCHMARK.md`](https://github.com/mudler/locate-anything.cpp/blob/master/benchmarks/BENCHMARK.md).
47
+
48
+ ### Quantization (CPU, Ryzen 9 9950X3D)
49
+
50
+ Slow-mode inference on the 448 fixture; `vs official` divides the official PyTorch **f32**
51
+ time (23.65 s) by each. Only the Qwen2 LM matmuls are quantized, so box parity is preserved
52
+ through q6_k:
53
+
54
+ | dtype | size | infer | vs official f32 | boxes |
55
+ | ----- | ---- | ----- | --------------- | ----- |
56
+ | f16 | 9.15 GB | 13.68 s | 1.7× | identical |
57
+ | q8_0 | 6.26 GB | 6.07 s | **3.9×** | identical |
58
+ | q6_k | 5.51 GB | 5.77 s | **4.1×** | identical |
59
+ | q5_k | 5.10 GB | 5.11 s | **4.6×** | sub-pixel |
60
+ | q4_k | 4.72 GB | 4.29 s | **5.5×** | sub-pixel |
61
+
62
+ ![quantization size vs speedup](quant_tradeoff.png)
63
+
64
+ ### GPU (NVIDIA GB10, vs the official bf16 model)
65
+
66
+ Run against the official model exactly as its model card documents (bf16), greedily, on one
67
+ GB10 GPU. Precision-matched (our **f16** vs its bf16) ours is **~1.7×** faster; the
68
+ recommended **q8_0** build (box-identical) is **~1.9–2.1×**:
69
+
70
+ ![GB10 GPU speedup vs official bf16](gpu_speedup.png)
71
+
72
  ## Quantization policy
73
 
74
  Only the Qwen2 language-model matmuls (`attn_{q,k,v,o}`, `ffn_{gate,up,down}`, `lm.output`)
75
  are quantized. The MoonViT vision tower, the projector, all norms and biases, and the two
76
  host-read f32 tensors (`lm.tok_embd`, `vit.pos_emb`) stay **f32** — so the parity-sensitive
77
+ vision path is untouched. q8_0/q6_k are box-identical; lower bit-widths trade a little box
78
+ precision for size.
79
 
80
  ## Usage
81
 
 
89
  # -> {"detections":[{"label":"person","box":[...]}, ...]} + an annotated PNG
90
  ```
91
 
92
+ Decode modes: `--mode hybrid` (default), `slow`, `fast`. GPU: build with `-DLA_GGML_CUDA=ON`
93
+ and run with `LA_DEVICE=` (auto-GPU). Separate categories in the prompt with `</c>`.
94
 
95
  ## License
96