Views
No views yet
What's in this repo: the fused INT8 kernel (triton_int8_gemm.py) + the loader that installs it (fused_int8.py), plususage.py/download_deps.py. It does not carry the weights: it loads the INT8 W8A8 weights fromtransformerlab/ideogram-4-int8-w8a8and the text encoder + VAE + inference code from the gated base repoideogram-ai/ideogram-4-fp8.
int8 × int8 → int32 on Ampere mma.s8 units and folds the per-token (activation)
× per-channel (weight) dequantization and bias into the GEMM epilogue, so a quantized linear
is a single fused kernel launch. The result is that INT8 becomes the fastest variant on a
3090, and 1024px generation fits on a single 24 GB card (FP8/BF16 need two).| Variant | s/image | GPUs |
|---|---|---|
| Fused INT8 (this kernel) | 156.5 | 1 |
| NF4 (published) | 164.5 | 1 |
| FP8 (published) | 172.9 | 2 |
| INT8 W8A8 without the fused kernel | 184–185 | 2 |
torch._int_mm. Quality matches the unfused INT8 build on PickScore /
CLIPScore (point estimates). Latencies are single-run measurements; small margins (e.g. vs
NF4) are within unquantified run-to-run variance.sm_86; retuning is needed elsewhere.1# 1) one-time: install ideogram4 + triton, fetch base components + the INT8 weights
2# (needs your own access to the gated repos ideogram-ai/ideogram-4-fp8 and
3# transformerlab/ideogram-4-int8-w8a8)
4python download_deps.py
5
6# 2) generate (single 24 GB Ampere card, e.g. RTX 3090). Ideogram 4 expects a
7# structured JSON caption, NOT a raw string (see "Prompt format" below):
8python usage.py '{"high_level_description":"A graphic-design poster with the word \"HELLO\" in large bold lettering, centered on a solid background.","compositional_deconstruction":{"background":"A flat solid-color poster background with even, neutral studio lighting.","elements":[{"type":"text","bbox":[380,250,620,780],"text":"HELLO","desc":"the word HELLO in large bold sans-serif uppercase, centered, high contrast against the background"}]}}'high_level_description plus a compositional_deconstruction
(a scene-shell background and an elements list). Put any in-image text in a text
element carrying the verbatim string:1{
2 "high_level_description": "A graphic-design poster with the word 'HELLO' in large bold lettering, centered on a solid background.",
3 "compositional_deconstruction": {
4 "background": "A flat solid-color poster background with even, neutral studio lighting.",
5 "elements": [
6 {
7 "type": "text",
8 "bbox": [380, 250, 620, 780],
9 "text": "HELLO",
10 "desc": "the word HELLO in large bold sans-serif uppercase, centered, high contrast against the background"
11 }
12 ]
13 }
14}triton_int8_gemm.py — the fused INT8 GEMM (autotuned per shape).fused_int8.py — loads the INT8 W8A8 weights and installs the fused kernel on the DiT linears.usage.py, download_deps.py — a minimal end-to-end example + setup.Reference implementation: the kernel math is validated (bit-exact integer accumulation), but verify end to end on your stack before production use. Requires an Ampere GPU with INT8 tensor cores andtriton.