Sampling¶
6 ops, 47 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.
TopKMaskFwd¶
logits: [B, V]top_k: [B], i32
llama-logits: [1, 128256]top_k: [1], i32k_list=repeat(50, 1)dtype=bf16, f328b- b1 llama-logits: [64, 128256]top_k: [64], i32k_list=repeat(50, 64)dtype=bf168b- b64 llama-logits: [256, 128256]top_k: [256], i32k_list=repeat(50, 256)dtype=f16, bf168b- b256 qwen3-logits: [128, 151936]top_k: [128], i32k_list=repeat(20, 128)dtype=bf16235b- b128 gpt-logits: [64, 201088]top_k: [64], i32k_list=repeat(50, 64)dtype=bf16oss- 120b- b64 gpt2-logits: [17, 50257]top_k: [17], i32k_list=[1,2,5,10…]dtype=f16b17- mixed deepseek-logits: [17, 129280]top_k: [17], i32k_list=[1,2,5,10…]dtype=bf16v3- b17- mixed
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | bf16 | 2.69× | 0.0139 | flashinfertorch-compilevllmtorch-ref | 0.0374 0.0547 0.0626 0.0732 | 0.0184 | · | · |
| f32 | 2.59× | 0.0174 | flashinfertorch-compiletorch-refvllm | 0.0451 0.0580 0.0734 0.0829 | 0.0147 | · | · | |
llama- | bf16 | 1.14× | 0.0338 | flashinfervllmtorch-compiletorch-ref | 0.0386 0.1775 0.6788 0.7474 | 0.486 | · | · |
llama- | f16 | 1.26× | 0.1094 | flashinfervllmtorch-compiletorch-ref | 0.1378 0.5123 2.7456 3.0115 | 0.6 | · | · |
| bf16 | 1.22× | 0.1176 | flashinfervllmtorch-compiletorch-ref | 0.1429 0.5196 2.7099 2.9595 | 0.558 | · | · | |
qwen3- | bf16 | 1.07× | 0.0782 | flashinfervllmtorch-compiletorch-ref | 0.0835 0.3709 2.3367 2.4815 | 0.497 | · | · |
gpt- | bf16 | 1.09× | 0.0501 | flashinfervllmtorch-compiletorch-ref | 0.0546 0.2466 0.9961 1.1022 | 0.514 | · | · |
gpt2- | f16 | 2.30× | 0.0220 | flashinfervllmtorch-compiletorch-ref | 0.0508 0.1249 0.1387 0.1485 | 0.0684 | · | · |
deepseek- | bf16 | 1.79× | 0.0217 | flashinfervllmtorch-compiletorch-ref | 0.0388 0.1439 0.2330 0.2627 | 0.179 | · | · |
MinPMaskFwd¶
logits: [B, V]min_p: [B], f32
llama-logits: [1, 128256]min_p: [1], f32dtype=bf16, f328b- b1 llama-logits: [64, 128256]min_p: [64], f32dtype=bf168b- b64 llama-logits: [256, 128256]min_p: [256], f32dtype=bf168b- b256 qwen3-logits: [128, 151936]min_p: [128], f32dtype=bf16235b- b128 deepseek-logits: [17, 129280]min_p: [17], f32dtype=bf16v3- b17 llama2-logits: [100, 32000]min_p: [100], f32dtype=f167b- b100
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | bf16 | 1.19× | 0.00371 | torch-compiletorch-refvllm | 0.00442 0.0283 0.1149 | 0.0691 | · | · |
| f32 | 1.22× | 0.00378 | torch-compiletorch-refvllm | 0.00461 0.0378 0.1192 | 0.0679 | · | · | |
llama- | bf16 | 1.34× | 0.0131 | torch-compiletorch-refvllm | 0.0175 0.0996 0.1182 | 1.25 | · | · |
llama- | bf16 | 1.51× | 0.0368 | torch-compilevllmtorch-ref | 0.0557 0.1617 0.3026 | 1.79 | · | · |
qwen3- | bf16 | 1.74× | 0.0225 | torch-compilevllmtorch-ref | 0.0391 0.1622 0.1861 | 1.73 | · | · |
deepseek- | bf16 | 1.72× | 0.00685 | torch-compiletorch-refvllm | 0.0118 0.0434 0.1167 | 0.642 | · | · |
llama2- | f16 | 2.51× | 0.00582 | torch-compilevllmtorch-ref | 0.0146 0.0272 0.0379 | 1.1 | · | · |
TopPMaskFwd¶
logits: [B, V]top_p: [B], f32
llama-logits: [1, 128256]top_p: [1], f32dtype=bf16, f328b- b1 llama-logits: [64, 128256]top_p: [64], f32dtype=bf168b- b64 llama-logits: [256, 128256]top_p: [256], f32dtype=f16, bf168b- b256 qwen3-logits: [128, 151936]top_p: [128], f32dtype=bf16235b- b128 gpt-logits: [64, 201088]top_p: [64], f32dtype=bf16oss- 120b- b64 deepseek-logits: [17, 129280]top_p: [17], f32dtype=bf16v3- b17 llama2-logits: [100, 32000]top_p: [100], f32dtype=f167b- b100
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | bf16 | 2.59× | 0.00371 | vllmtorch-compiletorch-ref | 0.00963 0.0809 0.1356 | 0.242 | · | · |
| f32 | 1.98× | 0.00378 | vllmtorch-compiletorch-ref | 0.00749 0.0825 0.1405 | 0.238 | · | · | |
llama- | bf16 | 10.03× | 0.0487 | vllmtorch-compiletorch-ref | 0.4889 1.0575 1.5586 | 1.18 | · | · |
llama- | f16 | 6.25× | 0.2865 | vllmtorch-compiletorch-ref | 1.7908 4.1693 5.4121 | 0.802 | · | · |
| bf16 | 6.68× | 0.2534 | vllmtorch-compiletorch-ref | 1.6923 4.1216 5.3366 | 0.907 | · | · | |
qwen3- | bf16 | 6.86× | 0.1523 | vllmtorch-compiletorch-ref | 1.0452 3.1970 4.0303 | 0.894 | · | · |
gpt- | bf16 | 10.52× | 0.0824 | vllmtorch-compiletorch-ref | 0.8675 1.6196 2.4013 | 1.09 | · | · |
deepseek- | bf16 | 6.30× | 0.0237 | vllmtorch-compiletorch-ref | 0.1495 0.3549 0.6901 | 0.648 | · | · |
llama2- | f16 | 3.73× | 0.0443 | vllmtorch-compiletorch-ref | 0.1653 0.4799 0.6840 | 0.506 | · | · |
TopKTopPMaskFwd¶
logits: [B, V]top_k: [B], i32top_p: [B], f32
llama-logits: [1, 128256]top_k: [1], i32top_p: [1], f32k_list=repeat(50, 1)dtype=bf16, f328b- b1 llama-logits: [64, 128256]top_k: [64], i32top_p: [64], f32k_list=repeat(50, 64)dtype=bf168b- b64 llama-logits: [256, 128256]top_k: [256], i32top_p: [256], f32k_list=repeat(50, 256)dtype=f16, bf168b- b256 qwen3-logits: [128, 151936]top_k: [128], i32top_p: [128], f32k_list=repeat(20, 128)dtype=bf16235b- b128 gpt2-logits: [17, 50257]top_k: [17], i32top_p: [17], f32k_list=[1,2,5,10…]dtype=f16b17- mixed deepseek-logits: [100, 129280]top_k: [100], i32top_p: [100], f32k_list=repeat(40, 100)dtype=bf16v3- b100
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | bf16 | 5.66× | 0.0214 | torch-compilevllmtorch-ref | 0.1214 0.1453 0.2232 | 0.012 | · | · |
| f32 | 3.44× | 0.0363 | torch-compilevllmtorch-ref | 0.1249 0.1512 0.2204 | 0.00708 | · | · | |
llama- | bf16 | 2.11× | 0.1026 | vllmtorch-compiletorch-ref | 0.2162 1.5492 2.0769 | 0.16 | · | · |
llama- | f16 | 1.71× | 0.2562 | vllmtorch-compiletorch-ref | 0.4379 6.4090 7.6912 | 0.257 | · | · |
| bf16 | 1.39× | 0.3101 | vllmtorch-compiletorch-ref | 0.4304 6.3754 7.6405 | 0.212 | · | · | |
qwen3- | bf16 | 0.95× | 0.2615 | vllmtorch-compiletorch-ref | 0.2481 5.2824 6.1594 | 0.149 | · | · |
gpt2- | f16 | 5.23× | 0.0607 | torch-compiletorch-refvllm | 0.3174 0.4372 0.4730 | 0.0386 | · | · |
deepseek- | bf16 | 1.43× | 0.1381 | vllmtorch-compiletorch-ref | 0.1974 2.3800 2.9968 | 0.187 | · | · |
SamplingFromProbsFwd¶
probs: [B, V], f32seed, offset: [1]
dtype=i64
llama-probs: [1, 128256], f32seed, offset: [1]8b- b1 llama-probs: [64, 128256], f32seed, offset: [1]8b- b64 llama-probs: [256, 128256], f32seed, offset: [1]8b- b256 qwen3-probs: [128, 151936], f32seed, offset: [1]235b- b128 gpt-probs: [64, 201088], f32seed, offset: [1]oss- 120b- b64 ds-probs: [17, 129280], f32seed, offset: [1]v3- b17 llama2-probs: [100, 32000], f32seed, offset: [1]7b- b100
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | i64 | 1.04× | 0.00592 | vllmflashinfertorch-multinomialtorch-compiletorch-ref | 0.00614 0.0232 0.1010 0.5307 0.9051 | 0.0217 | · | · |
llama- | i64 | 2.61× | 0.0159 | flashinfervllmtorch-multinomialtorch-compiletorch-ref | 0.0414 0.0461 0.1419 0.6650 1.4328 | 0.517 | · | · |
llama- | i64 | 1.44× | 0.0485 | flashinfervllmtorch-multinomialtorch-compiletorch-ref | 0.0700 0.1669 0.3236 1.1679 2.3184 | 0.676 | · | · |
qwen3- | i64 | 1.71× | 0.0289 | flashinfervllmtorch-multinomialtorch-compiletorch-ref | 0.0495 0.1012 0.2171 0.9785 1.8993 | 0.673 | · | · |
gpt- | i64 | 2.77× | 0.0224 | flashinfervllmtorch-multinomialtorch-compiletorch-ref | 0.0621 0.0690 0.1601 1.0783 1.9839 | 0.574 | · | · |
ds- | i64 | 1.85× | 0.00902 | vllmflashinfertorch-multinomialtorch-compiletorch-ref | 0.0167 0.0399 0.0937 0.5857 1.2422 | 0.244 | · | · |
llama2- | i64 | 1.72× | 0.00803 | flashinfervllmtorch-multinomialtorch-compiletorch-ref | 0.0138 0.0218 0.0636 0.2851 0.8599 | 0.398 | · | · |
ChainSpeculativeSamplingFwd¶
draft_probs: [B, N, V]draft_token_ids: [B, N], i32target_probs: [B, N + 1, V]seed, offset: [1], i64
dtype=f32
llama-draft_probs: [16, 4, 128256]draft_token_ids: [16, 4], i32target_probs: [16, 5, 128256]seed, offset: [1], i648b- b16- n4 llama-draft_probs: [64, 4, 128256]draft_token_ids: [64, 4], i32target_probs: [64, 5, 128256]seed, offset: [1], i648b- b64- n4 ds-draft_probs: [64, 1, 129280]draft_token_ids: [64, 1], i32target_probs: [64, 2, 129280]seed, offset: [1], i64v3- mtp- n1 ds-draft_probs: [64, 3, 129280]draft_token_ids: [64, 3], i32target_probs: [64, 4, 129280]seed, offset: [1], i64v3- mtp- n3 qwen3-draft_probs: [32, 5, 151936]draft_token_ids: [32, 5], i32target_probs: [32, 6, 151936]seed, offset: [1], i64235b- eagle- n5 llama-draft_probs: [17, 8, 128256]draft_token_ids: [17, 8], i32target_probs: [17, 9, 128256]seed, offset: [1], i648b- b17- n8 llama2-draft_probs: [256, 1, 32000]draft_token_ids: [256, 1], i32target_probs: [256, 2, 32000]seed, offset: [1], i647b- b256- n1
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
llama- | f32 | 4.41× | 0.0123 | vllmflashinfertorch-compiletorch-ref | 0.0543 0.0599 0.5775 1.3100 | 0.5 | · | · |
llama- | f32 | 3.24× | 0.0236 | flashinfervllmtorch-compiletorch-ref | 0.0764 0.1454 0.6987 1.7170 | 1.04 | · | · |
ds- | f32 | 3.05× | 0.0216 | flashinfervllmtorch-compiletorch-ref | 0.0657 0.0863 0.7483 1.6476 | 1.15 | · | · |
ds- | f32 | 3.26× | 0.0226 | flashinfervllmtorch-compiletorch-ref | 0.0737 0.1272 0.7268 1.7013 | 1.1 | · | · |
qwen3- | f32 | 3.85× | 0.0194 | flashinfervllmtorch-compiletorch-ref | 0.0748 0.1098 0.7920 1.6690 | 0.751 | · | · |
llama- | f32 | 4.77× | 0.0142 | flashinfervllmtorch-compiletorch-ref | 0.0678 0.0788 0.6213 1.3829 | 0.46 | · | · |
llama2- | f32 | 2.72× | 0.0175 | flashinfervllmtorch-compiletorch-ref | 0.0475 0.0878 0.4080 1.2680 | 1.41 | · | · |