Skip to content

Commit c58488b

Browse files
atamazovDaniel Lowell
and
Daniel Lowell
committed
[gfx8] Enable assembly kernels (#2334)
* asm-gfx8-enable(01) Enable gfx8 asm kernels. * asm-gfx8-enable(02) Enable gfx8 for 3x3 Fwd/Bwd and 3x3 WrW. Co-authored-by: Daniel Lowell <daniel.lowell@amd.com>
1 parent bc599f7 commit c58488b

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

src/mlo_dir_conv.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,4 @@ void miopen::ConvolutionContext::DetectRocm()
462462
use_binaries = !miopen::IsDisabled(MIOPEN_DEBUG_AMD_ROCM_PRECOMPILED_BINARIES{});
463463
#endif
464464
}
465-
466-
if(StartsWith(GetStream().GetDeviceName(), "gfx8"))
467-
{
468-
use_asm_kernels = false;
469-
use_binaries = false;
470-
}
471465
}

src/solver/conv_asm_3x3u.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,9 @@ bool ConvAsm3x3U::IsApplicable(const ConvolutionContext& params) const
186186
return false;
187187
if(!params.rmv.IsV2orV3())
188188
return false;
189-
190189
const std::string name = params.GetStream().GetDeviceName();
191-
if(name.find("gfx9") == std::string::npos)
192-
{
190+
if(!(StartsWith(name, "gfx8") || StartsWith(name, "gfx9")))
193191
return false;
194-
}
195192
assert(params.weights_layout.length() == 0); // FIXME _weights_layout is not supported yet.
196193
// clang-format off
197194
return params.pad_w == 1

src/solver/conv_asm_dir_BwdWrW3x3.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,9 @@ bool ConvAsmBwdWrW3x3::IsApplicable(const ConvolutionContext& params) const
344344
return false;
345345
if(!params.rmv.IsV2orV3())
346346
return false;
347-
348347
const std::string name = params.GetStream().GetDeviceName();
349-
if(name.find("gfx9") == std::string::npos)
350-
{
348+
if(!(StartsWith(name, "gfx8") || StartsWith(name, "gfx9")))
351349
return false;
352-
}
353350
assert(params.weights_layout.length() == 0); // _weights_layout is not supported yet
354351
// clang-format off
355352
bool ok = params.pad_w == 1 // -q pad_w
@@ -364,16 +361,12 @@ bool ConvAsmBwdWrW3x3::IsApplicable(const ConvolutionContext& params) const
364361
&& (params.IsFp32() || params.IsFp16())
365362
&& params.in_layout == "NCHW";
366363
if(!ok)
367-
{
368364
return false; // Early exit to speed up the check.
369-
}
370365

371366
if(params.IsFp16()
372-
&& (name.find("gfx8") != std::string::npos // Not supported.
367+
&& (StartsWith(name, "gfx8") // Not supported.
373368
|| params.batch_sz % 2 != 0)) /// \todo Initial version.
374-
{
375369
return false;
376-
}
377370

378371
// Check limits:
379372
const auto h_w = static_cast<long>(params.out_height) * params.out_width;
@@ -401,7 +394,6 @@ bool ConvAsmBwdWrW3x3::IsApplicable(const ConvolutionContext& params) const
401394
&& n_c_h_w < std::pow(2, 29)
402395
&& n_k_h_w < std::pow(2, 29)
403396
&& c_k_r_s < std::pow(2, 29); // clang-format on
404-
405397
return ok;
406398
}
407399

0 commit comments

Comments
 (0)