-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into jakpiase/smfmac_test
- Loading branch information
Showing
58 changed files
with
9,275 additions
and
1,245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
codegen/include/ck/host/device_grouped_conv_fwd_multiple_d/conv_fwd_op.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved. | ||
|
||
#pragma once | ||
|
||
#include <cstdlib> | ||
#include <vector> | ||
#include <string> | ||
#include "ck/host/types.hpp" | ||
#include "ck/host/operation/gemm.hpp" | ||
#include "ck/host/device_grouped_conv_fwd_multiple_d/conv_fwd_problem.hpp" | ||
|
||
namespace ck { | ||
namespace host { | ||
namespace conv { | ||
|
||
// defines the values needed for an instance of forward convolution and functions to return | ||
// (templated) instances | ||
struct Operation_Conv_Fwd_Xdl_Cshuffle | ||
{ | ||
// returns a vector of instances given the fusion operations, uses default values for problem | ||
// spec | ||
static std::vector<Operation_Conv_Fwd_Xdl_Cshuffle> | ||
CreateOperations(const std::string& prologue, const std::string& epilogue); | ||
// returns a vector of instances, provided with a problem spec and fusion operations | ||
static std::vector<Operation_Conv_Fwd_Xdl_Cshuffle> CreateOperations( | ||
const Problem_Conv_Fwd& prob, const std::string& prologue, const std::string& epilogue); | ||
std::size_t NumDim; | ||
TensorDesc A{}; | ||
TensorDesc B{}; | ||
DataType acc = DataType::Float; | ||
DataType cs_type = DataType::Half; | ||
std::vector<TensorDesc> Ds = {}; | ||
TensorDesc E{}; | ||
std::string a_elem_op = PassThrough; | ||
std::string b_elem_op = PassThrough; | ||
std::string cde_elem_op = PassThrough; | ||
std::string prologue = ""; | ||
std::string epilogue = ""; | ||
std::string conv_specialization = | ||
"ck::tensor_operation::device::ConvolutionForwardSpecialization::Default"; | ||
std::string gemm_specialization = | ||
"ck::tensor_operation::device::GemmSpecialization::MNKPadding"; | ||
// tuning parameters | ||
operation::TileDesc tile_desc{}; | ||
operation::BlockTransferDesc a_block_transfer{}; | ||
operation::BlockTransferDesc b_block_transfer{}; | ||
operation::CShuffleDesc cshuffle{}; | ||
operation::CBlockTransferDesc c_block_transfer{}; | ||
|
||
// functions to update fusion operations if they are provided | ||
void update_prologue(const std::string& prologue); | ||
void update_epilogue(const std::string& epilogue); | ||
// returns a templated instance | ||
Solution ToSolution() const; | ||
}; | ||
|
||
} // namespace conv | ||
} // namespace host | ||
} // namespace ck |
56 changes: 56 additions & 0 deletions
56
codegen/include/ck/host/device_grouped_conv_fwd_multiple_d/conv_fwd_problem.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright (c) 2024, Advanced Micro Devices, Inc. All rights reserved. | ||
|
||
#pragma once | ||
|
||
#include <cstdlib> | ||
#include <vector> | ||
#include <memory> | ||
#include <sstream> | ||
#include <iterator> | ||
#include <numeric> | ||
#include "ck/host/types.hpp" | ||
|
||
namespace ck { | ||
namespace host { | ||
namespace conv { | ||
|
||
// defines the problem specification for a forward convolution operation | ||
struct Problem_Conv_Fwd | ||
{ | ||
std::size_t NumDim = 0; | ||
// size of a forward convolution operation | ||
std::size_t G = 0; | ||
std::size_t N = 0; | ||
std::size_t C = 0; | ||
std::size_t Hi = 0; | ||
std::size_t Wi = 0; | ||
std::size_t Ho = 0; | ||
std::size_t Wo = 0; | ||
std::size_t K = 0; | ||
std::size_t Y = 0; | ||
std::size_t X = 0; | ||
Layout ALayout = Layout::NHWGC; | ||
Layout BLayout = Layout::GKYXC; | ||
Layout ELayout = Layout::NHWGK; | ||
std::vector<Layout> DsLayout = {}; | ||
DataType ADataType = DataType::Half; | ||
DataType BDataType = DataType::Half; | ||
DataType EDataType = DataType::Half; | ||
std::vector<DataType> DsDataType = {}; | ||
std::string AElementOp = "ck::tensor_operation::element_wise::PassThrough"; | ||
std::string BElementOp = "ck::tensor_operation::element_wise::PassThrough"; | ||
std::string CDEElementOp = "ck::tensor_operation::element_wise::PassThrough"; | ||
|
||
// returns the correct device op file for the operation | ||
std::string GetIncludeHeader() const; | ||
|
||
// returns a list of instances based on the problem spec and provided fusion operations | ||
std::vector<Solution> GetSolutions(const std::string& arch, | ||
const std::string& prologue, | ||
const std::string& epilogue) const; | ||
}; | ||
|
||
} // namespace conv | ||
} // namespace host | ||
} // namespace ck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.