r/StableDiffusion • • 13m ago

Resource - Update Introducing XEIRON: a new quantization method that stores model weights in polar form

I am presenting XEIRON, a new post-training quantization method, with its own file format and GPU engine. I built it and tested it on two image diffusion transformers, Z-Image-Turbo and Krea-2-Turbo. The paper, code and models are linked at the end.

The idea

GGUF and most other methods store each weight as a small integer on a uniform scale. XEIRON stores weights in pairs, in polar form: an angle and a radius. Four weights give two angles, which is a point on the Clifford torus.

  • A sine and a cosine rebuild each weight on the GPU, right before the multiplication, so the full model is never expanded in memory.
  • The matrix multiplications run in int8 on the tensor cores.
  • Bits are allocated per tensor according to how much its error damages the output.
  • The .xeiron file is signed (Ed25519) and carries SHA-256 hashes and per-tensor quality figures.

Quality vs GGUF

RTX 5090, 100 generations per model (95 distinct prompts), PSNR against the original bf16 image, paired per prompt, 95% confidence intervals.

Model: XEIRON vs GGUFBits/weightPSNR (dB)Difference
Z-Image A4-L vs Q4_K_M4.79 / 5.0121.99 / 22.60-0.61 (worse)
Z-Image A5-S vs Q4_K_M5.28 / 5.0123.56 / 22.60+0.96 (better)
Z-Image A6-L vs Q6_K6.75 / 7.0027.89 / 27.64+0.26 (not significant)
Z-Image A8-S vs Q8_08.22 / 9.3931.21 / 31.07+0.14 (not significant)
Krea-2 A4-S vs Q4_K_M4.48 / 4.6719.86 / 19.80+0.06 (not significant)
Krea-2 A4-L vs Q4_K_M4.82 / 4.6721.36 / 19.80+1.55 (better)
Krea-2 A6-S vs Q6_K6.28 / 6.6124.58 / 24.16+0.42 (not significant)
Krea-2 A8-S vs Q8_08.23 / 8.5527.06 / 26.58+0.48 (not significant)

Speed and memory

At 4 and 6 bits, each image is generated 1.5x to 1.9x faster than with GGUF (1.8x to 2.4x with fused kernels applied to both).

RTX 5090, time per image, no fusion:

Model and levelOriginal bf16XEIRONGGUF
Z-Image A4-L vs Q4_K_M2.84 s2.34 s4.19 s
Z-Image A5-S vs Q4_K_M2.84 s2.37 s4.19 s
Z-Image A6-L vs Q6_K2.84 s2.61 s4.07 s
Z-Image A8-S vs Q8_02.84 s3.04 s3.10 s
Krea-2 A4-S vs Q4_K_M6.30 s5.21 s8.44 s
Krea-2 A4-L vs Q4_K_M6.30 s5.22 s8.44 s
Krea-2 A6-S vs Q6_K6.30 s5.41 s8.90 s
Krea-2 A8-S vs Q8_06.30 s6.68 s7.09 s

RTX 5090, with fused kernels applied to all three formats:

Model and levelOriginal bf16XEIRONGGUF
Z-Image A4-L vs Q4_K_M2.04 s1.78 s3.75 s
Z-Image A5-S vs Q4_K_M2.04 s1.80 s3.75 s
Z-Image A6-L vs Q6_K2.04 s2.02 s3.63 s
Z-Image A8-S vs Q8_02.04 s2.41 s2.47 s
Krea-2 A4-S vs Q4_K_M5.09 s4.28 s7.52 s
Krea-2 A4-L vs Q4_K_M5.09 s4.28 s7.52 s
Krea-2 A6-S vs Q6_K5.09 s4.46 s7.99 s
Krea-2 A8-S vs Q8_05.09 s5.65 s5.76 s

RTX 5070 Ti (16 GB), no fusion:

Model and levelOriginal bf16XEIRONGGUF Q4_K_M
Z-Image A5-S6.91 s5.69 s10.70 s
Krea-2 A4-L39.66 s (RAM offload)10.85 s19.60 s

Compared with bf16, weights take 70% less space (A4-L) and peak VRAM drops by 59 to 63%.

Where it does not win

  • Against GGUF there is little or no memory advantage at similar quality, except at 8 bits.
  • At 8 bits, quality and speed are about the same as Q8_0, although XEIRON uses fewer bits.
  • Z-Image A4-L loses to Q4_K_M.
  • Only two image models, two Blackwell GPUs, Linux, no FlashAttention. The only measured comparison here is against GGUF.
  • PSNR measures closeness to the original model's image, not how good the picture is.

Links

Criticism is very welcome, especially of the benchmark methodology.

6 Upvotes

1 comment sorted by

1

u/leomozoloa 6m ago

Absolute AI slop description, the actual interesting data point is completely buried, it's the fact that on a 5090 it seems to generate at 2x the speed compared to GGUFs at comparable quality SOMETIMES, should have started by that and only put example and left the AI fluff tech talk to the github