majentik commited on
Commit
1196d7d
Β·
verified Β·
1 Parent(s): 03ea283

Update model card with accurate fork requirements and ecosystem status

Browse files
Files changed (1) hide show
  1. README.md +110 -41
README.md CHANGED
@@ -1,5 +1,7 @@
1
  ---
2
- library_name: gguf
 
 
3
  base_model: nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16
4
  tags:
5
  - gguf
@@ -11,75 +13,142 @@ tags:
11
  - hybrid
12
  - llama-cpp
13
  - quantized
14
- license: other
15
- license_name: nvidia-open-model-license
16
- license_link: https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
17
  ---
18
 
19
  # Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K
20
 
21
- GGUF Q2_K weight-quantized variant of [nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16) with **RotorQuant** KV cache compression for efficient inference with llama.cpp, Ollama, and LM Studio. Features a dense hybrid Mamba-2 + Attention architecture with 4B parameters and up to 262K context length. Maximum compression for memory-constrained environments.
 
 
 
 
22
 
23
  ## Overview
24
 
25
- This model combines two compression techniques:
26
- - **GGUF Q2_K weight quantization** -- reduces model size from ~8 GB to ~1.5 GB
27
- - **RotorQuant KV cache compression** -- block-diagonal rotations (Clifford algebra) for 3-bit KV cache, 5.3x faster prefill
 
 
 
28
 
29
  ## Quickstart
30
 
31
- ### llama.cpp
 
 
 
32
  ```bash
33
- llama-cli -m Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K.gguf \
34
- --cache-type-k planar3 --cache-type-v iso3 \
 
 
 
 
 
 
 
 
 
 
 
 
35
  -p "Explain quantum computing"
 
 
 
 
 
36
  ```
37
 
38
- ### Ollama
 
 
 
 
39
  ```bash
40
- ollama run majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K
 
 
 
41
  ```
42
 
43
- ### LM Studio
44
- Download the GGUF file and load in LM Studio. Enable RotorQuant KV cache in advanced settings.
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  ## Specifications
47
 
48
  | Property | Value |
49
  |----------|-------|
50
- | Base Model | nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16 |
51
- | Parameters | 4B (dense, Mamba-2 + Attention hybrid) |
52
- | Context Length | 262,144 tokens (262K) |
53
- | Weight Quantization | GGUF Q2_K |
54
- | KV Cache | RotorQuant 3-bit (planar/iso) |
55
- | File Size | ~1.5 GB |
56
- | License | NVIDIA Open Model License (commercial use OK) |
57
- | Compatible | llama.cpp, Ollama, LM Studio, koboldcpp |
 
 
 
 
58
 
59
  ## What is RotorQuant?
60
 
61
- RotorQuant applies block-diagonal rotations (Clifford algebra) for KV cache compression. When used with llama.cpp's `--cache-type-k planar3 --cache-type-v iso3` flags:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
- | Metric | RotorQuant | TurboQuant |
64
- |--------|-----------|-----------|
65
- | Prefill Speed | 3,822 tok/s | 722 tok/s |
66
- | Decode Speed | 119 tok/s | 93 tok/s |
67
- | Perplexity | 6.91 | 7.07 |
68
 
69
- ## GGUF Quant Variants
70
 
71
- | Quant | File Size | Quality | Variant |
72
- |-------|-----------|---------|---------|
73
- | **Q2_K** | **~1.5 GB** | **Lowest (max compression)** | **This model** |
74
- | Q3_K_M | ~1.8 GB | Low | [Q3_K_M](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q3_K_M) |
75
- | IQ4_XS | ~2 GB | Medium-Low | [IQ4_XS](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-IQ4_XS) |
76
- | Q4_K_M | ~2.5 GB | Medium | [Q4_K_M](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q4_K_M) |
77
- | Q5_K_M | ~3 GB | Medium-High | [Q5_K_M](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q5_K_M) |
78
- | Q8_0 | ~4.5 GB | High | [Q8_0](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q8_0) |
79
 
80
  ## See Also
81
 
82
- - [nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16) -- Base model
83
- - [majentik/Nemotron-3-Nano-4B-RotorQuant](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant) -- RotorQuant KV-cache (transformers)
84
- - [majentik/Nemotron-3-Nano-4B-RotorQuant-MLX-2bit](https://huggingface.co/majentik/Nemotron-3-Nano-4B-RotorQuant-MLX-2bit) -- MLX 2-bit variant
85
  - [RotorQuant GitHub](https://github.com/scrya-com/rotorquant)
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ license_name: nvidia-open-model-license
4
+ license_link: https://developer.download.nvidia.com/licenses/nvidia-open-model-license-agreement-june-2024.pdf
5
  base_model: nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16
6
  tags:
7
  - gguf
 
13
  - hybrid
14
  - llama-cpp
15
  - quantized
16
+ library_name: gguf
17
+ pipeline_tag: text-generation
 
18
  ---
19
 
20
  # Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K
21
 
22
+ GGUF Q2_K weight-quantized variant of [nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16) optimised for use with **RotorQuant** KV cache compression via a dedicated llama.cpp fork.
23
+
24
+ > **Important:** RotorQuant KV cache types (`planar3`, `iso3`) are **not** available in upstream llama.cpp, standard Ollama, or LM Studio.
25
+ > They require a [specific llama.cpp fork](https://github.com/johndpope/llama-cpp-turboquant/tree/feature/planarquant-kv-cache).
26
+ > The GGUF file itself is a standard GGUF and works with any llama.cpp-compatible runtime using normal KV cache types (f16, q8_0, q4_0, etc.).
27
 
28
  ## Overview
29
 
30
+ This model combines two independent compression techniques:
31
+
32
+ | Technique | What it does | Requirement |
33
+ |-----------|-------------|-------------|
34
+ | **GGUF Q2_K weight quantization** | Reduces model size from ~8 GB (BF16) to ~1.4 GB | Any llama.cpp-compatible runtime |
35
+ | **RotorQuant KV cache compression** β€” block-diagonal Clifford-algebra rotors for 3-bit KV cache (`--cache-type-k iso3 --cache-type-v iso3`) | Block-diagonal rotations / random rotation for compressed KV cache | [llama-cpp-turboquant fork](https://github.com/johndpope/llama-cpp-turboquant/tree/feature/planarquant-kv-cache) only |
36
 
37
  ## Quickstart
38
 
39
+ ### Option A β€” With RotorQuant KV cache (fork required)
40
+
41
+ You must build from the RotorQuant-enabled llama.cpp fork:
42
+
43
  ```bash
44
+ # Clone and build the fork
45
+ git clone https://github.com/johndpope/llama-cpp-turboquant.git
46
+ cd llama-cpp-turboquant && git checkout feature/planarquant-kv-cache
47
+
48
+ # CUDA (Windows/Linux)
49
+ cmake -B build -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j
50
+
51
+ # Metal (Apple Silicon)
52
+ cmake -B build -DGGML_METAL=ON -DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_BUILD_TYPE=Release && cmake --build build -j
53
+
54
+ # Run with RotorQuant KV cache
55
+ ./build/bin/llama-cli -m Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K.gguf \
56
+ --cache-type-k iso3 --cache-type-v iso3 \
57
+ -ngl 99 -fa \
58
  -p "Explain quantum computing"
59
+
60
+ # Or run as a server
61
+ ./build/bin/llama-server -m Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K.gguf \
62
+ --cache-type-k iso3 --cache-type-v iso3 \
63
+ -ngl 99 -fa --jinja
64
  ```
65
 
66
+ ### Option B β€” With standard llama.cpp / LM Studio / Ollama
67
+
68
+ The GGUF works as a normal quantised model. You won't get RotorQuant-specific KV cache benefits, but standard KV cache quantization (q8_0, q4_0) still reduces VRAM significantly.
69
+
70
+ **llama.cpp (upstream)**
71
  ```bash
72
+ llama-cli -m Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K.gguf \
73
+ --cache-type-k q8_0 --cache-type-v q8_0 \
74
+ -ngl 99 -fa \
75
+ -p "Explain quantum computing"
76
  ```
77
 
78
+ **LM Studio**
79
+ 1. Download the GGUF file and load in LM Studio.
80
+ 2. Enable **Developer Mode** (Settings β†’ Developer).
81
+ 3. In the model loader's advanced settings, set **Flash Attention** to ON.
82
+ 4. Set **K Cache Quantization** and **V Cache Quantization** to `q8_0` (or `q4_0` for more aggressive VRAM savings).
83
+ 5. Note: LM Studio does not currently support RotorQuant's `iso3` cache types. Track [this feature request](https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/1719) for updates.
84
+
85
+ **Ollama**
86
+ ```bash
87
+ # Standard Ollama does not support RotorQuant cache types.
88
+ # Use with default or q8_0 KV cache via OLLAMA_KV_CACHE_TYPE=q8_0
89
+ OLLAMA_KV_CACHE_TYPE=q8_0 OLLAMA_FLASH_ATTENTION=1 ollama run majentik/Nemotron-3-Nano-4B-RotorQuant-GGUF-Q2_K
90
+ ```
91
 
92
  ## Specifications
93
 
94
  | Property | Value |
95
  |----------|-------|
96
+ | Base Model | [nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16) |
97
+ | Architecture | Mamba-2 + Transformer hybrid (dense) |
98
+ | Parameters | 4B (dense hybrid) |
99
+ | Context Length | 262K |
100
+ | Weight Quantization | GGUF Q2_K (aggressive 2-bit, noticeable quality drop) |
101
+ | Original Size (BF16) | ~8 GB |
102
+ | Quantized File Size | ~1.4 GB |
103
+ | KV Cache (RotorQuant) | 3-bit via `--cache-type-k iso3 --cache-type-v iso3` (fork only) |
104
+ | KV Cache (standard) | q8_0, q4_0, f16, etc. (any llama.cpp runtime) |
105
+ | License | other |
106
+ | Modalities | Text only |
107
+ | Compatible Runtimes | llama.cpp, LM Studio, Ollama, koboldcpp |
108
 
109
  ## What is RotorQuant?
110
 
111
+ [RotorQuant](https://github.com/scrya-com/rotorquant) is a KV cache compression method based on Clifford algebra (Cl(3,0)) rotors. It was developed as a faster, more parameter-efficient alternative to Google's [TurboQuant](https://arxiv.org/abs/2504.19874) (ICLR 2026).
112
+
113
+ Instead of applying a dense dΓ—d random orthogonal rotation matrix (as TurboQuant does), RotorQuant uses lightweight block-diagonal rotations β€” independent 2D/4D rotations per pair/quartet β€” achieving O(d) complexity instead of O(d log d), fully parallelisable with no inter-element dependencies.
114
+
115
+ **Benchmarks from the RotorQuant repository** (Llama 3.1 8B, RTX 5090 β€” results will vary by model and hardware):
116
+
117
+ | Metric | RotorQuant (iso3) | TurboQuant | Standard q4_0 |
118
+ |--------|-------------------|------------|---------------|
119
+ | Prefill Speed | 3,822 tok/s | 722 tok/s | β€” |
120
+ | Decode Speed | 119 tok/s | 93 tok/s | β€” |
121
+ | Perplexity (PPL) | 6.91 | 7.07 | β€” |
122
+ | KV Compression | ~5Γ— vs FP16 | ~5Γ— vs FP16 | ~4Γ— vs FP16 |
123
+ | Rotation Parameters | 4 per rotor | 16,384 per matrix | N/A |
124
+
125
+ > **Note:** These benchmarks are from the RotorQuant repository using Llama 3.1 8B on an RTX 5090. Performance on Nemotron-3-Nano-4B will differ. Independent benchmarks for this specific model are welcome β€” please open a discussion if you have results to share.
126
+
127
+ ## Current Status of RotorQuant in the Ecosystem
128
+
129
+ | Runtime | RotorQuant Support | Standard KV Quant |
130
+ |---------|---------------------|-------------------|
131
+ | llama.cpp (upstream) | ❌ Not merged | βœ… q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1 |
132
+ | llama-cpp-turboquant fork | βœ… planar3, iso3 | βœ… All standard types |
133
+ | LM Studio | ❌ [Requested](https://github.com/lmstudio-ai/lmstudio-bug-tracker/issues/1719) | βœ… Via advanced settings |
134
+ | Ollama | ❌ Not supported | βœ… Via OLLAMA_KV_CACHE_TYPE |
135
+ | koboldcpp | ❌ Not supported | βœ… Standard types |
136
 
137
+ ## Recommended Settings
 
 
 
 
138
 
139
+ For VRAM-constrained setups, standard q8_0 KV cache quantization already halves KV cache memory with negligible quality impact. Flash Attention should always be enabled β€” it is required for V cache quantization and improves memory efficiency regardless.
140
 
141
+ | VRAM | Suggested Configuration |
142
+ |------|------------------------|
143
+ | 24 GB (RTX 4090) | Q2_K + q8_0 KV cache + Flash Attention, 8K–16K context |
144
+ | 16 GB | Q2_K + q4_0 KV cache + Flash Attention, 4K–8K context |
145
+ | 48+ GB | Q2_K + f16 KV cache, full 32K+ context |
 
 
 
146
 
147
  ## See Also
148
 
 
 
 
149
  - [RotorQuant GitHub](https://github.com/scrya-com/rotorquant)
150
+ - [llama-cpp-turboquant fork](https://github.com/johndpope/llama-cpp-turboquant/tree/feature/planarquant-kv-cache)
151
+ - [TurboQuant llama.cpp discussion](https://github.com/ggml-org/llama.cpp/discussions/20969)
152
+ - [TurboQuant paper (arXiv: 2504.19874)](https://arxiv.org/abs/2504.19874)
153
+ - [Base model: nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16](https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16)
154
+ - [Nemotron-3-Nano-4B announcement](https://huggingface.co/blog/nvidia/nemotron-3-nano-4b)