Bank Conflict Visualizer (gau-nernst.github.io)

🤖 AI Summary
Bank Conflict Visualizer maps logical matrix indices to physical banked memory locations so you can spot and fix shared-memory bank conflicts for BF16/FP16 (2-byte elements) and other element sizes. The tool exposes hardware and tiling parameters (num_banks, bank_size, BLOCK_M, BLOCK_N, elem_size, group_height, group_width) so you can write and test custom "swizzle" functions that permute indices before physical addressing. The provided example computes elems_full_banks = (num_banks * bank_size) / elem_size, derives how many rows fit per full-bank stripe, and then builds an XOR-based pattern to remap column index n while keeping row m intact. That XOR swizzle spreads accesses across banks by computing xor_pattern = floor(m / rows_full_banks) % (height_full_banks / rows_full_banks) and setting new_n = n ^ (xor_pattern * group_width). Practically, this staggers columns between different bank stripes as m increases, reducing hot spots in blocked GEMM-like kernels (BLOCK_M × BLOCK_N tiles) and improving throughput. For practitioners, the visualizer makes it easy to iterate on remapping strategies, validate that a swizzle eliminates conflicts across group dimensions, and directly measure the impact of elem_size, bank geometry, and tiling choices on shared-memory performance.
Loading comments...
loading comments...