31 using Predicate = std::function<bool(cudnn_frontend::ExecutionPlan const &plan)>;
32 using GeneratorSource = std::function<cudnn_frontend::EngineConfigList(cudnn_frontend::OperationGraph &)>;
51 for (
int i = 0; i < sourceSize; i++) {
52 engine_config_generators.push_back(sources[i]);
61 for (
auto fn : engine_config_generators) {
63 getLogger() <<
"[cudnn_frontend] Called engine config generator and produced " 64 << new_engine_config.size() <<
" configs." << std::endl;
65 std::copy(new_engine_config.begin(), new_engine_config.end(), std::back_inserter(engine_configs));
66 new_engine_config.clear();
68 return engine_configs;
80 template <CudnnFindSamplingTechnique samplingTechnique>
82 cudnnFindPlan(cudnnHandle_t handle,
87 template <CudnnFindSamplingTechnique samplingTechnique>
89 cudnnFindPlan(cudnnHandle_t handle,
93 template <CudnnFindSamplingTechnique samplingTechnique>
95 cudnnFindPlanAndCache(cudnnHandle_t handle,
108 for (
auto &plan : plans) {
109 getLogger() <<
"[cudnn_frontend] "<<
"Filtered ";
112 filtered_plans.emplace_back(std::move(plan));
114 getLogger() << filtered_plans.back().getTag() << std::endl;
116 getLogger() <<
"[cudnn_frontend] Filtered plans count " << filtered_plans.size() << std::endl;
117 return filtered_plans;
Sample 3 times and take median.
ConditionalStreamer & getLogger()
Sample multiple times till stable.
EngineConfigGenerator(int const sourceSize, GeneratorSource const *sources)
std::function< bool(cudnn_frontend::ExecutionPlan const &plan)> Predicate
static auto filter(Predicate pred, executionPlans_t &plans) -> executionPlans_t
auto generate_engine_config(cudnn_frontend::OperationGraph &opGraph) -> cudnn_frontend::EngineConfigList
CudnnFindSamplingTechnique
std::vector< GeneratorSource > engine_config_generators
std::vector< cudnn_frontend::ExecutionPlan > executionPlans_t
Variety of renames.
std::function< cudnn_frontend::EngineConfigList(cudnn_frontend::OperationGraph &)> GeneratorSource
Sample once quick but may have unstable values.
std::vector< ManagedOpaqueDescriptor > EngineConfigList