跳转至

Quantization & Dequantization

本页暂无中文版。以下为英文原文。

10 ops, 71 workloads.

One table per op, one row per workload. Ratio is the fastest other implementation's device time divided by ours, so green is faster than it, plain is level with it, red is slower. Times are in ms. How these numbers are taken.

INT8QuantPerTensorFwd

x: [M, K]

  • llama-8b-prefillx: [4096, 4096]dtype=f16, bf16
  • llama-8b-decodex: [32, 4096]dtype=bf16
  • qwen3-32b-prefillx: [8192, 5120]dtype=bf16, f32
  • gpt-oss-20b-decodex: [17, 2880]dtype=bf16
  • gpt-oss-20b-prefillx: [3000, 2880]dtype=bf16
  • odd-hidden-prefillx: [1000, 4099]dtype=f16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-prefillf161.92×0.0183torch-compile
vllm
torch-ref
0.0352
0.0645
0.3029
4.5861%mem
bf161.96×0.0184torch-compile
vllm
torch-ref
0.0359
0.0653
0.3043
4.5761%mem
llama-8b-decodebf161.54×0.0033torch-compile
vllm
torch-ref
0.00509
0.0172
0.0257
0.1993%lat
qwen3-32b-prefillbf161.91×0.0438torch-compile
vllm
torch-ref
0.0835
0.1364
0.7153
4.7964%mem
f321.22×0.0818torch-compile
vllm
torch-ref
0.0998
0.1886
0.5738
2.5657%mem
gpt-oss-20b-decodebf161.44×0.0033torch-compile
vllm
torch-ref
0.00474
0.0195
0.0269
0.07431%lat
gpt-oss-20b-prefillbf161.90×0.0119torch-compile
vllm
torch-ref
0.0226
0.0436
0.1617
3.6448%mem
odd-hidden-prefillf161.95×0.008torch-compile
vllm
torch-ref
0.0156
0.0307
0.0765
2.5634%lat

INT8QuantPerChannelFwd

w: [N, K]

  • llama-8b-mlp-upw: [14336, 4096]dtype=f16, bf16
  • llama-70b-mlp-downw: [8192, 28672]dtype=bf16
  • qwen3-32b-o-projw: [5120, 8192]dtype=bf16, f32
  • gpt-oss-20b-mlp-upw: [5760, 2880]dtype=bf16
  • ragged-kw: [3000, 4099]dtype=f16
  • ragged-k-few-rowsw: [17, 4099]dtype=bf16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-mlp-upf161.08×0.0455vllm
vllm-cuda
torch-compile
torch-ref
0.0490
0.0498
0.1108
1.0026
6.4686%mem
bf161.09×0.0458vllm
vllm-cuda
torch-compile
torch-ref
0.0497
0.0515
0.1154
1.0050
6.4286%mem
llama-70b-mlp-downbf161.56×0.1769vllm-cuda
vllm
torch-compile
torch-ref
0.2756
0.3530
0.3535
3.9229
6.6488%mem
qwen3-32b-o-projbf160.97×0.0350vllm
vllm-cuda
torch-compile
torch-ref
0.0339
0.0363
0.0702
0.7405
5.9980%mem
f321.00×0.0540vllm
vllm-cuda
torch-compile
torch-ref
0.0539
0.0689
0.0713
0.5985
3.8886%mem
gpt-oss-20b-mlp-upbf161.26×0.0158vllm-cuda
vllm
torch-compile
torch-ref
0.0200
0.0204
0.0463
0.3034
5.2470%mem
ragged-kf161.77×0.0139vllm
vllm-cuda
torch-compile
torch-ref
0.0246
0.0265
0.0319
0.2378
4.4359%mem
ragged-k-few-rowsbf161.17×0.00224vllm
torch-compile
vllm-cuda
torch-ref
0.00262
0.00291
0.00342
0.0304
0.1562%lat

INT8QuantPerBlockFwd

x: [M, K]

  • ds-v3-prefillx: [4096, 7168]dtype=f16, bf16
  • ds-v3-decodex: [64, 7168]dtype=bf16
  • qwen3-235b-prefillx: [4096, 4096]dtype=bf16, f32
  • ds-v3-decode-few-tokensx: [17, 7168]dtype=bf16
  • gpt-oss-20b-prefillx: [3000, 2880]dtype=bf16
  • ragged-kx: [1000, 4099]dtype=f16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
ds-v3-prefillf161.49×0.0246torch-compile
vllm
torch-ref
0.0367
0.0564
0.6195
5.9980%mem
bf161.56×0.0249torch-compile
vllm
torch-ref
0.0389
0.0571
0.6208
5.9179%mem
ds-v3-decodebf161.43×0.00214vllm
torch-compile
torch-ref
0.00307
0.00458
0.0284
1.0714%lat
qwen3-235b-prefillbf161.53×0.0154torch-compile
vllm
torch-ref
0.0236
0.0340
0.3671
5.4773%mem
f321.07×0.0234torch-compile
vllm
torch-ref
0.0251
0.0428
0.3077
3.680%mem
ds-v3-decode-few-tokensbf161.15×0.00192torch-compile
vllm
torch-ref
0.00221
0.00259
0.0248
0.3184%lat
gpt-oss-20b-prefillbf164.97×0.00944torch-compile
torch-ref
0.0469
0.2468
4.5962%mem
ragged-kf162.68×0.0096torch-compile
torch-ref
0.0257
0.1163
2.1429%lat

SmoothQuantFwd

x: [M, K]smooth: [K], f32

  • llama-8b-prefillx: [4096, 4096]smooth: [4096], f32dtype=f16, bf16
  • llama-8b-decodex: [32, 4096]smooth: [4096], f32dtype=bf16
  • llama-70b-prefillx: [4096, 8192]smooth: [8192], f32dtype=bf16
  • gpt-oss-20b-prefillx: [3000, 2880]smooth: [2880], f32dtype=bf16
  • ragged-kx: [1000, 4099]smooth: [4099], f32dtype=f16
  • ragged-k-decodex: [17, 4099]smooth: [4099], f32dtype=bf16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-prefillf162.26×0.0193torch-compile
vllm
torch-ref
0.0435
0.1204
0.3699
5.2358%mem
bf162.21×0.0200torch-compile
vllm
torch-ref
0.0441
0.1225
0.3704
5.0456%mem
llama-8b-decodebf161.23×0.00253torch-compile
vllm
torch-ref
0.0031
0.00922
0.0318
0.3114%lat
llama-70b-prefillbf161.92×0.0383torch-compile
vllm
torch-ref
0.0734
0.2382
0.7208
5.2658%mem
gpt-oss-20b-prefillbf162.31×0.0143torch-compile
vllm
torch-ref
0.0330
0.0668
0.2009
3.6340%mem
ragged-kf162.07×0.0121torch-compile
vllm
torch-ref
0.0251
0.0447
0.0970
2.0323%lat
ragged-k-decodebf161.25×0.00362torch-compile
vllm
torch-ref
0.00451
0.0109
0.0325
0.1161%lat

FP8QuantFwd

input_tensor: [batch, seq_len_kv, kv_group, index_dim]

  • kv-index-8kinput_tensor: [1, 8192, 1, 64]dtype=f16, bf16
  • kv-index-4kinput_tensor: [1, 4096, 1, 128]dtype=f32
  • kv-index-context-chunkinput_tensor: [1, 3072, 1, 128]dtype=f16, bf16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
kv-index-8kf161.24×0.00224torch-compile
vllm
torch-ref
0.00278
0.00474
0.0211
0.94416%lat
bf161.23×0.00224torch-compile
vllm
torch-ref
0.00275
0.00477
0.0211
0.94416%lat
kv-index-4kf321.10×0.00278torch-compile
vllm
torch-ref
0.00307
0.00442
0.0156
0.75621%lat
kv-index-context-chunkf161.66×0.00214vllm
torch-compile
torch-ref
0.00355
0.00448
0.0188
0.73612%lat
bf161.66×0.00214vllm
torch-compile
torch-ref
0.00355
0.00448
0.0188
0.73612%lat

FP8QuantPerBlockFwd

w: [N, K]

  • ds-v3-mlp-downw: [7168, 18432]dtype=bf16
  • ds-v3-expert-gate-upw: [4096, 7168]dtype=bf16, f32
  • qwen3-235b-qkvw: [9216, 4096]dtype=bf16, f16
  • gpt-oss-expert-downw: [2880, 2880]dtype=bf16
  • ragged-kw: [1000, 4099]dtype=f16
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
ds-v3-mlp-downbf162.44×0.0953torch-compile
torch-ref
vllm
0.2323
2.1144
3.6444
5.5592%mem
ds-v3-expert-gate-upbf162.24×0.0245torch-compile
torch-ref
vllm
0.0551
0.4938
0.8240
4.7980%mem
f321.86×0.0388torch-compile
torch-ref
vllm
0.0724
0.3931
0.7638
3.0284%mem
qwen3-235b-qkvbf162.28×0.0303torch-compile
torch-ref
vllm
0.0692
0.6264
1.0554
4.9983%mem
f162.19×0.0302torch-compile
torch-ref
vllm
0.0661
0.6239
1.0543
583%mem
gpt-oss-expert-downbf163.09×0.00954torch-compile
torch-ref
vllm
0.0294
0.2074
0.2796
3.4858%mem
ragged-kf162.24×0.00902torch-compile
torch-ref
vllm
0.0202
0.1039
0.1517
1.8230%lat

INT4QuantPerGroupFwd

w: [N, K]

dtype=f16

  • llama-8b-mlp-upw: [14336, 4096]
  • llama-8b-q-projw: [4096, 4096]group_size=64
  • llama-70b-mlp-downw: [8192, 28672]
  • qwen3-32b-o-projw: [5120, 8192]
  • qwen2-7b-mlp-upw: [18944, 3584]
  • qwen2-7b-mlp-downw: [3584, 18944]
  • opt-13b-mlp-upw: [20480, 5120]group_size=64
  • llama-8b-mlp-up-chanw: [14336, 4096]group_size=4096
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-mlp-upf161.44×0.0400deepspeed0.057510.384%mem
llama-8b-q-projf161.25×0.0144deepspeed0.01818.2568%mem
llama-70b-mlp-downf161.44×0.1532deepspeed0.220810.887%mem
qwen3-32b-o-projf161.40×0.0299deepspeed0.04189.8980%mem
qwen2-7b-mlp-upf161.45×0.0457deepspeed0.066110.585%mem
qwen2-7b-mlp-downf161.44×0.0457deepspeed0.065910.585%mem
opt-13b-mlp-upf161.39×0.0713deepspeed0.099210.486%mem
llama-8b-mlp-up-chanf161.25×0.0403deepspeed0.050510.281%mem

INT8DequantPerTensorFwd

q: [M, K], i8scale: [1], f32

  • llama-8b-prefillq: [4096, 4096], i8scale: [1], f32dtype=bf16
  • llama-8b-decodeq: [32, 4096], i8scale: [1], f32dtype=bf16
  • qwen3-32b-prefillq: [8192, 5120], i8scale: [1], f32dtype=f16, f32
  • gpt-oss-prefillq: [3000, 2880], i8scale: [1], f32dtype=bf16
  • ragged-k-few-rowsq: [17, 4099], i8scale: [1], f32dtype=f16

q: [M, K], i8scale: [1]

  • ragged-kq: [1000, 4099], i8scale: [1]dtype=f32
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-prefillbf161.06×0.0135torch-compile
torch-ref
0.0143
0.1360
1.2483%mem
llama-8b-decodebf161.10×0.00163torch-compile
torch-ref
0.00179
0.0073
0.08035%lat
qwen3-32b-prefillf161.03×0.0316torch-compile
torch-ref
0.0325
0.3287
1.3388%mem
f321.02×0.0529torch-compile
torch-ref
0.0538
0.2697
0.79288%mem
gpt-oss-prefillbf161.15×0.00739torch-compile
torch-ref
0.00851
0.0720
1.1778%mem
ragged-k-few-rowsf161.02×0.00163torch-compile
torch-ref
0.00166
0.0071
0.04273%lat
ragged-kf321.05×0.00611torch-compile
torch-ref
0.0064
0.0272
0.67174%mem

INT8DequantPerChannelFwd

q: [M, K], i8scale: [M], f32

  • llama-8b-mlp-upq: [14336, 4096], i8scale: [14336], f32dtype=bf16, f16
  • llama-70b-mlp-downq: [8192, 28672], i8scale: [8192], f32dtype=bf16
  • gpt-oss-20b-mlp-upq: [5760, 2880], i8scale: [5760], f32dtype=bf16
  • ragged-kq: [3000, 4099], i8scale: [3000], f32dtype=f16
  • ragged-k-few-rowsq: [17, 4099], i8scale: [17], f32dtype=bf16

q: [M, K], i8scale: [M]

  • llama-8b-mlp-downq: [4096, 14336], i8scale: [4096]dtype=f32
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
llama-8b-mlp-upbf161.07×0.0440torch-compile
torch-ref
0.0470
0.4721
1.3389%mem
f161.07×0.0440torch-compile
torch-ref
0.0471
0.4721
1.3389%mem
llama-70b-mlp-downbf161.06×0.1726torch-compile
torch-ref
0.1828
1.8544
1.3691%mem
gpt-oss-20b-mlp-upbf161.06×0.0140torch-compile
torch-ref
0.0148
0.1392
1.1979%mem
ragged-kf161.14×0.0112torch-compile
torch-ref
0.0128
0.1047
1.173%mem
ragged-k-few-rowsbf161.11×0.00147torch-compile
torch-ref
0.00163
0.00717
0.04733%lat
llama-8b-mlp-downf321.01×0.0742torch-compile
torch-ref
0.0747
0.3884
0.79288%mem

INT8DequantPerBlockFwd

q: [M, K], i8scale: [M, ceil_div(K, 128)], f32

  • ds-v3-prefillq: [4096, 7168], i8scale: [4096, 56], f32dtype=bf16
  • ds-v3-decodeq: [64, 7168], i8scale: [64, 56], f32dtype=bf16
  • qwen3-235b-prefillq: [4096, 4096], i8scale: [4096, 32], f32dtype=f16
  • gpt-oss-prefillq: [3000, 2880], i8scale: [3000, 23], f32dtype=bf16
  • ragged-k-few-rowsq: [17, 4099], i8scale: [17, 33], f32dtype=f16

q: [M, K], i8scale: [M, ceil_div(K, 128)]

  • ragged-kq: [1000, 4099], i8scale: [1000, 33]dtype=f32
Workload dtype Ratio Device time Alternatives Throughput SOL Bound
alt / ours ms name ms TFLOP/s of ceiling by
ds-v3-prefillbf161.06×0.0229torch-compile
torch-ref
0.0243
0.2941
1.2886%mem
ds-v3-decodebf161.20×0.00186torch-compile
torch-ref
0.00222
0.0107
0.24717%lat
qwen3-235b-prefillf161.08×0.0136torch-compile
torch-ref
0.0148
0.1729
1.2383%mem
gpt-oss-prefillbf161.81×0.00794torch-compile
torch-ref
0.0143
0.1025
1.0973%mem
ragged-k-few-rowsf161.04×0.0016torch-compile
torch-ref
0.00166
0.00896
0.04353%lat
ragged-kf321.29×0.00654torch-compile
torch-ref
0.00842
0.0427
0.62670%mem