| 4580 | } |
| 4581 | |
| 4582 | bool CudnnSupport::GetConvolveExecutionPlans( |
| 4583 | dnn::ConvolutionKind kind, dnn::DataType element_type, Stream* stream, |
| 4584 | const dnn::BatchDescriptor& input_descriptor, |
| 4585 | const dnn::FilterDescriptor& filter_descriptor, |
| 4586 | const dnn::BatchDescriptor& output_descriptor, |
| 4587 | const dnn::ConvolutionDescriptor& convolution_descriptor, |
| 4588 | std::vector<cudnn_frontend::ExecutionPlan>* out_exec_plans) { |
| 4589 | #if CUDNN_VERSION >= 8100 |
| 4590 | auto cudnn = cudnn_->GetHandle(parent_, stream); |
| 4591 | auto op_graph_status = GetCudnnOperationGraph( |
| 4592 | kind, element_type, stream, input_descriptor, |
| 4593 | filter_descriptor, output_descriptor, |
| 4594 | convolution_descriptor, cudnn); |
| 4595 | if (!op_graph_status.status().ok()) { |
| 4596 | return false; |
| 4597 | } |
| 4598 | auto op_graph = op_graph_status.ConsumeValueOrDie(); |
| 4599 | |
| 4600 | auto heur = cudnn_frontend::EngineHeuristicsBuilder() |
| 4601 | .setOperationGraph(*op_graph) |
| 4602 | .setHeurMode(GetCudnnFrontendHeurMode()) |
| 4603 | .build(); |
| 4604 | RETURN_FALSE_IF_CUDNN_ERROR(heur); |
| 4605 | |
| 4606 | auto fallback = cudnn_frontend::EngineFallbackListBuilder() |
| 4607 | .setOperationGraph(*op_graph) |
| 4608 | .setOperation(GetCudnnConvolutionType(kind)) |
| 4609 | .build(); |
| 4610 | RETURN_FALSE_IF_CUDNN_ERROR(fallback); |
| 4611 | |
| 4612 | auto &heur_configs = heur.getEngineConfig(heur.getEngineConfigCount()); |
| 4613 | auto &fallback_configs = fallback.getFallbackList(); |
| 4614 | |
| 4615 | VLOG(4) << "\nHeuristics engine configs size: " << heur_configs.size() |
| 4616 | << "\nFallback engine configs size: " << fallback_configs.size(); |
| 4617 | |
| 4618 | cudnn_frontend::EngineConfigList filtered_configs; |
| 4619 | // We use the num_engines_heuristics to mark the border between the two |
| 4620 | // concatenated engine lists. |
| 4621 | int num_engines_heuristics; |
| 4622 | if (tensorflow::tensor_float_32_execution_enabled()) { |
| 4623 | if (stream_executor::cuda::RequireCuDNNDeterminism()) { |
| 4624 | cudnn_frontend::filter(heur_configs, filtered_configs, |
| 4625 | isNonDeterministicOrIsDownConverting); |
| 4626 | num_engines_heuristics = filtered_configs.size(); |
| 4627 | cudnn_frontend::filter(fallback_configs, filtered_configs, |
| 4628 | isNonDeterministicOrIsDownConverting); |
| 4629 | } else { |
| 4630 | cudnn_frontend::filter(heur_configs, filtered_configs, |
| 4631 | isDownConvertingInputs); |
| 4632 | num_engines_heuristics = filtered_configs.size(); |
| 4633 | cudnn_frontend::filter(fallback_configs, filtered_configs, |
| 4634 | isDownConvertingInputs); |
| 4635 | } |
| 4636 | } else { |
| 4637 | if (stream_executor::cuda::RequireCuDNNDeterminism()) { |
| 4638 | cudnn_frontend::filter( |
| 4639 | heur_configs, filtered_configs, |
nothing calls this directly
no test coverage detected