WaveCut commited on
Commit
5daaff7
·
verified ·
1 Parent(s): 075b996

Update comparison matrix and Metal results

Browse files
README.md CHANGED
@@ -32,7 +32,7 @@ OrbitQuant paper itself leaves text encoders in BF16.
32
  ## Install
33
 
34
  ```bash
35
- pip install "orbitquant[kernels]>=0.3.0" "diffusers>=0.39" "transformers>=5.13" accelerate
36
  ```
37
 
38
  OrbitQuant uses packed low-bit inference by default. CUDA first uses an importable
@@ -127,39 +127,72 @@ results are in `benchmark/summary.json`.
127
 
128
  ## Metal Kernel Reference
129
 
130
- The packed Metal operator was also measured on an Apple M2 Max with Torch
131
- 2.12.1, FP16 activations, W4 weights, `in_features=768`, and
132
- `out_features=2304`. The reference materializes the FP16 weight and then calls
133
- `F.linear` inside each timed iteration.
134
-
135
- | Activation rows | Packed Metal | Materialize + `F.linear` | Speedup |
136
- | ---: | ---: | ---: | ---: |
137
- | 1 | 0.0508 ms | 0.2181 ms | 4.29x |
138
- | 3 | 0.0879 ms | 0.2188 ms | 2.49x |
139
- | 8 | 0.1698 ms | 0.2230 ms | 1.31x |
140
- | 9 | 0.0368 ms | 0.2264 ms | 6.15x |
141
- | 16 | 0.0485 ms | 0.2581 ms | 5.33x |
142
- | 31 | 0.0568 ms | 0.2635 ms | 4.64x |
143
-
144
- This is an operator-level reference, not a full FLUX.2 pipeline benchmark. The
145
- packed path consumes packed indices directly and does not allocate a complete
146
- floating-point weight matrix.
 
 
 
 
 
 
 
 
 
147
 
148
  ## Visual Comparison
149
 
150
- The matrix contains full-resolution output from ten difficult prompts: micro-detail,
151
- counting, nested architecture, original mixed-media style, abstract materials, English
152
- fine print, Russian typography, Japanese typography, Chinese typography and a dense
153
- multi-subject panorama. Columns use identical prompts, settings and seed. The WebP was
154
- encoded at quality 95.
155
-
156
- ![BF16, SDNQ and OrbitQuant comparison](assets/image_generation_comparison_matrix.webp)
157
-
158
- All three variants remained coherent and detailed. OrbitQuant preserved material detail,
159
- reflections and dense compositions without blank or noisy outputs. SDNQ reproduced the
160
- small English specification text more accurately. Exact object counts and fine CJK text
161
- were unreliable for every variant. This is a subjective paired inspection, not an
162
- objective quality metric.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
 
164
  ## Limitations
165
 
 
32
  ## Install
33
 
34
  ```bash
35
+ pip install "orbitquant[kernels]>=0.3.1" "diffusers>=0.39" "transformers>=5.13" accelerate
36
  ```
37
 
38
  OrbitQuant uses packed low-bit inference by default. CUDA first uses an importable
 
127
 
128
  ## Metal Kernel Reference
129
 
130
+ The packed Metal operator was measured on an Apple M2 Max with Torch 2.12.1,
131
+ FP16 activations, W4 weights, `in_features=768`, and `out_features=2304`.
132
+
133
+ | Activation rows | Packed Metal | Resident FP16 `F.linear` | Materialize + `F.linear` | Packed vs materialize |
134
+ | ---: | ---: | ---: | ---: | ---: |
135
+ | 1 | 0.0470 ms | 0.0411 ms | 0.2310 ms | 4.92x |
136
+ | 2 | 0.0439 ms | 0.0422 ms | 0.2371 ms | 5.40x |
137
+ | 3 | 0.0451 ms | 0.0404 ms | 0.2348 ms | 5.20x |
138
+ | 8 | 0.0420 ms | 0.0503 ms | 0.2512 ms | 5.97x |
139
+ | 9 | 0.0446 ms | 0.0501 ms | 0.2422 ms | 5.43x |
140
+ | 16 | 0.0459 ms | 0.0581 ms | 0.2512 ms | 5.47x |
141
+ | 31 | 0.0428 ms | 0.0659 ms | 0.2623 ms | 6.12x |
142
+
143
+ One-row projections use the SIMD-group packed matvec. Aligned FP16/BF16
144
+ projections with two or more rows use the padded matrix path. The packed
145
+ weight payload, row norms and centroids occupy 25.26% of the materialized FP16
146
+ weight size for this shape.
147
+
148
+ For a complete 4096-coordinate RPBH block with constants resident on MPS, the
149
+ 512-thread fused activation path measured 1.17-1.45x faster than the 256-thread
150
+ path across 1-4096 activation rows. Smaller or multi-block RPBH dimensions
151
+ retain 256 threads.
152
+
153
+ These are operator-level references, not a full FLUX.2 pipeline benchmark.
154
+ Packed execution consumes low-bit indices directly and does not allocate a
155
+ complete floating-point weight matrix.
156
 
157
  ## Visual Comparison
158
 
159
+ The matrix uses the complete ten-prompt stress pack with full 1024x1024 tiles
160
+ and WebP quality 95. BF16 is the full-precision reference from the controlled
161
+ visual run; the SDNQ and OrbitQuant columns use the corresponding L40S
162
+ benchmark outputs. Every row uses the same prompt, seed, resolution, step count
163
+ and guidance.
164
+
165
+ ![BF16, SDNQ UINT4 and OrbitQuant W4A4 across ten difficult prompts](assets/image_generation_comparison_matrix.webp)
166
+
167
+ ### Visual Assessment
168
+
169
+ - **No collapse:** all thirty outputs are finite, coherent and detailed. OrbitQuant did not
170
+ produce blank, noisy or structurally broken images.
171
+ - **Micro-detail and materials:** all three variants preserve gears, filigree, architectural
172
+ interiors, paper grain, metal, resin and reflected surfaces. OrbitQuant remains competitive
173
+ with BF16 and SDNQ in these cases.
174
+ - **Dense composition:** all variants retain foreground/background separation and the main
175
+ hierarchy in the architectural cutaway and orbital-banquet prompts. Individual requested
176
+ objects move or disappear because quantization changes the denoising trajectory.
177
+ - **Counting:** none of the variants reliably renders exactly nine performers or every exact
178
+ repeated motif. This is a base-model limitation in the tested setting rather than an
179
+ OrbitQuant-only collapse.
180
+ - **English typography:** OrbitQuant is strongest on this row: it preserves the headline,
181
+ subtitle and all four specification lines. SDNQ preserves the headline and three table
182
+ lines but omits or corrupts some requested text.
183
+ - **Russian typography:** all variants render the large headline, subtitle and archive stamp
184
+ well; small contents text contains errors in every column.
185
+ - **Japanese and Chinese typography:** visual glyph quality is plausible, but exact requested
186
+ strings are not reliably reproduced by any variant.
187
+ - **Trajectory fidelity:** both quantizers change the denoising trajectory at the same seed;
188
+ neither remains consistently closer to BF16 across all ten prompts.
189
+
190
+ This subjective paired inspection demonstrates non-collapse and exposes
191
+ concrete failure modes; it is not a substitute for GenEval or another
192
+ task-specific objective metric. In this controlled FLUX.2 Klein 9B comparison,
193
+ OrbitQuant produces the smaller complete 4-bit pipeline, reaches SDNQ
194
+ hot-generation parity with lower runtime memory, and produces the strongest
195
+ English fine-print result in the prompt pack.
196
 
197
  ## Limitations
198
 
assets/image_generation_comparison_matrix.webp CHANGED

Git LFS Details

  • SHA256: 02f199e9e833501e8ee57418016ca3514376a90a6f952c46e2542c6d1ec3ff27
  • Pointer size: 133 Bytes
  • Size of remote file: 11 MB

Git LFS Details

  • SHA256: fcabc0bc3a13a2bbbcb91ad7e2dea6b2731e0dbc5e563df40890928d19fa4e4a
  • Pointer size: 133 Bytes
  • Size of remote file: 10.9 MB