def validate_config(
        cls,
        config: type[BasePassConfig],
        accelerator_spec: AcceleratorSpec,
    ) -> bool:
        """Validate the search point for the pass."""
        if not super().validate_config(config, accelerator_spec):
            return False

        # Rename the search parameters with atomic/singular names for clarity
        config.__class__.__config__.extra = Extra.allow
        config.execution_provider = config.providers_list
        config.provider_options = config.provider_options_list
        config.execution_mode = config.execution_mode_list
        config.opt_level = config.opt_level_list
        config.intra_op_thread_count = config.intra_thread_num_list
        config.inter_op_thread_count = config.inter_thread_num_list

        if config.execution_provider == "CUDAExecutionProvider" and not config.io_bind:
            # if enable_cuda_graph is True but the io_bind is False, the following errors will be raised.
            # onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : CUDA failure 700:
            #    an illegal memory access was encountered ; GPU=0 ; hostname=c93f1847c000000 ;
            #    file=/onnxruntime_src/onnxruntime/core/providers/cuda/cuda_graph.cc ; line=49 ;
            #    expr=cudaGraphLaunch(graph_exec_, stream_);
            # [E:onnxruntime:Default, cuda_call.cc:116 CudaCall] CUDA failure 700:
            #    an illegal memory access was encountered ; GPU=0 ; hostname=c93f1847c000000 ;
            #    file=/onnxruntime_src/onnxruntime/core/providers/cuda/cuda_execution_provider.cc ; line=286 ;
            #    expr=cudaStreamDestroy(stream_);
            # [E:onnxruntime:Default, cuda_call.cc:116 CudaCall] CUDNN failure 4:
            #    CUDNN_STATUS_INTERNAL_ERROR ; GPU=0 ; hostname=c93f1847c000000 ;
            #    file=/onnxruntime_src/onnxruntime/core/providers/cuda/cuda_execution_provider.cc ; line=181 ;
            #    expr=cudnnDestroy(cudnn_handle_);
            return False
        elif config.execution_provider == "CPUExecutionProvider" and config.io_bind:
            # if the first combo is CPUExecutionProvider, then the io_bind should not be True
            logger.info("[Ignored] Because EP is CPUExecutionProvider, the io_bind should not be True")
            return False

        # Parallel execution mode does not support the CUDA Execution Provider.
        # So ORT will make the execution mode sequential when it uses the CUDA Execution Provider.

        if config.execution_provider != "CUDAExecutionProvider" and config.enable_cuda_graph:
            logger.info("[Ignored] Because EP is not CUDAExecutionProvider, the enable_cuda_graph is ignored")
            return True
        if config.execution_provider != "TensorrtExecutionProvider" and config.trt_fp16_enable:
            logger.info("[Ignored] Because EP is not TensorrtExecutionProvider, the trt_fp16_enable is ignored")
            return True
        if (
            config.execution_provider == "CUDAExecutionProvider"
            and config.enable_cuda_graph
            and config.execution_mode == ort.ExecutionMode.ORT_PARALLEL.value
        ):
            # Need disable the ort.ExecutionMode.ORT_PARALLEL if enable_cuda_graph is True
            # because the CUDA Graph does not support the parallel execution mode.
            # Otherwise, the following error will be thrown:
            #  self._sess.run_with_iobinding(iobinding._iobinding, run_options)
            #  RuntimeError: Error in execution: /onnxruntime_src/onnxruntime/core/providers/cuda/cuda_call.cc:121
            #  std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(
            #       ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int)
            #    [with ERRTYPE = cudaError; bool THRW = true;
            #       std::conditional_t<THRW, void, onnxruntime::common::Status> = void]
            #    /onnxruntime_src/onnxruntime/core/providers/cuda/cuda_call.cc:114
            #  std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(
            #       ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int)
            #    [with ERRTYPE = cudaError; bool THRW = true;
            #       std::conditional_t<THRW, void, onnxruntime::common::Status> = void]
            #    CUDA failure 901: operation failed due to a previous error during capture ;
            #       GPU=0 ; hostname=41bcb832c000001 ;
            #    file=/onnxruntime_src/onnxruntime/core/providers/cuda/cuda_graph.cc ; line=33 ;
            #    expr=cudaStreamEndCapture(stream_, &graph_);
            # The RuntimeError doesn't impact the perf-tuning result, but it will waste the time.
            logger.warning(
                "[Ignored] Because EP is CUDAExecutionProvider, the execution_mode should not be 1 "
                "in case of enable_cuda_graph is True. Otherwise, the RuntimeError will be thrown."
            )
            return False

        # TODO(myguo): we need disable the following check when we enable cache in perf tuning.
        if config.execution_provider != accelerator_spec.execution_provider and not config.force_evaluate_other_eps:
            logger.warning(
                "Ignore perf tuning for EP %s since current pass EP is %s",
                config.execution_provider,
                accelerator_spec.execution_provider,
            )
            return False

        return True
Validate the search point for the pass.
olive/passes/onnx/session_params_tuning.py