Enable PDL by default for Hopper+ devices

This commit is contained in:
aendk
2026-05-15 10:55:24 +02:00
parent fee1c65fed
commit a083acc75d
+4 -4
View File
@@ -231,13 +231,13 @@ template<typename Kernel, typename... Args>
static __inline__ void ggml_cuda_kernel_launch(Kernel kernel, const ggml_cuda_kernel_launch_params & launch_params, Args&&... args) {
#if defined(GGML_CUDA_USE_PDL)
// PDL is off by default. To enable, set GGML_CUDA_ENABLE_PDL=1
static const bool enable_pdl = []() {
const char * env = getenv("GGML_CUDA_ENABLE_PDL");
// PDL is on by default. To disable, set GGML_CUDA_DISABLE_PDL=1
static const bool disable_pdl = []() {
const char * env = getenv("GGML_CUDA_DISABLE_PDL");
return env != nullptr && std::atoi(env) != 0;
}();
if (enable_pdl) {
if (!disable_pdl) {
auto pdl_cfg = ggml_cuda_pdl_config(launch_params);
CUDA_CHECK(cudaLaunchKernelEx(&pdl_cfg.cfg, kernel, std::forward<Args>(args)... ));
return;