Improve GEMM kernel parsing#805
Open
kyle-hoffmeyer wants to merge 15 commits into
Open
Conversation
kyle-hoffmeyer
marked this pull request as ready for review
July 10, 2026 22:39
Collaborator
|
Looks good - fix the failing test and I will approve |
gabeweisz
approved these changes
Jul 13, 2026
Collaborator
|
@kyle-hoffmeyer are you sure of all the patterns here? Can we include the sources? |
gabeweisz
approved these changes
Jul 21, 2026
Collaborator
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: Reference reports regenerated. Difference in reference reports is due to addition of new fields in
param_detailsin perf reports. Change inparam: transposecolumn also affected the rows that are matched viacompare_perf_report.Summary
Extends kernel name parsing to extract tile sizes (
mt_m,mt_n,mt_k) and transpose flags from GEMM GPU kernel names across all major kernel libraries observed in MI300 and H100 traces. Previously only Tensile and nvjet kernels were parsed. Tile info is now surfaced inparam_detailsalongside the existing transpose field.Changes
General
Added six new parser pairs covering all GEMM kernel libraries observed in traces:
Cijk_*is_tensile_gemm(renamed)MT(\d+)x(\d+)x(\d+)Alik/Ailk,Bljk/BjlkCijk_Alik_Bljk_..._MT64x32x256_MI16x16x1_...is_triton_gemmBLOCK_SIZE_[MNK]_(\d+)_gemm_a8w8_blockscale_kernel_..._BLOCK_SIZE_M_128_BLOCK_SIZE_N_128_BLOCK_SIZE_K_128_...is_ck_gemmRowMajor=not transposed,ColumnMajor=transposedGRIDWISE_CONFIGinparse_ck_gemmis_igemmbt(\d+)x(\d+)x(\d+)fwd/bwd/wrwencodes the pass, not matrix transposeigemm_fwd_gtcx3_nhwc_bf16_bx0_ex1_bt128x128x32_wt32x32x8_...is_cublas_xmma_gemmtilesize(\d+)x(\d+)x(\d+)_([tn])([tn])_sm90_xmma_gemm_bf16bf16_bf16f32_f32_tn_n_tilesize128x128x64_warpgroupsize1x1x1_..._cublasis_cutlass_gemm(\d+)x(\d+)_(\d+)x(\d+)or(\d+)x(\d+)x(\d+)_([tn]{2})_void cutlass::Kernel2<cutlass_80_tensorop_bf16_s16816gemm_bf16_256x128_64x3_tn_align2>(...)is_nvjet_gemm(renamed)nvjet_\w+_(\d+)x(\d+)_(\d+)x\d+T/Nper position (A, B, C)nvjet_tst_144x128_64x6_2x1_v_bz_bias_TNNAlso renamed
is_rocm_gemm→is_tensile_gemm,parse_rocm_gemm→parse_tensile_gemm,is_cuda_gemm→is_nvjet_gemm,parse_cuda_gemm→parse_nvjet_gemmfor clarity.Transpose is not in Triton kernel names — layout is fixed by the kernel function (e.g.,
a8w8_blockscaleis always activations × weights = row × column) and compiled into the JIT binary rather than parameterized in the name. For iGEMM, the concept of transpose doesn't apply — these are always NHWC convolution kernels wherefwd/bwd/wrwindicates the convolution pass direction, not matrix orientation.CK Kernels
The profiler records CK kernels in two forms: demangled names are human-readable C++ (e.g.,
void ck::kernel_gemm_xdl_cshuffle_v3<ck::GridwiseGemmMultiD_ABScale_xdl_cshuffle_v3<...>>), produced when the profiler resolves symbol names; mangled names are the raw encoded form the C++ compiler emits (e.g.,_ZN2ck16tensor_operation6device...), where integers appear asELi128Erather than128.Using python package
itanium-demangler, the mangled kernel name can be demangled and parsed in the same way demangled kernels are parsed.TraceLens/PerfModel/kernel_name_parser.pyExtended kernel parsing logic to cover different libraries
TraceLens/PerfModel/perf_model.pymt_m,mt_n,mt_k, andtransposeis now surfaced inparam_detailsfor all parsed kernel libraries. Fields default to"Unknown"if the kernel name doesn't match any parser or the field is not extractable for that library.The K-tile field was previously named
depth_u, which was Tensile specific. It has been renamed tomt_kto be consistent withmt_m/mt_n.tests/test_kernel_name_parser.py(new)Integration tests using verbatim kernel names extracted from trace files.
5 tests per library (35 total).