Other¶
6 ops, 27 workloads — FFT 1 · mHC 2 · Engram 3.
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.
FFT¶
FFTC2CFwd¶
input: [*B, n]
latency-input: [4096]dtype=c644k throughput-input: [64, 4096]dtype=c64, c1284k longconv-input: [64, 16384]dtype=c6416k longconv-input: [8, 65536]dtype=c6464k spectrogram-input: [256, 1024]dtype=c641k fnet-input: [4096, 512]dtype=c64512 shortconv-input: [65536, 64]dtype=c6464 scientific-input: [4, 1048576]dtype=c1281m spectrogram-input: [300, 1024]dtype=c641k- b300
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
latency- | c64 | 1.54× | 0.00358 | torch-compiletorch-cufft | 0.00554 0.00557 | 0.0686 | 0% | lat |
throughput- | c64 | 1.28× | 0.00445 | torch-cuffttorch-compile | 0.0057 0.0057 | 3.54 | 21% | lat |
| c128 | 1.18× | 0.00726 | torch-cuffttorch-compile | 0.00858 0.00858 | 2.17 | 26% | lat | |
longconv- | c64 | 1.07× | 0.0154 | torch-cuffttorch-compile | 0.0164 0.0164 | 4.77 | 24% | mem |
longconv- | c64 | 1.24× | 0.00893 | torch-cuffttorch-compile | 0.0110 0.0110 | 4.7 | 21% | lat |
spectrogram- | c64 | 1.15× | 0.00352 | torch-cuffttorch-compile | 0.00403 0.00406 | 3.72 | 26% | lat |
fnet- | c64 | 1.26× | 0.0109 | torch-compiletorch-cufft | 0.0138 0.0138 | 8.62 | 68% | mem |
shortconv- | c64 | 1.09× | 0.0203 | torch-compiletorch-cufft | 0.0222 0.0222 | 6.2 | 73% | mem |
scientific- | c128 | 1.38× | 0.1049 | torch-compiletorch-cufft | 0.1448 0.1449 | 4 | 28% | mem |
spectrogram- | c64 | 1.14× | 0.004 | torch-cuffttorch-compile | 0.00458 0.00458 | 3.84 | 27% | lat |
mHC¶
MHCPreFwd¶
phi: [C, Q]x: [B, C], bf16b: [Q]
alpha_pre=1alpha_post=1alpha_res=1sinkhorn_repeat=1dtype=f32
hidden-phi: [5120, 24]x: [1, 5120], bf16b: [24]1280 hidden-phi: [7680, 24]x: [2, 7680], bf16b: [24]1920 hidden-phi: [10240, 24]x: [4, 10240], bf16b: [24]2560
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
hidden- | f32 | 4.40× | 0.00472 | torch-compiletorch-ref | 0.0208 0.0658 | 0.0629 | 2% | lat |
hidden- | f32 | 6.43× | 0.00509 | torch-compiletorch-ref | 0.0327 0.0856 | 0.175 | 4% | lat |
hidden- | f32 | 10.52× | 0.0055 | torch-compiletorch-ref | 0.0579 0.1246 | 0.432 | 5% | lat |
MHCPostFwd¶
x_layer_out: [B, c_x]h_post: [B, n], f32x_res: [B, n * c_x]
dtype=bf16
hidden-x_layer_out: [1, 1280]h_post: [1, 4], f32x_res: [1, 5120]1280 hidden-x_layer_out: [2, 1920]h_post: [2, 4], f32x_res: [2, 7680]1920 hidden-x_layer_out: [4, 2560]h_post: [4, 4], f32x_res: [4, 10240]2560
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
hidden- | bf16 | 0.98× | 0.00144 | torch-compiletorch-ref | 0.00141 0.0107 | 0.00711 | 0% | lat |
hidden- | bf16 | 1.00× | 0.0015 | torch-compiletorch-ref | 0.0015 0.0111 | 0.0204 | 1% | lat |
hidden- | bf16 | 0.98× | 0.00166 | torch-compiletorch-ref | 0.00163 0.0115 | 0.0492 | 2% | lat |
Engram¶
EngramGateConvFwd¶
H, k, v: [M, seq_len, d]rms_w_h, rms_w_v: [d]conv_w: [4, d]
train-H, k, v: [1, 32, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]dtype=f16s32 train-H, k, v: [2, 64, 512]rms_w_h, rms_w_v: [512]conv_w: [4, 512]dtype=f16s64 train-H, k, v: [1, 128, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]dtype=bf16s128 train-H, k, v: [3, 96, 768]rms_w_h, rms_w_v: [768]conv_w: [4, 768]dtype=bf16s96
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
train- | f16 | 2.54× | 0.00442 | torch-compiletorch-ref | 0.0112 0.0748 | 0.0532 | 0% | lat |
train- | f16 | 2.14× | 0.00512 | torch-compiletorch-ref | 0.0110 0.0859 | 0.369 | 3% | lat |
train- | bf16 | 2.81× | 0.00454 | torch-compiletorch-ref | 0.0128 0.0804 | 0.209 | 2% | lat |
train- | bf16 | 2.15× | 0.0072 | torch-compiletorch-ref | 0.0155 0.1004 | 0.888 | 7% | lat |
EngramGateConvBwd¶
dY, H, k, v, vhat: [M, seq_len, d]rms_w_h, rms_w_v: [d]conv_w: [4, d]alpha, rrms_h, rrms_k, rrms_v: [M, seq_len], f32
train-dY, H, k, v, vhat: [1, 32, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]alpha, rrms_h, rrms_k, rrms_v: [1, 32], f32dtype=f16s32 train-dY, H, k, v, vhat: [2, 64, 512]rms_w_h, rms_w_v: [512]conv_w: [4, 512]alpha, rrms_h, rrms_k, rrms_v: [2, 64], f32dtype=f16s64 train-dY, H, k, v, vhat: [1, 128, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]alpha, rrms_h, rrms_k, rrms_v: [1, 128], f32dtype=bf16s128 train-dY, H, k, v, vhat: [3, 96, 768]rms_w_h, rms_w_v: [768]conv_w: [4, 768]alpha, rrms_h, rrms_k, rrms_v: [3, 96], f32dtype=bf16s96
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
train- | f16 | 18.60× | 0.00906 | torch | 0.1684 | 0.0614 | 0% | lat |
train- | f16 | 10.10× | 0.0199 | torch | 0.2011 | 0.225 | 1% | lat |
train- | bf16 | 11.91× | 0.0155 | torch | 0.1845 | 0.145 | 1% | lat |
train- | bf16 | 2.36× | 0.1051 | torch | 0.2477 | 0.145 | 1% | mem |
EngramDecodeFwd¶
e_t: [batch, d_mem]h_t: [batch, d]conv_state: [batch, L, d]W_K, W_V: [d_mem, d]rms_w_h, rms_w_v: [d]conv_w: [conv_kernel_size, d]
serving-e_t: [1, 512]h_t: [1, 256]conv_state: [1, 12, 256]W_K, W_V: [512, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]max_conv_len=12dilation=3dtype=f16b1 serving-e_t: [4, 1024]h_t, conv_w: [4, 512]conv_state: [4, 20, 512]W_K, W_V: [1024, 512]rms_w_h, rms_w_v: [512]max_conv_len=20dilation=5dtype=f16b4 serving-e_t: [8, 512]h_t: [8, 256]conv_state: [8, 18, 256]W_K, W_V: [512, 256]rms_w_h, rms_w_v: [256]conv_w: [4, 256]max_conv_len=18dilation=3dtype=bf16b8
| Workload | dtype | Ratio | Device time | Alternatives | Throughput | SOL | Bound | |
|---|---|---|---|---|---|---|---|---|
| alt / ours | ms | name | ms | TFLOP/s | of ceiling | by | ||
serving- | f16 | 1.88× | 0.0071 | torch-compiletorch-ref | 0.0133 0.0949 | 0.0747 | 2% | lat |
serving- | f16 | 2.68× | 0.0096 | torch-compiletorch-ref | 0.0257 0.1221 | 0.879 | 5% | lat |
serving- | bf16 | 3.29× | 0.00653 | torch-compiletorch-ref | 0.0215 0.1120 | 0.65 | 2% | lat |