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 LogCumSumExp #3640

Open
wants to merge 65 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
af02031
impl cumulative reduction forward (without GTest and Driver)
long10024070 Jun 19, 2024
b290533
impl CumMax, CumMin
long10024070 Jun 28, 2024
702ffd5
impl cumulative reduction forward with GTest
long10024070 Jul 3, 2024
822b133
update doxygen
long10024070 Jul 7, 2024
c197d6d
added error check in problem_description
long10024070 Jul 7, 2024
895d0ba
fixed bug and added Driver
long10024070 Jul 9, 2024
ec0c441
added improvement over ROCM constraint and removed unused code
long10024070 Jul 10, 2024
15c27cf
removed unused lines of code
long10024070 Jul 10, 2024
d431f14
used dynamic Local_size
long10024070 Jul 11, 2024
6b4c5bd
update doxygen comments
long10024070 Jul 11, 2024
b4331ac
changed Tensor Length input format
long10024070 Jul 11, 2024
005af5b
updated test invoke condition
long10024070 Jul 12, 2024
409ca2d
reduce number of GTest testcases
long10024070 Jul 12, 2024
b7c9f2f
fixed for make analyze
long10024070 Jul 15, 2024
2c6e4b1
remove unused constraint
long10024070 Jul 15, 2024
b4050b4
removed GetWorkspaceSize
long10024070 Jul 15, 2024
e4dcc47
added working dim value check in ProblemDescription
long10024070 Jul 15, 2024
fa89c6d
Compile error fixed: packed MIOPEN_THROW message into a string
long10024070 Jul 15, 2024
bd9ba30
bug fixed: checking output or indices tensor is empty or unused in Is…
long10024070 Jul 15, 2024
ac39e2e
more detail in the api descriptor
long10024070 Jul 15, 2024
6dfe5cb
updated network config and added IsAllDimStride1 check
long10024070 Jul 15, 2024
cd62a72
removed excessive assert statement
long10024070 Jul 15, 2024
0e6159f
added more detail to NetworkConfig
long10024070 Jul 17, 2024
b70e17d
fixed: IsAllPacked return false instead of Throw as this is a filter …
long10024070 Jul 19, 2024
51b82cc
packed problem decription checks
long10024070 Jul 19, 2024
c7ad580
removed excessive log
long10024070 Jul 19, 2024
27d66aa
removed excessive log
long10024070 Jul 19, 2024
49b83eb
Merge branch 'develop' into impl_cumulative_reduction_improvedOverROCM
long10024070 Jul 24, 2024
dfd5b31
debug: ndims from auto into int, and reduce number of testcase in GTest
long10024070 Jul 24, 2024
3cca721
Merge remote-tracking branch 'rocm/develop' into impl_cumulative_redu…
long10024070 Jul 24, 2024
7f53a94
format code
long10024070 Jul 24, 2024
634224b
add MIOPEN_INTERNALS_EXPORT
long10024070 Jul 24, 2024
93c57ec
undo unnecessary changed when merging with rocm/MIOpen
long10024070 Jul 24, 2024
6f591c3
undo unnecessary changed when merging with rocm/MIOpen
long10024070 Jul 24, 2024
2ac8e11
Merge remote-tracking branch 'rocm/develop' into impl_cumulative_redu…
long10024070 Aug 6, 2024
c9ebf28
Merge remote-tracking branch 'rocm/develop' into impl_cumulative_redu…
long10024070 Aug 6, 2024
68035ff
update GTest code structure
long10024070 Aug 6, 2024
4fb6c3c
using warpSize from context
long10024070 Aug 6, 2024
47610b6
Merge remote-tracking branch 'rocm/develop' into impl_cumulative_redu…
long10024070 Aug 26, 2024
e9f00f6
Merge branch 'develop' into impl_cumulative_reduction_improvedOverROCM
long10024070 Aug 26, 2024
af0f320
updated cumulative_reduction driver code
long10024070 Aug 27, 2024
215d13a
Merge remote-tracking branch 'rocm/impl_cumulative_reduction_improved…
long10024070 Aug 27, 2024
3b940c2
updated: use CRTP instead of virtual functions
long10024070 Aug 27, 2024
b866eaa
Added more comments
long10024070 Aug 30, 2024
c9bb46b
Impl LogCumSumExp Forward based on Cumulative Reduction forward
long10024070 Sep 30, 2024
2918536
impl Backward functionality with GTEST, no Driver
long10024070 Oct 1, 2024
b25b547
fuse 4 kernel calls in Backward and update functionality of LogCumSum…
long10024070 Oct 2, 2024
898baf7
add Backward Driver, handle nontiguous cases
long10024070 Oct 4, 2024
4fcf4b3
More information to LogCmdLogCumSumExp for logging
long10024070 Oct 4, 2024
a54bcf9
fix make analyze
long10024070 Oct 4, 2024
87dfcc5
wrap header in 'logcumsumexp' namespace
long10024070 Oct 9, 2024
f786ff0
remove env.hpp include
long10024070 Oct 9, 2024
5118ecf
2nd internal review resolving
long10024070 Oct 9, 2024
8858a3f
move logcumsumexp/problem_description definition from .hpp to .cpp
long10024070 Oct 10, 2024
9dd9b1e
removed unused include
long10024070 Oct 10, 2024
126f28b
cast working datatype in kernel from auto, int, float to uint64_t and…
long10024070 Oct 10, 2024
5f6d881
Move Output tensor initilization to AllocateBuffersAndCopy
long10024070 Oct 10, 2024
cc26d61
permute dimension for better performance
long10024070 Oct 11, 2024
d985f56
more testing for non-contiguous cases
long10024070 Oct 11, 2024
ab5be29
resolve internal review comments
long10024070 Oct 11, 2024
e999023
resolve internal review comments
long10024070 Oct 11, 2024
b544d60
Merge branch 'develop' of https://github.com/ROCm/MIOpen into impl_Lo…
anhskrttt Mar 18, 2025
23636dc
refactor, remove not applicable test cases
anhskrttt Mar 18, 2025
9417ebf
Merge branch 'develop' into impl_logcumsumexp
anhskrttt Mar 19, 2025
00392a1
remove redundent tests, add handle for diff 2 infs
anhskrttt Mar 19, 2025
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 @@ -39,3 +39,4 @@ The MIOpen API library is structured as follows:
* :doc:`ReLU <../doxygen/html/group___re_l_u>` (experimental)
* :doc:`Kthvalue <../doxygen/html/group__kthvalue>` (experimental)
* :doc:`GLU <../doxygen/html/group__glu>` (experimental)
* :doc:`LogCumSumExp <./group___log_cum_sum_exp>` (experimental)
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_kthvalue.cpp
dm_layernorm.cpp
dm_logcumsumexp.cpp
dm_lrn.cpp
dm_multimarginloss.cpp
dm_pool.cpp
Expand Down
41 changes: 41 additions & 0 deletions driver/dm_logcumsumexp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
*
* 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 "logcumsumexp_driver.hpp"

static Driver* makeDriver(const std::string& base_arg)
{
if(base_arg == "logcumsumexp")
return new LogCumSumExpDriver<float, float>();
if(base_arg == "logcumsumexpfp16")
return new LogCumSumExpDriver<float16, float>();
if(base_arg == "logcumsumexpbfp16")
return new LogCumSumExpDriver<bfloat16, float>();
return nullptr;
}

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

Expand Down Expand Up @@ -352,6 +352,7 @@ inline std::string ParseBaseArg(int argc, char* argv[])
arg != "kthvaluebfp16" && arg != "glu" && arg != "glufp16" && arg != "glubfp16" &&
arg != "softmarginloss" && arg != "softmarginlossfp16" && arg != "softmarginlossbfp16" &&
arg != "multimarginloss" && arg != "multimarginlossfp16" && arg != "multimarginlossbfp16" &&
arg != "logcumsumexp" && arg != "logcumsumexpfp16" && arg != "logcumsumexpbfp16" &&
arg != "--version")
{
printf("FAILED: Invalid Base Input Argument\n");
Expand Down
Loading
Loading