-
Notifications
You must be signed in to change notification settings - Fork 271
Composable kernels integration & Small Fix in GEMM Solver #1692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 70 commits
8e19f16
28c25bb
8d266d9
cd639ef
6c95f9b
155daeb
37c2358
d30dab7
886154e
34cae74
57f4af7
17c232e
c9a617b
35cfc5b
d54cf7e
ba0903e
d34e389
93dcda1
f0713e4
eb50868
9ce28a2
7d30adb
bbd9bb5
7d38d69
6ca8953
32a7007
da89207
5a23aa0
ca5ed56
adcbeb7
cfafefa
9ed4674
f15ca3b
e1495e4
1346b08
741232f
8091135
2a53986
030cfea
844265f
e4545a4
b6141cd
da11e7d
9b26dfe
17158b1
f62c96e
fcd6bcc
e24eb8d
10a873c
7af0c92
57d3ec1
f48116f
1438038
a42fdb9
ffeebee
8e3d9d0
9e0930a
7b5e73d
1200006
b3c1ac8
d89c08f
50dbe04
244f0f1
47b45af
6515f90
06bea4b
1392542
949704b
c76adbb
a52fb74
827d276
28af26f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM ubuntu:18.04 | ||
| FROM ubuntu:18.04 as miopen | ||
|
|
||
| ARG USE_MLIR="OFF" | ||
|
|
||
|
|
@@ -8,7 +8,8 @@ RUN dpkg --add-architecture i386 | |
| # Add rocm repository | ||
| # Note: The ROCm version with $USE_MLIR should keep in sync with default ROCm version | ||
| # unless MLIR library is incompatible with current ROCm. | ||
|
|
||
| RUN apt-get update | ||
| RUN apt-get install -y wget gnupg | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related to cmake |
||
| RUN if [ "$USE_MLIR" = "ON" ] ; \ | ||
| then export ROCM_APT_VER=.apt_5.1;\ | ||
| else \ | ||
|
|
@@ -17,6 +18,8 @@ RUN if [ "$USE_MLIR" = "ON" ] ; \ | |
| echo $ROCM_APT_VER &&\ | ||
| sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/$ROCM_APT_VER/ ubuntu main > /etc/apt/sources.list.d/rocm.list' | ||
| RUN sh -c "echo deb http://mirrors.kernel.org/ubuntu bionic main universe | tee -a /etc/apt/sources.list" | ||
| RUN wget --no-check-certificate -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - | ||
| RUN sh -c "echo deb https://apt.kitware.com/ubuntu/ bionic main | tee -a /etc/apt/sources.list" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related to cmake |
||
|
|
||
| #Add gpg keys | ||
| # Install dependencies | ||
|
|
@@ -33,7 +36,8 @@ wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - && \ | |
| apt-get update && \ | ||
| DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \ | ||
| build-essential \ | ||
| cmake \ | ||
| cmake-data=3.15.1-0kitware1 \ | ||
| cmake=3.15.1-0kitware1 \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be deleted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JehandadKhan I thought these lines are needed since base OS is Ubuntu 18.04 and we need more up-to-date cmake? Could you confirm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, these are part of the rbuild process, but since we could not build CK there due to CK's dependence on hipcc, I had to add them here as well. In light of your update in CK I propose we merge this PR as is and then fix the dependency issues in a separate PR. |
||
| comgr \ | ||
| clang-format-10 \ | ||
| doxygen \ | ||
|
|
@@ -128,4 +132,11 @@ RUN if [ "$USE_TARGETID" = "ON" ] ; then export HIPCC_LINK_FLAGS_APPEND='-O3 -pa | |
| ARG MIOTENSILE_VER="default" | ||
| RUN if [ "$USE_TARGETID" = "OFF" ] ; then echo "MIOpenTensile is not installed."; elif [ "$MIOTENSILE_VER" = "latest" ] ; then cget -p $PREFIX install ROCmSoftwarePlatform/MIOpenTensile@94a9047741d16a8eccd290131b78fb1aa69cdcdf; else cget -p $PREFIX install ROCmSoftwarePlatform/MIOpenTensile@94a9047741d16a8eccd290131b78fb1aa69cdcdf; fi | ||
|
|
||
| RUN groupadd -f render | ||
| ARG CK_COMMIT=91d8b7d67ae9dbf8a6e691ea3e17c0b9705c6ba7 | ||
| RUN wget -O ck.tar.gz https://www.github.com/rocmsoftwareplatform/composable_kernel/archive/${CK_COMMIT}.tar.gz && \ | ||
| tar zxvf ck.tar.gz &&\ | ||
| cd composable_kernel-${CK_COMMIT} && \ | ||
| mkdir build && cd build && \ | ||
| CXX=/opt/rocm/bin/hipcc cmake -DCMAKE_CXX_COMPILER_LAUNCHER="${COMPILER_LAUNCHER}" -DCMAKE_PREFIX_PATH=/opt/rocm -D CMAKE_CXX_FLAGS=" --offload-arch=gfx900 --offload-arch=gfx906 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 -O3 " .. && \ | ||
| make -j $(nproc) install | ||
| RUN groupadd -f render | ||
junliume marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4108,6 +4108,59 @@ struct ConvAsmImplicitGemmGTCDynamicFwdDlopsNCHWC final | |
| const PerformanceConfigAsmImplicitGemmGTCFwdDlopsNCHWC& config) const override; | ||
| }; | ||
|
|
||
| struct PerformanceConfigHipImplicitGemmFwdXdlops | ||
| : PerfConfigBase<PerformanceConfigHipImplicitGemmFwdXdlops> | ||
| { | ||
| int index; | ||
| std::string kernel_id; | ||
| int total_size; | ||
| PerformanceConfigHipImplicitGemmFwdXdlops(int idx, std::string kernl_id) | ||
| : index(idx), kernel_id(kernl_id), total_size(-1) | ||
| { | ||
| } | ||
| PerformanceConfigHipImplicitGemmFwdXdlops() : PerformanceConfigHipImplicitGemmFwdXdlops(0, "") | ||
| { | ||
| } | ||
| PerformanceConfigHipImplicitGemmFwdXdlops(bool) | ||
| : PerformanceConfigHipImplicitGemmFwdXdlops(0, "") | ||
| { | ||
| } | ||
| void HeuristicInit(const ConvolutionContext& ctx); | ||
| bool SetNextValue(const ConvolutionContext& ctx); | ||
| bool IsValidValue() const; | ||
| bool IsValid(const ConvolutionContext& ctx) const; | ||
| template <typename Self, typename F> | ||
| static void Visit(Self&& s, F f) | ||
| { | ||
| f(s.kernel_id, "kernel_id"); | ||
| } | ||
| bool operator==(const PerformanceConfigHipImplicitGemmFwdXdlops& other) const; | ||
| }; | ||
|
|
||
| struct ConvHipImplicitGemmFwdXdlops final | ||
| : ConvTunableSolver<PerformanceConfigHipImplicitGemmFwdXdlops> | ||
| { | ||
| const std::string& SolverDbId() const override | ||
| { | ||
| return GetSolverDbId<ConvHipImplicitGemmFwdXdlops>(); | ||
| } | ||
|
|
||
| PerformanceConfigHipImplicitGemmFwdXdlops | ||
| GetDefaultPerformanceConfig(const ConvolutionContext&) const override; | ||
| bool IsValidPerformanceConfig(const ConvolutionContext&, | ||
| const PerformanceConfigHipImplicitGemmFwdXdlops&) const override; | ||
| PerformanceConfigHipImplicitGemmFwdXdlops | ||
| Search(const ConvolutionContext&, const AnyInvokeParams& invoke_ctx) const override; | ||
| size_t GetWorkspaceSize(const ConvolutionContext& ctx) const override; | ||
| bool MayNeedWorkspace() const override { return false; } | ||
| bool IsApplicable(const ConvolutionContext& ctx) const override; | ||
| bool IsDynamic() const override { return true; } | ||
| ConvSolution | ||
| GetSolution(const ConvolutionContext& ctx, | ||
| const PerformanceConfigHipImplicitGemmFwdXdlops& config) const override; | ||
| float GetWti(const ConvolutionContext&) const override { return 0.01f; }; | ||
|
||
| }; | ||
|
|
||
| struct AnySolver; | ||
|
|
||
| } // namespace solver | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good!