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

Impl pad reflection #3183

Draft
wants to merge 31 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
255b4c3
Add Pad Reflection implementation and test
DuongQLee Apr 14, 2024
0f9d689
Merge remote-tracking branch 'origin/develop' into duongle/pad_reflec…
DuongQLee Apr 14, 2024
ef7e9a5
Change some define variable
DuongQLee Apr 14, 2024
c70a5ce
Change padding to std::vector<size_t>, update kernel new format, add …
DuongQLee Apr 15, 2024
49e7a46
add padreflection docs and update cmakelist to alphabetic ordering
DuongQLee Apr 15, 2024
00905ef
Fix some warning error
DuongQuyLe Apr 15, 2024
6f8afd0
githook indentation
DuongQuyLe Apr 15, 2024
508fabd
Code clean up
DuongQuyLe Apr 15, 2024
a4a249b
githook cleanup
DuongQuyLe Apr 15, 2024
a0ef46c
Change copyright 2023->2024, change padding from vector to pointer, a…
DuongQLee Apr 16, 2024
cd548ef
githook clean up
DuongQLee Apr 16, 2024
f21e7f5
remove maybe_unused for problem in PadReflection::IsApplicable and Pa…
DuongQLee Apr 16, 2024
825111e
githook cleanup
DuongQLee Apr 16, 2024
6f4e1a0
update miopen.h padreflection description
DuongQLee Apr 16, 2024
c4aedd1
update "CLOSEOUT padreflection DOXYGEN GROUP"
DuongQLee Apr 16, 2024
a805d42
Chang padding_l -> padding_left, padding_t -> padding_top for padrefl…
DuongQLee Apr 17, 2024
c916b1d
remove unused condition line in padreflection kernel
DuongQLee Apr 17, 2024
a008c17
remove unused line
DuongQLee Apr 17, 2024
c0eacdf
indent test_case
DuongQLee Apr 17, 2024
e41d851
Update padreflection group -> pad group for doxygen
DuongQLee Apr 19, 2024
b7d79ac
update docs index padreflection group -> pad group
DuongQLee Apr 19, 2024
826a085
Merge branch 'develop' into duongle/pad_reflection_wed_contiguous
DuongQLee Aug 6, 2024
2d32b06
githook format
DuongQLee Aug 6, 2024
b427a78
update driver and gtest format
DuongQLee Aug 6, 2024
3314ea2
add pad reflection to solver
DuongQLee Aug 6, 2024
2a4e52e
githook format
DuongQLee Aug 6, 2024
ea86f83
fix uninitialize variable
DuongQLee Aug 7, 2024
871ad57
githook format
DuongQLee Aug 7, 2024
afb2464
fix tidy
DuongQLee Aug 7, 2024
07c7fe9
update gtest
DuongQLee Aug 9, 2024
186974c
githook format
DuongQLee Aug 9, 2024
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 @@ -35,3 +35,4 @@ The MIOpen API library is structured as follows:
* :doc:`ReduceExtreme <../doxygen/html/group__ReduceExtreme>` (experimental)
* :doc:`Getitem <../doxygen/html/group__getitem>` (experimental)
* :doc:`ReduceCalculation <../doxygen/html/group__ReduceCalculation>` (experimental)
* :doc:`Pad <../doxygen/html/group__pad>` (experimental)
1 change: 1 addition & 0 deletions driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_executable(MIOpenDriver
dm_groupnorm.cpp
dm_layernorm.cpp
dm_lrn.cpp
dm_pad_reflection.cpp
dm_pool.cpp
dm_reduce.cpp
dm_reduceextreme.cpp
Expand Down
39 changes: 39 additions & 0 deletions driver/dm_pad_reflection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*******************************************************************************
*
* 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 "pad_reflection_driver.hpp"
static Driver* makeDriver(const std::string& base_arg)
{
if(base_arg == "padreflection")
return new PadReflectionDriver<float, float>();
if(base_arg == "padreflectionfp16")
return new PadReflectionDriver<float16, float>();
if(base_arg == "padreflectionbfp16")
return new PadReflectionDriver<bfloat16, float>();
return nullptr;
}

REGISTER_DRIVER_MAKER(makeDriver);
6 changes: 4 additions & 2 deletions driver/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ inline void PadBufferSize(size_t& sz, int datatype_sz)
"groupnorm[bfp16|fp16], cat[bfp16|fp16], addlayernorm[bfp16|fp16], "
"t5layernorm[bfp16|fp16], adam[fp16], ampadam, reduceextreme[bfp16|fp16], "
"adamw[fp16], ampadamw, transformersadamw[fp16], transformersampadamw, "
"getitem[bfp16|fp16], reducecalculation[bfp16|fp16]\n");
"getitem[bfp16|fp16], reducecalculation[bfp16|fp16], padreflection[bfp16|fp16]\n");
exit(0); // NOLINT (concurrency-mt-unsafe)
}

Expand Down Expand Up @@ -206,7 +206,9 @@ inline std::string ParseBaseArg(int argc, char* argv[])
arg != "adamwfp16" && arg != "ampadamw" && arg != "transformersadamw" &&
arg != "transformersadamwfp16" && arg != "transformersampadamw" && arg != "getitem" &&
arg != "getitemfp16" && arg != "getitembfp16" && arg != "reducecalculation" &&
arg != "reducecalculationfp16" && arg != "reducecalculationbfp16" && arg != "--version")
arg != "reducecalculationfp16" && arg != "reducecalculationbfp16" &&
arg != "padreflection" && arg != "padreflectionfp16" && arg != "padreflectionbfp16" &&
arg != "--version")
{
printf("FAILED: Invalid Base Input Argument\n");
Usage();
Expand Down
Loading