MIOpen icon indicating copy to clipboard operation
MIOpen copied to clipboard

Use CandidateSelectionModel heuristic for conv_hip_implicit_gemm_3d_grouped_*_xdlops solvers

Open amd-bartgips opened this issue 5 months ago • 0 comments

Proposed changes

With this PR MIOpen should be able to use heuristics for the three conv_hip_implicit_gemm_3d_grouped_*_xdlops. I have made bunch of changes to how the metadata is structured, we are able to robustly map kernel config strings that MIOpen generates from CK to vectors that can be used as input to the fdeep model.

I have added gtest functions for all the new stuff.

I continued with the structure set up before:

  • ai_heuristics.cpp contains all the code already there beforehand, plust the fdeep code, since fdeep can only be imported in a single file
  • ai_candidate_selection contains the actual "model" and "metadata" classes that do the computation using floating point vectors. This his been somewhat updated to make the translation from "input" (=fdbkey) and "output" (=kernel configs) more robust
  • ai_conv_3d_kernel_tuning_utils contains the machinery one level higher. That is, how to convert kernel configs and fdb_key input to float vectors and how to fetch and call the relevant CandidateSelectionModel. This is shared for all three solvers, so it made sense to centralise it.
  • kernels/gfx942.... model and metadatafiles. Perhaps these should gitlfs, but I suggest we worry about that when we make the final PR in the monorepo
  • solver/conv/...cpp solver_specific files, they ultimately contain the solver-specific machinery. In this case our 3 solvers rely heavily on ai_conv_3d_kernel_tuning_utils and through that on ai_candidate_selection
  • gtest files: should speak for themselves, please have a look
  • solvers.hpp a huuuuge header file that contains declarations for all solvers (i.e. for the solver/conv/...cpp files), so this needed to be altered as well

Checklist

Please put an x into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.

  • [x] I have added automated tests relevant to the introduced functionality
  • [x] I have sufficient test coverage for the changes, and code coverage hasn't decreased as a result of my PR
  • [x] I have ran the tests, and they are all passing locally
  • [ ] I have added relevant documentation for the changes
  • [ ] I have removed the stale documentation which is no longer relevant after this pull request
  • [x] I have ran make format & make check_format to ensure the changes have been formatted

amd-bartgips avatar Jul 31 '25 13:07 amd-bartgips