Simplify kernel argument of device operator Device(Batched)GemmXdl<>#723
Merged
zjing14 merged 86 commits intoJun 1, 2023
Merged
Conversation
Contributor
Author
…ature/simplify-karg-for-device-gemm-xdl-improved
…ature/simplify-karg-for-device-gemm-xdl-improved
…simplify-karg-for-device-gemm-xdl-improved
Contributor
Author
|
I Just fixed the CI server test failure issue in #696 |
…ature/simplify-karg-for-device-gemm-xdl-improved
…ature/simplify-karg-for-device-gemm-xdl-improved
zjing14
approved these changes
Jun 1, 2023
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.
I had tried to reduce kernel arguments for following device operators
DeviceGemmXdl<>(create descriptors on device side)DeviceBatchedGemmXdl<>(create descriptors on device side)DeviceConv2dFwdXdl_Input_N_Hi_Wi_C_Weight_K_Y_X_C_Output_N_Ho_Wo_K<>DeviceConv2dBwdDataXdl_Input_N_Hi_Wi_C_Weight_K_Y_X_C_Output_N_Ho_Wo_K<>DeviceConvNdBwdDataNwcKxcNwk_Xdl<>In general, the stateless elementwise operation object &
Block2CTileMapare totally redundant parameters for kernels. Thus we can remove them safely in most of the device operators. I only tried to updateGridwiseGemm_k0mk1_k0nk1_mn_xdlops_v2r3<>related device operators for now.To achieve better code reusability, I had decoupled the dependency between
BlockToCTileMap_M00_N0_M01Adapt<>and its third type argument:CGridDesc_M_N. Which means we no-longer need to passCGridDesc_M_Nin order to create tile mapping objects.I also splitted the
GridwiseGemm_k0mk1_k0nk1_mn_xdlops_v2r3<>template into 2 templates (also corresponding entry kernels). They are dedicated for different type of device operators.GridwiseGemm_k0mk1_k0nk1_mn_xdlops_v2r3<>: For Convolution device operators. No default descriptor creators. Users have to create descriptors by their own.GridwiseGemm_k0mk1_k0nk1_mn_xdlops_v2r3_ext<>: For GEMM device operators. Has default descriptor creators for A/B/C matrics. Users have to provide extraA/B/CLayoutandGemmSpecializationtemplate arguments.I found that we may make code more unmanageable if moving descriptor creation logics into device functions. I had done this for
DeviceConvNdBwdDataNwcKxcNwk_Xdl<>on branchfeature/simplify-karg-for-device-gemm-xdl. But the code is hard to read (theArgumentclass becomes tediously long) and exists unknown correctness issue since revision: d4efc6a (I think it will take more time to troubleshoot).This patch requires changes from following pull requests: