Skip to content

Commit f194596

Browse files
roberteg16claude
andcommitted
ggml-cuda: enable the shared-expert overlap by default on RDNA3.5
GGML_CUDA_GRAPH_OPT still forces the optimization on ("1") or off ("0"), but when it is unset the default is now on for RDNA3.5 - the architecture where the decode-time shared-expert overlap has been tuned - and off everywhere else. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
1 parent a86d313 commit f194596

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4525,11 +4525,17 @@ static void ggml_backend_cuda_graph_optimize(ggml_backend_t backend, ggml_cgraph
45254525
GGML_UNUSED(cgraph);
45264526
#endif
45274527

4528-
static bool enable_graph_optimization = [] {
4529-
const char * env = getenv("GGML_CUDA_GRAPH_OPT");
4530-
return env != nullptr && atoi(env) == 1;
4528+
// GGML_CUDA_GRAPH_OPT: "1"/"0" force the optimization on/off; when unset it defaults on for
4529+
// RDNA3.5, the only architecture where the decode-time overlap has been tuned, and off elsewhere.
4530+
static const int graph_opt_env = [] {
4531+
const char * env = getenv("GGML_CUDA_GRAPH_OPT");
4532+
return env == nullptr ? -1 : atoi(env);
45314533
}();
45324534

4535+
const bool enable_graph_optimization = graph_opt_env >= 0 ?
4536+
graph_opt_env == 1 :
4537+
GGML_CUDA_CC_IS_RDNA3_5(ggml_cuda_info().devices[cuda_ctx->device].cc);
4538+
45334539
if (!enable_graph_optimization) {
45344540
return;
45354541
}

0 commit comments

Comments
 (0)