Skip to content

Conversation

@amd-meskelin
Copy link
Contributor

Proposed changes [WIP]

BatchedContractionKernel implements a custom RunGemm that can be called with tensor descriptors, unlike UniversalGemmKernel::RunGemm which computes tensor views directly from the given stride parameters.

This adds UniversalGemmKernel::RunGemmDesc which takes in descriptors and thus replaces the custom implementation in BatchedContractionKernel. It also has a (partial) POC to implement the original UniversalGemmKernel::RunGemm using the descriptor version, see discussion below.

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.

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally
  • I have added the test to REGRESSION_TESTS list defined at the top of CMakeLists.txt in tests/CMakeLists.txt, IF the test takes more than 30 seconds to run.
  • I have added inline documentation which enables the maintainers with understanding the motivation
  • I have removed the stale documentation which is no longer relevant after this pull request
  • (If this change is user-facing) I have added release notes which provide the end users with a brief summary of the improvement from this pull request
  • I have run clang-format on all changed files
  • Any dependent changes have been merged

Discussion

UniversalGemmKernel::RunGemm generates tensor views directly from the given parameters through MakeGemmTensorViews, rather then sepaately building the descriptors and then generating views. In order to refactor the rest of the code path to RunGemmDesc (which would make it simple to have both entry points available), MakeGemmTensorView would need to be refactored to separately build the descriptors and views.

OTOH, GroupedConvolutionKernel already has a similar MakeGemmTensorView which takes in descriptors as does RunGemm, with no version that expects to construct these internally. Should UniversalGemmKernel follow suite? Alternately, could we expect the caller to construct & pass in the tensor views directly, instead of just the descriptors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants