CUDNN Frontend API  8.2.0
cudnn_frontend Namespace Reference

Classes

class  BackendDescriptor
 
class  ConvDesc_v8
 
class  ConvDescBuilder_v8
 
class  cudnnException
 
class  Engine_v8
 
class  EngineBuilder_v8
 
class  EngineConfig_v8
 
class  EngineConfigBuilder_v8
 
class  EngineConfigGenerator
 
class  EngineFallbackList_v8
 
class  EngineFallbackListBuilder_v8
 
class  EngineHeuristics_v8
 
class  EngineHeuristicsBuilder_v8
 
struct  executionOption
 
class  ExecutionPlan_v8
 
class  ExecutionPlanBuilder_v8
 
class  MatMulDesc_v8
 
class  MatMulDescBuilder_v8
 
class  OpaqueBackendPointer
 
class  Operation_v8
 
class  OperationBuilder_v8
 
class  OperationGraph_v8
 
class  OperationGraphBuilder_v8
 
class  PointWiseDesc_v8
 
class  PointWiseDescBuilder_v8
 
class  ReductionDesc_v8
 
class  ReductionDescBuilder_v8
 
class  Tensor_v8
 
class  TensorBuilder_v8
 
class  VariantPack_v8
 
class  VariantPackBuilder_v8
 

Typedefs

using ManagedOpaqueDescriptor = std::shared_ptr< OpaqueBackendPointer >
 
using Tensor = Tensor_v8
 
using TensorBuilder = TensorBuilder_v8
 
using ConvDesc = ConvDesc_v8
 
using ConvDescBuilder = ConvDescBuilder_v8
 
using PointWiseDescBuilder = PointWiseDescBuilder_v8
 
using PointWiseDesc = PointWiseDesc_v8
 
using MatMulDesc = MatMulDesc_v8
 
using MatMulDescBuilder = MatMulDescBuilder_v8
 
using ReductionDesc = ReductionDesc_v8
 
using ReductionDescBuilder = ReductionDescBuilder_v8
 
using Operation = Operation_v8
 
using OperationBuilder = OperationBuilder_v8
 
using OperationGraph = OperationGraph_v8
 
using OperationGraphBuilder = OperationGraphBuilder_v8
 
using EngineHeuristicsBuilder = EngineHeuristicsBuilder_v8
 
using EngineHeuristics = EngineHeuristics_v8
 
using EngineBuilder = EngineBuilder_v8
 
using Engine = Engine_v8
 
using EngineConfig = EngineConfig_v8
 
using EngineConfigBuilder = EngineConfigBuilder_v8
 
using ExecutionPlan = ExecutionPlan_v8
 
using ExecutionPlanBuilder = ExecutionPlanBuilder_v8
 
using VariantPack = VariantPack_v8
 
using VariantPackBuilder = VariantPackBuilder_v8
 
using EngineFallbackList = EngineFallbackList_v8
 
using EngineFallbackListBuilder = EngineFallbackListBuilder_v8
 
using EngineConfigList = std::vector< ManagedOpaqueDescriptor >
 
using executionOptions_t = std::vector< struct executionOption >
 Variety of renames. More...
 
using executionPlans_t = std::vector< cudnn_frontend::ExecutionPlan >
 
using Predicate = std::function< bool(cudnn_frontend::ExecutionPlan const &plan)>
 
using GeneratorSource = std::function< cudnn_frontend::EngineConfigList(cudnn_frontend::OperationGraph &)>
 

Enumerations

enum  CudnnFindSamplingTechnique {
  CudnnFindSamplingTechnique::CUDNN_FIND_SAMPLE_ONCE,
  CudnnFindSamplingTechnique::CUDNN_FIND_SAMPLE_MEDIAN_OF_THREE,
  CudnnFindSamplingTechnique::CUDNN_FIND_SAMPLE_TILL_STABLE
}
 

Functions

static ManagedOpaqueDescriptor make_shared_backend_pointer (cudnnBackendDescriptorType_t type)
 
auto filter (Predicate pred, executionPlans_t &plans) -> executionPlans_t
 
static auto get_fallback_engine_list (cudnnBackendDescriptorType_t mode, const std::string &opGraphTag) -> std::vector< int >
 
static void load_from_config (json &json_handle, const std::string &errata_json)
 
template<typename T >
static bool check_rule (const json &json_handle, const std::string &executionPlanTag, cudnnHandle_t handle, T fn)
 
template<typename T >
static bool check_errata (const json &json_handle, const std::string &executionPlanTag, cudnnHandle_t handle, T fn)
 
static void filter (EngineConfigList &from, EngineConfigList &to, std::function< bool(cudnnBackendDescriptor_t)> filter_fn)
 
template<cudnnBackendNumericalNote_t NUMERIC_NOTE>
bool hasNumericalNote (cudnnBackendDescriptor_t engine_config)
 
template<CudnnFindSamplingTechnique samplingTechnique>
auto time_sorted_plan (cudnnHandle_t handle, executionPlans_t plans, VariantPack &variantPack) -> executionOptions_t
 
static void throw_if (std::function< bool()> expr, const char *message)
 
static void throw_if (bool expr, const char *message)
 
static void set_error_and_throw_exception (BackendDescriptor const *desc, cudnnStatus_t status, const char *message)
 

Typedef Documentation

◆ ConvDesc

Definition at line 118 of file cudnn_frontend.h.

◆ ConvDescBuilder

Definition at line 119 of file cudnn_frontend.h.

◆ Engine

Definition at line 133 of file cudnn_frontend.h.

◆ EngineBuilder

Definition at line 132 of file cudnn_frontend.h.

◆ EngineConfig

Definition at line 134 of file cudnn_frontend.h.

◆ EngineConfigBuilder

◆ EngineConfigList

EngineConfigList class This is a RAII type class that holds naked EngineConfig backendDescriptor. The purpose of this class is to provide an easy interface to store the EngineConfigs generated from various source and apply a filter.

Definition at line 242 of file cudnn_frontend_EngineConfig.h.

◆ EngineFallbackList

◆ EngineFallbackListBuilder

◆ EngineHeuristics

Definition at line 131 of file cudnn_frontend.h.

◆ EngineHeuristicsBuilder

◆ executionOptions_t

using cudnn_frontend::executionOptions_t = typedef std::vector<struct executionOption>

Variety of renames.

Definition at line 36 of file cudnn_frontend_EngineConfigGenerator.h.

◆ ExecutionPlan

Definition at line 136 of file cudnn_frontend.h.

◆ ExecutionPlanBuilder

◆ executionPlans_t

◆ GeneratorSource

◆ ManagedOpaqueDescriptor

Definition at line 82 of file cudnn_backend_base.h.

◆ MatMulDesc

Definition at line 122 of file cudnn_frontend.h.

◆ MatMulDescBuilder

Definition at line 123 of file cudnn_frontend.h.

◆ Operation

Definition at line 126 of file cudnn_frontend.h.

◆ OperationBuilder

Definition at line 127 of file cudnn_frontend.h.

◆ OperationGraph

Definition at line 128 of file cudnn_frontend.h.

◆ OperationGraphBuilder

◆ PointWiseDesc

Definition at line 121 of file cudnn_frontend.h.

◆ PointWiseDescBuilder

◆ Predicate

using cudnn_frontend::Predicate = typedef std::function<bool(cudnn_frontend::ExecutionPlan const &plan)>

Definition at line 38 of file cudnn_frontend_EngineConfigGenerator.h.

◆ ReductionDesc

Definition at line 124 of file cudnn_frontend.h.

◆ ReductionDescBuilder

◆ Tensor

Definition at line 116 of file cudnn_frontend.h.

◆ TensorBuilder

Definition at line 117 of file cudnn_frontend.h.

◆ VariantPack

Definition at line 138 of file cudnn_frontend.h.

◆ VariantPackBuilder

Enumeration Type Documentation

◆ CudnnFindSamplingTechnique

Enumerator
CUDNN_FIND_SAMPLE_ONCE 

Sample once quick but may have unstable values.

CUDNN_FIND_SAMPLE_MEDIAN_OF_THREE 

Sample 3 times and take median.

CUDNN_FIND_SAMPLE_TILL_STABLE 

Sample multiple times till stable.

Definition at line 41 of file cudnn_frontend_EngineConfigGenerator.h.

Function Documentation

◆ check_errata()

template<typename T >
static bool cudnn_frontend::check_errata ( const json json_handle,
const std::string &  executionPlanTag,
cudnnHandle_t  handle,
fn 
)
static

Definition at line 87 of file cudnn_frontend_Errata.h.

◆ check_rule()

template<typename T >
static bool cudnn_frontend::check_rule ( const json json_handle,
const std::string &  executionPlanTag,
cudnnHandle_t  handle,
fn 
)
static

◆ filter() [1/2]

static void cudnn_frontend::filter ( EngineConfigList from,
EngineConfigList to,
std::function< bool(cudnnBackendDescriptor_t)>  filter_fn 
)
static

Definition at line 33 of file cudnn_frontend_Filters.h.

◆ filter() [2/2]

auto cudnn_frontend::filter ( Predicate  pred,
executionPlans_t plans 
) -> executionPlans_t

Filter out the execution plan based on the prerequisite conditions. Goes through vector of execution plans and if the predicate returns not to block, it is inserted into the filtered plans.

Definition at line 94 of file cudnn_frontend_EngineConfigGenerator.h.

References cudnn_frontend::executionOption::plan.

Referenced by cudnn_frontend::EngineConfigGenerator::cudnnFindPlan(), and cudnn_frontend::EngineConfigGenerator::cudnnGetPlan().

◆ get_fallback_engine_list()

static auto cudnn_frontend::get_fallback_engine_list ( cudnnBackendDescriptorType_t  mode,
const std::string &  opGraphTag 
) -> std::vector<int>
static

Here we are using the term "bias" in the operationGraph as a proxy for the conv*bias* operation graph. We are not strictly checking the order of the operations in the graph. We propose this as a temporary workaround until the backend API supports querying the fallback list directly from cudnn

Definition at line 30 of file cudnn_frontend_EngineFallbackList.h.

Referenced by cudnn_frontend::EngineFallbackListBuilder_v8::build().

◆ hasNumericalNote()

template<cudnnBackendNumericalNote_t NUMERIC_NOTE>
bool cudnn_frontend::hasNumericalNote ( cudnnBackendDescriptor_t  engine_config)

Definition at line 45 of file cudnn_frontend_Filters.h.

References make_shared_backend_pointer().

◆ load_from_config()

static void cudnn_frontend::load_from_config ( json json_handle,
const std::string &  errata_json 
)
static

Definition at line 39 of file cudnn_frontend_Errata.h.

◆ make_shared_backend_pointer()

◆ set_error_and_throw_exception()

static void cudnn_frontend::set_error_and_throw_exception ( BackendDescriptor const *  desc,
cudnnStatus_t  status,
const char *  message 
)
inlinestatic

Definition at line 60 of file cudnn_frontend_utils.h.

References cudnn_frontend::cudnnException::cudnnException(), cudnn_frontend::BackendDescriptor::set_error(), cudnn_frontend::BackendDescriptor::set_status(), and nlohmann::to_string().

Referenced by cudnn_frontend::MatMulDescBuilder_v8::build(), cudnn_frontend::ReductionDescBuilder_v8::build(), cudnn_frontend::VariantPackBuilder_v8::build(), cudnn_frontend::EngineFallbackListBuilder_v8::build(), cudnn_frontend::OperationGraphBuilder_v8::build(), cudnn_frontend::TensorBuilder_v8::build(), cudnn_frontend::EngineConfigBuilder_v8::build(), cudnn_frontend::EngineHeuristicsBuilder_v8::build(), cudnn_frontend::ConvDescBuilder_v8::build(), cudnn_frontend::PointWiseDescBuilder_v8::build(), cudnn_frontend::ExecutionPlanBuilder_v8::build(), cudnn_frontend::EngineBuilder_v8::build(), cudnn_frontend::OperationBuilder_v8::build(), cudnn_frontend::Engine_v8::buildKnobs(), cudnn_frontend::ExecutionPlan_v8::computeTag(), cudnn_frontend::Engine_v8::Engine_v8(), cudnn_frontend::EngineConfig_v8::EngineConfig_v8(), cudnn_frontend::EngineHeuristics_v8::getEngineConfig(), cudnn_frontend::EngineHeuristics_v8::getEngineConfigCount(), cudnn_frontend::OperationGraph_v8::getEngineCount(), cudnn_frontend::ExecutionPlan_v8::getWorkspaceSize(), cudnn_frontend::OperationBuilder_v8::setaMatDesc(), cudnn_frontend::OperationBuilder_v8::setbDesc(), cudnn_frontend::OperationBuilder_v8::setbMatDesc(), cudnn_frontend::OperationBuilder_v8::setcDesc(), cudnn_frontend::OperationBuilder_v8::setcMatDesc(), cudnn_frontend::EngineConfigBuilder_v8::setEngine(), cudnn_frontend::OperationBuilder_v8::setmatmulDesc(), cudnn_frontend::OperationBuilder_v8::setpwDesc(), cudnn_frontend::OperationBuilder_v8::setreductionDesc(), and cudnn_frontend::OperationBuilder_v8::setwDesc().

◆ throw_if() [1/2]

static void cudnn_frontend::throw_if ( std::function< bool()>  expr,
const char *  message 
)
inlinestatic

◆ throw_if() [2/2]

static void cudnn_frontend::throw_if ( bool  expr,
const char *  message 
)
inlinestatic

◆ time_sorted_plan()

template<CudnnFindSamplingTechnique samplingTechnique>
auto cudnn_frontend::time_sorted_plan ( cudnnHandle_t  handle,
executionPlans_t  plans,
VariantPack variantPack 
) -> executionOptions_t

Sorts the execution plans by their run time. The run time of plan may not trivial and hence we run it multiple times till we get a stable value. We have an additional dry-run which helps stabilize the time further.

Definition at line 37 of file cudnn_frontend_find_plan.h.

References CUDNN_FIND_SAMPLE_MEDIAN_OF_THREE, CUDNN_FIND_SAMPLE_ONCE, and CUDNN_FIND_SAMPLE_TILL_STABLE.