Repository navigation
feat(rocblas): Kernel Selection trace logging option - #8070
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #8070 +/- ##
===========================================
- Coverage 77.26% 77.25% -0.00%
===========================================
Files 2892 2892
Lines 485320 485624 +304
Branches 73315 73351 +36
===========================================
+ Hits 374940 375153 +213
- Misses 85629 85714 +85
- Partials 24751 24757 +6
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
|
Lots to discuss to that we can go into during meeting tomorrow |
|
This pull request has been inactive for 25 days and will be marked as stale. If you would like to keep this PR open, please:
This PR will be automatically closed in 5 days if no further activity occurs. |
@TorreZuk I've pushed the changes we had discussed a few weeks ago: the kernel ID is not printed as a comment to the reproducible command line log anymore, and I've minimized the amount of code executed in the "regular" path (no trace logging enabled). |
|
This pull request has been inactive for 25 days and will be marked as stale. If you would like to keep this PR open, please:
This PR will be automatically closed in 5 days if no further activity occurs. |
TorreZuk
left a comment
There was a problem hiding this comment.
If tests pass looks good.
Added some optional things to consider.
TheRock Submodule Bump ActivityNewest first
|
Motivation
When a Level 3 call (trsm, trmm, syrk, ...) is decomposed into multiple GEMM sub-problems, there was no easy way to see which kernel ran for each one or to reproduce it in isolation. TENSILE_DB output doesn't cover hipBLASLt and doesn't map back to a benchmarkable command.
This PR adds
ROCBLAS_LAYER=0x10(rocblas_layer_mode_log_kernel_select), which writes one rocblas-bench-replayable line per internal GEMM sub-problem that launches a kernel.ISSUE ID : AIROCBLAS-1288
Technical Details
rocblas_layer_mode_log_kernel_select = 0x10inrocblas-types.h. Output goes to the trace stream (ROCBLAS_LOG_TRACE_PATH).#comment:gemm_ex,gemm_batched_ex, orgemm_strided_batched_ex, matching the sub-problem layout. Strides are emitted only for strided-batched,--batch_countonly for batched forms, and--api 1when a dimension exceeds 32 bits.source=:hipblaslt,tensile,source(rocBLAS source kernels), orgemv(m == 1 or n == 1 GEMM run as GEMV).kernel=: the Tensile solution name or the source/GEMV launcher. Not reported for hipBLASLt.fallback_from=: the backends that rejected the sub-problem first, e.g.hipblaslt,hipblaslt,tensile, ornone.parent_api=: the user-facing API, set by an RAII scope in each_impl.tensile_host.cpp), gemm and gemm_ex source fallback and scale path (gemm_templates.cpp,rocblas_gemm_ex_kernels_64.cpp), the 64-bit large-dimension source path (rocblas_gemm_kernels_64.cpp), and GEMV-in-GEMM (rocblas_gemm_ex.hpp).rocblas_gemm_flags_check_solution_index, since no kernel launches.rocblas_internal_log_kernel_select()inlogging.cpp, from arocblas_kernel_select_problemdescription.parent_apiis set for gemm, hemm, herk, her2k, herkx, symm, syrk, syr2k, syrkx, trmm, trsm, trtri (all batched forms), gemm_ex variants, gemmt, syrk_ex, herk_ex, gemm_grouped_batched, and gemm_grouped_batched_ex.docs/how-to/logging-in-rocblas.rst,docs/data/reference/logging-env.rst. CHANGELOG entry under 5.8.0.How to use it
Turn it on:
You can combine it with other logging bits. For example, ROCBLAS_LAYER=0x18 adds internal backend logging (0x8) to the same file.
Each GEMM that runs produces one line:
Reproduce one GEMM on its own by copying everything before the
#and run it from the directory that contains rocblas-bench.Useful one-liners:
Known limitations
Test Plan
logging_mode_gtestgains sevenlogging_kernel_select_*cases (categoryquick; harness inclients/include/testing_kernel_select.hpp):parent_api=rocblas_strsmsolution_index -2) reportssource=sourcesolution_index -9) reportssource=gemvCijk_kernelcheck_solution_indexlogs nothingTest Result
logging_mode_gtest.logging_mode_gtest.Submission Checklist