|
Download docs/shape-distributions/README.md from humanfia-lab/inference-kernels: direct link, hf CLI and curl.
- Browser
- Download file 14.6 kB
-
https://huggingface.co/datasets/humanfia-lab/inference-kernels/resolve/main/docs/shape-distributions/README.md
- Command line
-
hf download hf://datasets/humanfia-lab/inference-kernels/docs/shape-distributions/README.md
-
curl -L -o README.md https://huggingface.co/datasets/humanfia-lab/inference-kernels/resolve/main/docs/shape-distributions/README.md
14.6 kB
| # Kernel shape distributions | |
| **21 kernels, 1104 captured workloads.** Each histogram counts the workload records in one kernel definition's JSONL file. Every bar is one exact combination of its runtime dimensions; identical shapes are combined. The labels retain all runtime dimensions, including dimensions that happen to have one observed value. Model constants appear above each plot. | |
| Read bar height (or length in horizontal plots) as the number of captured workloads with that shape. Bins are equally spaced categories, sorted by the dimension values, not continuous numeric intervals. A bar of 1 means one published example; a bar of 6 means six. These are capture counts, not request probabilities, runtime invocation frequencies, or AgentX traffic weights. | |
| Multi-dimensional shapes use horizontal bars to keep every dimension readable. Dimension names are explained below each plot; the linked definition specifies complete tensor layouts. | |
| Regenerate from the repository root with Python and Matplotlib (rendered with 3.11.2): | |
| ```bash | |
| python scripts/plot_shape_distributions.py | |
| ``` | |
| Only definition and workload metadata are needed; tensor snapshots and a GPU are unnecessary. | |
| | Kernel definition | Workloads | Distinct shapes | | |
| |---|---:|---:| | |
| | [prefix_cached_block_causal_h32_d128](#prefix_cached_block_causal_h32_d128) | 28 | 4 | | |
| | [prefix_cached_block_causal_h32_d128_prefix0](#prefix_cached_block_causal_h32_d128_prefix0) | 12 | 4 | | |
| | [noncausal_dense_attention_h32_d128](#noncausal_dense_attention_h32_d128) | 54 | 18 | | |
| | [noncausal_dense_attention_h32_d64](#noncausal_dense_attention_h32_d64) | 108 | 30 | | |
| | [gdn_decode_qk4_v8_d128_k_last](#gdn_decode_qk4_v8_d128_k_last) | 54 | 7 | | |
| | [gdn_prefill_qk4_v8_d128_k_last](#gdn_prefill_qk4_v8_d128_k_last) | 100 | 77 | | |
| | [dense_gemm_bf16_nt_n12288_k4096](#dense_gemm_bf16_nt_n12288_k4096) | 31 | 7 | | |
| | [dense_gemm_bf16_nt_n4096_k12288](#dense_gemm_bf16_nt_n4096_k12288) | 31 | 7 | | |
| | [dense_gemm_bf16_nt_n4096_k4096](#dense_gemm_bf16_nt_n4096_k4096) | 31 | 7 | | |
| | [grouped_gemm_fp8_fp4_e384_n4608_k5120_g32](#grouped_gemm_fp8_fp4_e384_n4608_k5120_g32) | 52 | 11 | | |
| | [grouped_gemm_fp8_fp4_e384_n5120_k2304_g32](#grouped_gemm_fp8_fp4_e384_n5120_k2304_g32) | 52 | 11 | | |
| | [mixed_mla_decode_deepseek41_h64_d512_k8128_k4512](#mixed_mla_decode_deepseek41_h64_d512_k8128_k4512) | 42 | 30 | | |
| | [moe_router_gemm_topk_deepseek41_d5120_e384_topk6](#moe_router_gemm_topk_deepseek41_d5120_e384_topk6) | 50 | 11 | | |
| | [neighborhood_attention_3d_h16_d64_kt3_ky7_kx7](#neighborhood_attention_3d_h16_d64_kt3_ky7_kx7) | 9 | 9 | | |
| | [neighborhood_attention_3d_h32_d64_kt3_ky7_kx7](#neighborhood_attention_3d_h32_d64_kt3_ky7_kx7) | 9 | 9 | | |
| | [neighborhood_attention_3d_h4_d64_kt11_ky11_kx11](#neighborhood_attention_3d_h4_d64_kt11_ky11_kx11) | 9 | 9 | | |
| | [neighborhood_attention_3d_h8_d64_kt3_ky5_kx5](#neighborhood_attention_3d_h8_d64_kt3_ky5_kx5) | 18 | 18 | | |
| | [qsa_index_topk_decode_qwen38_h4_d128_topk512_c4](#qsa_index_topk_decode_qwen38_h4_d128_topk512_c4) | 192 | 77 | | |
| | [qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4](#qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4) | 192 | 64 | | |
| | [sparse_mla_prefill_h64_d512_k128](#sparse_mla_prefill_h64_d512_k128) | 10 | 9 | | |
| | [sparse_mla_prefill_h64_d512_k640](#sparse_mla_prefill_h64_d512_k640) | 20 | 20 | | |
| ## prefix_cached_block_causal_h32_d128 | |
| [Definition](../../definitions/block_causal_attention/prefix_cached_block_causal_h32_d128.json) · [Workloads](../../workloads/block_causal_attention/prefix_cached_block_causal_h32_d128.jsonl) · [SVG](prefix_cached_block_causal_h32_d128.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `Nq`: Runtime current query/token count. `Np`: Runtime cached prefix length, possibly zero. `Nall`: Total prefix and current length. | |
| ## prefix_cached_block_causal_h32_d128_prefix0 | |
| [Definition](../../definitions/block_causal_attention/prefix_cached_block_causal_h32_d128_prefix0.json) · [Workloads](../../workloads/block_causal_attention/prefix_cached_block_causal_h32_d128_prefix0.jsonl) · [SVG](prefix_cached_block_causal_h32_d128_prefix0.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `Nq`: Runtime current query/token count. `Nall`: Total prefix and current length. | |
| ## noncausal_dense_attention_h32_d128 | |
| [Definition](../../definitions/dense_attention/noncausal_dense_attention_h32_d128.json) · [Workloads](../../workloads/dense_attention/noncausal_dense_attention_h32_d128.jsonl) · [SVG](noncausal_dense_attention_h32_d128.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `Nq`: Runtime query length. `Nk`: Runtime key/value length. | |
| ## noncausal_dense_attention_h32_d64 | |
| [Definition](../../definitions/dense_attention/noncausal_dense_attention_h32_d64.json) · [Workloads](../../workloads/dense_attention/noncausal_dense_attention_h32_d64.jsonl) · [SVG](noncausal_dense_attention_h32_d64.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `Nq`: Runtime query length. `Nk`: Runtime key/value length. | |
| ## gdn_decode_qk4_v8_d128_k_last | |
| [Definition](../../definitions/gdn/gdn_decode_qk4_v8_d128_k_last.json) · [Workloads](../../workloads/gdn/gdn_decode_qk4_v8_d128_k_last.jsonl) · [SVG](gdn_decode_qk4_v8_d128_k_last.svg) | |
|  | |
| **Runtime dimensions:** `batch_size`: Number of sequences being decoded concurrently. | |
| ## gdn_prefill_qk4_v8_d128_k_last | |
| [Definition](../../definitions/gdn/gdn_prefill_qk4_v8_d128_k_last.json) · [Workloads](../../workloads/gdn/gdn_prefill_qk4_v8_d128_k_last.jsonl) · [SVG](gdn_prefill_qk4_v8_d128_k_last.svg) | |
|  | |
| **Runtime dimensions:** `total_seq_len`: total_seq_len `num_seqs`: num_seqs `len_cu_seqlens`: Length of cu_seqlens array (num_seqs + 1). | |
| ## dense_gemm_bf16_nt_n12288_k4096 | |
| [Definition](../../definitions/gemm/dense_gemm_bf16_nt_n12288_k4096.json) · [Workloads](../../workloads/gemm/dense_gemm_bf16_nt_n12288_k4096.jsonl) · [SVG](dense_gemm_bf16_nt_n12288_k4096.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## dense_gemm_bf16_nt_n4096_k12288 | |
| [Definition](../../definitions/gemm/dense_gemm_bf16_nt_n4096_k12288.json) · [Workloads](../../workloads/gemm/dense_gemm_bf16_nt_n4096_k12288.jsonl) · [SVG](dense_gemm_bf16_nt_n4096_k12288.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## dense_gemm_bf16_nt_n4096_k4096 | |
| [Definition](../../definitions/gemm/dense_gemm_bf16_nt_n4096_k4096.json) · [Workloads](../../workloads/gemm/dense_gemm_bf16_nt_n4096_k4096.jsonl) · [SVG](dense_gemm_bf16_nt_n4096_k4096.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## grouped_gemm_fp8_fp4_e384_n4608_k5120_g32 | |
| [Definition](../../definitions/grouped_gemm/grouped_gemm_fp8_fp4_e384_n4608_k5120_g32.json) · [Workloads](../../workloads/grouped_gemm/grouped_gemm_fp8_fp4_e384_n4608_k5120_g32.jsonl) · [SVG](grouped_gemm_fp8_fp4_e384_n4608_k5120_g32.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## grouped_gemm_fp8_fp4_e384_n5120_k2304_g32 | |
| [Definition](../../definitions/grouped_gemm/grouped_gemm_fp8_fp4_e384_n5120_k2304_g32.json) · [Workloads](../../workloads/grouped_gemm/grouped_gemm_fp8_fp4_e384_n5120_k2304_g32.jsonl) · [SVG](grouped_gemm_fp8_fp4_e384_n5120_k2304_g32.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## mixed_mla_decode_deepseek41_h64_d512_k8128_k4512 | |
| [Definition](../../definitions/mixed_mla/mixed_mla_decode_deepseek41_h64_d512_k8128_k4512.json) · [Workloads](../../workloads/mixed_mla/mixed_mla_decode_deepseek41_h64_d512_k8128_k4512.jsonl) · [SVG](mixed_mla_decode_deepseek41_h64_d512_k8128_k4512.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `N8`: Allocated FP8 page count. `P8`: Backend FP8 page size. `N4`: Allocated FP4 page count. `P4`: Backend FP4 page size. | |
| ## moe_router_gemm_topk_deepseek41_d5120_e384_topk6 | |
| [Definition](../../definitions/moe_router/moe_router_gemm_topk_deepseek41_d5120_e384_topk6.json) · [Workloads](../../workloads/moe_router/moe_router_gemm_topk_deepseek41_d5120_e384_topk6.jsonl) · [SVG](moe_router_gemm_topk_deepseek41_d5120_e384_topk6.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. | |
| ## neighborhood_attention_3d_h16_d64_kt3_ky7_kx7 | |
| [Definition](../../definitions/neighborhood_attention/neighborhood_attention_3d_h16_d64_kt3_ky7_kx7.json) · [Workloads](../../workloads/neighborhood_attention/neighborhood_attention_3d_h16_d64_kt3_ky7_kx7.jsonl) · [SVG](neighborhood_attention_3d_h16_d64_kt3_ky7_kx7.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `T`: Runtime frame count. `Y`: Runtime grid height. `X`: Runtime grid width. | |
| ## neighborhood_attention_3d_h32_d64_kt3_ky7_kx7 | |
| [Definition](../../definitions/neighborhood_attention/neighborhood_attention_3d_h32_d64_kt3_ky7_kx7.json) · [Workloads](../../workloads/neighborhood_attention/neighborhood_attention_3d_h32_d64_kt3_ky7_kx7.jsonl) · [SVG](neighborhood_attention_3d_h32_d64_kt3_ky7_kx7.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `T`: Runtime frame count. `Y`: Runtime grid height. `X`: Runtime grid width. | |
| ## neighborhood_attention_3d_h4_d64_kt11_ky11_kx11 | |
| [Definition](../../definitions/neighborhood_attention/neighborhood_attention_3d_h4_d64_kt11_ky11_kx11.json) · [Workloads](../../workloads/neighborhood_attention/neighborhood_attention_3d_h4_d64_kt11_ky11_kx11.jsonl) · [SVG](neighborhood_attention_3d_h4_d64_kt11_ky11_kx11.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `T`: Runtime frame count. `Y`: Runtime grid height. `X`: Runtime grid width. | |
| ## neighborhood_attention_3d_h8_d64_kt3_ky5_kx5 | |
| [Definition](../../definitions/neighborhood_attention/neighborhood_attention_3d_h8_d64_kt3_ky5_kx5.json) · [Workloads](../../workloads/neighborhood_attention/neighborhood_attention_3d_h8_d64_kt3_ky5_kx5.jsonl) · [SVG](neighborhood_attention_3d_h8_d64_kt3_ky5_kx5.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `T`: Runtime frame count. `Y`: Runtime grid height. `X`: Runtime grid width. | |
| ## qsa_index_topk_decode_qwen38_h4_d128_topk512_c4 | |
| [Definition](../../definitions/qsa_index/qsa_index_topk_decode_qwen38_h4_d128_topk512_c4.json) · [Workloads](../../workloads/qsa_index/qsa_index_topk_decode_qwen38_h4_d128_topk512_c4.jsonl) · [SVG](qsa_index_topk_decode_qwen38_h4_d128_topk512_c4.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `NP`: Allocated compressed-key page count. `P`: Backend compressed-key page size, measured in micro-blocks. `MP`: Page-table capacity. | |
| ## qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4 | |
| [Definition](../../definitions/qsa_sparse_gqa/qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4.json) · [Workloads](../../workloads/qsa_sparse_gqa/qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4.jsonl) · [SVG](qsa_sparse_gqa_decode_qwen38_h24_kv2_d256_topk512_c4.svg) | |
|  | |
| **Runtime dimensions:** `B`: Runtime batch size. `NP`: Allocated cache page count. `P`: Backend token-cache page size. `MP`: Page-table capacity per sequence. | |
| ## sparse_mla_prefill_h64_d512_k128 | |
| [Definition](../../definitions/sparse_mla/sparse_mla_prefill_h64_d512_k128.json) · [Workloads](../../workloads/sparse_mla/sparse_mla_prefill_h64_d512_k128.jsonl) · [SVG](sparse_mla_prefill_h64_d512_k128.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. `Nkv`: Number of latent vectors in the engine workspace. | |
| ## sparse_mla_prefill_h64_d512_k640 | |
| [Definition](../../definitions/sparse_mla/sparse_mla_prefill_h64_d512_k640.json) · [Workloads](../../workloads/sparse_mla/sparse_mla_prefill_h64_d512_k640.jsonl) · [SVG](sparse_mla_prefill_h64_d512_k640.svg) | |
|  | |
| **Runtime dimensions:** `M`: Runtime number of token rows. `Nkv`: Number of latent vectors in the engine workspace. | |