From 227ce01417c83449b42f6d9dc75d7ae01c9232fd Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 13 Aug 2026 17:54:29 -0700 Subject: [PATCH] fix: rename sampling TEMP var to TEMPERATURE to avoid HIP runtime env collision The ROCm HIP runtime (libamdhip64) reads the TEMP environment variable as its JIT kernel-cache temp directory. Commit db3eb01 added TEMP=1.0 to the env files as a sampling default; the serve scripts export it via set -a. HIP then used the path "1.0" for its cache, failed, and segfaulted with a NULL-refcount unref (offset 0x446153 in libamdhip64) during model tensor upload (ggml_backend_cuda_buffer_set_tensor). This crashed frank-default- large on every restart from Aug 13 16:22 onward; the earlier c984a3e "fix" (KV/batch changes) was unrelated. Rename the sampling variable TEMP -> TEMPERATURE in both env files and serve scripts. llama-server still receives --temp from the renamed var, so sampling defaults are unchanged. The HIP runtime no longer sees a bogus TEMP value. Affects frank-default-large (dankclaw) and frank-default-small (dankserver). --- scripts/frank-default-large.env | 5 ++++- scripts/frank-default-small.env | 5 ++++- scripts/serve-llama-frank-large.sh | 4 ++-- scripts/serve-llama-frank-small.sh | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/frank-default-large.env b/scripts/frank-default-large.env index b8b6ca7..56b22fd 100644 --- a/scripts/frank-default-large.env +++ b/scripts/frank-default-large.env @@ -36,7 +36,10 @@ UBATCH_SIZE=512 # Sampling settings — per HauhauCS Qwen3.6-27B model card. # Thinking-general: temp=1.0, top_p=0.95, top_k=20, min_p=0. # Clients may override per-request; these are the server-side defaults. -TEMP=1.0 +# WARNING: do not name this variable TEMP. The ROCm HIP runtime reads the +# TEMP environment variable (JIT kernel-cache dir); TEMP=1.0 made the HIP +# runtime SEGV (NULL unref) during model load on Aug 13 2026. +TEMPERATURE=1.0 TOP_K=20 TOP_P=0.95 MIN_P=0.0 diff --git a/scripts/frank-default-small.env b/scripts/frank-default-small.env index b2a8180..bd4ba85 100644 --- a/scripts/frank-default-small.env +++ b/scripts/frank-default-small.env @@ -34,7 +34,10 @@ NO_MMAP=1 # Sampling settings — per HauhauCS Qwen3.6-35B-A3B model card. # Thinking-general: temp=1.0, top_p=0.95, top_k=20, min_p=0. # Clients may override per-request; these are the server-side defaults. -TEMP=1.0 +# WARNING: do not name this variable TEMP. The ROCm HIP runtime reads the +# TEMP environment variable (JIT kernel-cache dir); TEMP=1.0 made the HIP +# runtime SEGV (NULL unref) during model load on Aug 13 2026. +TEMPERATURE=1.0 TOP_K=20 TOP_P=0.95 MIN_P=0.0 diff --git a/scripts/serve-llama-frank-large.sh b/scripts/serve-llama-frank-large.sh index 30e4b20..b7645d0 100755 --- a/scripts/serve-llama-frank-large.sh +++ b/scripts/serve-llama-frank-large.sh @@ -37,7 +37,7 @@ fi : "${CACHE_TYPE_V:=q8_0}" : "${BATCH_SIZE:=2048}" : "${UBATCH_SIZE:=512}" -: "${TEMP:=1.0}" +: "${TEMPERATURE:=1.0}" : "${TOP_K:=20}" : "${TOP_P:=0.95}" : "${MIN_P:=0.0}" @@ -72,7 +72,7 @@ exec "$LLAMA_SERVER" \ --parallel "$PARALLEL" \ --batch-size "$BATCH_SIZE" \ --ubatch-size "$UBATCH_SIZE" \ - --temp "$TEMP" \ + --temp "$TEMPERATURE" \ --top-k "$TOP_K" \ --top-p "$TOP_P" \ --min-p "$MIN_P" \ diff --git a/scripts/serve-llama-frank-small.sh b/scripts/serve-llama-frank-small.sh index b052439..201cf16 100755 --- a/scripts/serve-llama-frank-small.sh +++ b/scripts/serve-llama-frank-small.sh @@ -38,7 +38,7 @@ fi : "${UBATCH_SIZE:=512}" : "${CTX_CHECKPOINTS:=0}" : "${NO_MMAP:=0}" -: "${TEMP:=1.0}" +: "${TEMPERATURE:=1.0}" : "${TOP_K:=20}" : "${TOP_P:=0.95}" : "${MIN_P:=0.0}" @@ -74,7 +74,7 @@ exec "$LLAMA_SERVER" \ --ubatch-size "$UBATCH_SIZE" \ --ctx-checkpoints "$CTX_CHECKPOINTS" \ $([ "$NO_MMAP" = "1" ] && printf -- "--no-mmap") \ - --temp "$TEMP" \ + --temp "$TEMPERATURE" \ --top-k "$TOP_K" \ --top-p "$TOP_P" \ --min-p "$MIN_P" \