Model why FlashAttention is the kernel behind long-context Transformers — then run it: the
simulation executes on the ChipFoundryServices compute pool. Standard attention writes the full
S×S scores matrix to HBM, so its memory traffic grows quadratically with sequence
length — and softmax reads it back several times, leaving the tensor cores starved.
FlashAttention tiles Q, K and V into blocks that fit in on-chip SRAM and
runs an online softmax, so it never materializes that matrix: its HBM traffic is
linear in S (just Q, K, V and O), and the reduction naive / FA grows as
S / (2·head_dim). On the roofline, cutting the bytes lifts arithmetic
intensity above the machine balance, flipping attention from memory-bandwidth-bound to
compute-bound at the same FLOPs — the whole point. The tiles must fit in shared memory
(a block of B needs about 4·B·head_dim·bytes); too large a
block, head dim or precision overflows SRAM and cuts occupancy. The node returns the HBM traffic for
both kernels, the S×S matrix FlashAttention avoids, the arithmetic intensity, the
bottleneck and the wall-clock speed-up. Reduced-order educational model. See also the
quantization, KV-cache, HBM bandwidth,
systolic array, 3D-parallelism,
training-memory, power & thermal,
transistor I-V, thermal,
die-yield and lithography simulators and the
compute-pool status.
curl -X POST https://www.chipfoundryservices.com/edge/flashattention \
-H "Content-Type: application/json" \
-d '{"batch_size":8,"num_heads":32,"seq_length":32768,"head_dim":128,
"elem_bytes":2,"causal":1,"sram_kb":192,"block_size":128,
"hbm_bandwidth_gb_s":3350,"compute_tops":990}'
Returns JSON with outputs (format, achieved_block, max_block_sram, sram_needed_kb,
sram_used_kb, sram_budget_kb, sram_fit, q_blocks, kv_blocks, flops_gflop, scores_matrix_gb,
naive_hbm_gb, fa_hbm_gb, hbm_reduction_x, machine_balance_flop_byte, arithmetic_intensity_fa,
arithmetic_intensity_naive, fa_bottleneck, naive_bottleneck, naive_time_ms, fa_time_ms,
compute_time_ms, speedup_x, fa_tflops, fa_util_percent, verdict), the full profile
(48-point reduction_vs_seq HBM-reduction and speedup_vs_seq wall-clock-speedup
sweeps, plus ai_fa, ai_naive, machine_balance,
peak_tflops, hbm_bw_gb_s, hbm_reduction_x,
seq_length, speedup_x), the serving node, and
compute_ms. Endpoint aliases /edge/flash, /edge/flashattn,
/edge/fa, /edge/attn, /edge/sdpa.