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

Implement MultiMarginLoss forward #3166

Open
wants to merge 47 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
42acf89
driver ok
littlecutebird Jul 10, 2024
b26abf9
add gtest
littlecutebird Jul 10, 2024
ac4c9fe
update condition
littlecutebird Jul 14, 2024
cad5f79
remove redundant header + some fix by clangd recommend
littlecutebird Jul 15, 2024
679fc43
fix warnings by make analyze
littlecutebird Jul 15, 2024
7e2b420
check p value
littlecutebird Jul 16, 2024
2d6bc85
partial fix reviewer comment
littlecutebird Jul 17, 2024
4f5092c
handle getworkspace internal
littlecutebird Jul 17, 2024
4618ab9
edit network config + gtest
littlecutebird Jul 17, 2024
a2a8580
change driver tref to float
littlecutebird Jul 18, 2024
355ecf4
small fix
littlecutebird Jul 19, 2024
f6f1ace
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Jul 24, 2024
77d0100
add MIOPEN_EXPORT
littlecutebird Jul 24, 2024
bf9b549
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Jul 25, 2024
8006142
partial fix comment
littlecutebird Jul 29, 2024
e044841
change gtest format
littlecutebird Jul 29, 2024
d46ae88
try to trigger CI/CD
littlecutebird Jul 30, 2024
2af818a
use MultiBufferWorkspaceTraits
littlecutebird Jul 30, 2024
9b4469c
add extern C
littlecutebird Aug 1, 2024
8f7ec96
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Aug 1, 2024
cf8a6f5
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Aug 2, 2024
b62c4d8
use std::byte instead of char
littlecutebird Aug 2, 2024
94eb03f
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Aug 6, 2024
685b151
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Aug 15, 2024
eb2994c
combine duplicated code in driver, gtest, src
littlecutebird Aug 15, 2024
8b4b050
fma
littlecutebird Aug 16, 2024
5384ab8
optimize kernel + update condition in solver
littlecutebird Aug 21, 2024
86149f6
merge kernel + avoid convert to float after each kernel
littlecutebird Aug 21, 2024
fdc4232
update isimprovementoverrocm
littlecutebird Aug 21, 2024
1705be3
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Aug 21, 2024
047ca0a
remove OUTPUT_TYPE from solver prelu
littlecutebird Aug 21, 2024
1b222e1
avoid using divisor at all
littlecutebird Aug 27, 2024
d83b833
remove tensor_view modify
littlecutebird Aug 28, 2024
f90005a
remove divisor in driver
littlecutebird Aug 28, 2024
898286f
merge solver to avoid duplicated code
littlecutebird Aug 28, 2024
266307c
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Aug 29, 2024
d3b8b42
rename file
littlecutebird Sep 5, 2024
8152072
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Sep 5, 2024
19c3aba
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Sep 9, 2024
58a6358
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 16, 2024
5cd3cbc
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 18, 2024
97ad668
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 19, 2024
5da6634
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 23, 2024
a1800dd
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 24, 2024
345f0e5
Merge branch 'develop' into nl-impl_MultiMarginLoss
littlecutebird Sep 27, 2024
76eca8e
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
littlecutebird Sep 30, 2024
9978ea9
add missing headers
littlecutebird Sep 30, 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 driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ add_executable(MIOpenDriver
dm_groupnorm.cpp
dm_layernorm.cpp
dm_lrn.cpp
dm_multimarginloss.cpp
dm_pool.cpp
dm_prelu.cpp
dm_reduce.cpp
Expand Down
40 changes: 40 additions & 0 deletions driver/dm_multimarginloss.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 "multimarginloss_driver.hpp"
#include "registry_driver_maker.hpp"

static Driver* makeDriver(const std::string& base_arg)
{
if(base_arg == "multimarginloss")
return new MultiMarginLossDriver<float, float>();
if(base_arg == "multimarginlossfp16")
return new MultiMarginLossDriver<float16, float>();
if(base_arg == "multimarginlossbfp16")
return new MultiMarginLossDriver<bfloat16, float>();
return nullptr;
}

REGISTER_DRIVER_MAKER(makeDriver);
4 changes: 3 additions & 1 deletion driver/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ inline void PadBufferSize(size_t& sz, int datatype_sz)
"t5layernorm[bfp16|fp16], adam[fp16], ampadam, reduceextreme[bfp16|fp16], "
"adamw[fp16], ampadamw, transformersadamw[fp16], transformersampadamw, "
"getitem[bfp16|fp16], reducecalculation[bfp16|fp16], rope[bfp16|fp16], "
"prelu[bfp16|fp16], glu[bfp16|fp16]\n");
"prelu[bfp16|fp16], glu[bfp16|fp16], "
"multimarginloss[bfp16|fp16]\n");
exit(0); // NOLINT (concurrency-mt-unsafe)
}

Expand Down Expand Up @@ -210,6 +211,7 @@ inline std::string ParseBaseArg(int argc, char* argv[])
arg != "reducecalculationfp16" && arg != "reducecalculationbfp16" && arg != "rope" &&
arg != "ropefp16" && arg != "ropebfp16" && arg != "prelu" && arg != "prelufp16" &&
arg != "prelubfp16" && arg != "glu" && arg != "glufp16" && arg != "glubfp16" &&
arg != "multimarginloss" && arg != "multimarginlossfp16" && arg != "multimarginlossbfp16" &&
arg != "--version")
{
printf("FAILED: Invalid Base Input Argument\n");
Expand Down
Loading