Skip to content
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

MV-473: [MV-MIOpen] Benchmark & Port Interpolate #41

Closed
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ The MIOpen API library is structured as follows:
* :doc:`GroupNorm <../doxygen/html/group__groupnorm>` (experimental)
* :doc:`Cat <../doxygen/html/group__cat>` (experimental)
* :doc:`Argmax<./argmax>` (experimental)
* :doc:`Interpolate <../doxygen/html/group__interpolate>` (experimental)
1 change: 1 addition & 0 deletions driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ add_executable(MIOpenDriver
dm_fusion.cpp
dm_gemm.cpp
dm_groupnorm.cpp
dm_interpolate.cpp
dm_layernorm.cpp
dm_lrn.cpp
dm_pool.cpp
Expand Down
40 changes: 40 additions & 0 deletions driver/dm_interpolate.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*******************************************************************************
*
* MIT License
*
* Copyright (c) 2024 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*******************************************************************************/
#include "registry_driver_maker.hpp"
#include "interpolate_driver.hpp"

static Driver* makeDriver(const std::string& base_arg)
{
if(base_arg == "interpolate")
return new InterpolateDriver<float, float>();
if(base_arg == "interpolatefp16")
return new InterpolateDriver<float16, float>();
if(base_arg == "interpolatebfp16")
return new InterpolateDriver<bfloat16, float>();
return nullptr;
}

REGISTER_DRIVER_MAKER(makeDriver);
5 changes: 3 additions & 2 deletions driver/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ inline void PadBufferSize(size_t& sz, int datatype_sz)
"pool[fp16], lrn[fp16], "
"activ[fp16], softmax[fp16], bnorm[fp16], rnn[fp16], gemm[fp16], ctc, dropout[fp16], "
"tensorop[fp16], reduce[fp16|fp64], layernorm[bfp16|fp16], sum[bfp16|fp16], "
"argmax[bfp16|fp16], groupnorm[bfp16|fp16], cat[bfp16|fp16]\n");
"argmax[bfp16|fp16], groupnorm[bfp16|fp16], cat[bfp16|fp16], interpolate[bfp16|fp16]\n");
exit(0); // NOLINT (concurrency-mt-unsafe)
}

Expand All @@ -176,7 +176,8 @@ inline std::string ParseBaseArg(int argc, char* argv[])
arg != "layernormfp16" && arg != "layernormbfp16" && arg != "sum" && arg != "sumfp16" &&
arg != "sumbfp16" && arg != "argmax" && arg != "argmaxfp16" && arg != "argmaxbfp16" &&
arg != "groupnorm" && arg != "groupnormfp16" && arg != "groupnormbfp16" && arg != "cat" &&
arg != "catfp16" && arg != "catbfp16" && arg != "--version")
arg != "catfp16" && arg != "catbfp16" && arg != "interpolate" && arg != "interpolatefp16" &&
arg != "interpolatebfp16" && arg != "--version")
{
printf("FAILED: Invalid Base Input Argument\n");
Usage();
Expand Down
Loading