mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-19 09:15:04 +02:00
Enable PDL by default for Hopper+ devices
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user