From 3239b0a613f4b9bc452c1c02fa8e11cac0973dbc Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Thu, 25 Jun 2026 07:30:12 -0700 Subject: [PATCH] comfyui(irv-ml1): add PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native-allocator expandable segments to cut Qwen-Image-Edit fragmentation OOMs on the A6000 (a ~2 GB alloc failing with 1.75 GB free while 45 GB sat allocated + reserved-but-unallocated). Cache-preserving — packs better without unloading the checkpoint, so no edit-latency hit. Paired with the existing --disable-cuda-malloc (incompatible with cudaMallocAsync). Deployed + recreated on irv-ml1; verified env present, PyTorch reads it, container healthy. comfy-dev request 2026-06-25. --- stacks/comfyui/compose.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stacks/comfyui/compose.yaml b/stacks/comfyui/compose.yaml index 4914bdb..487c30f 100644 --- a/stacks/comfyui/compose.yaml +++ b/stacks/comfyui/compose.yaml @@ -57,6 +57,14 @@ services: # sm_86 build (rebuilt against the pinned torch 2.12.1). Global speedup # across Flux/SDXL/Wan (comfy-dev benchmarking, 2026-06-18). - COMFY_CMDLINE_EXTRA=--disable-cuda-malloc --fp8_e4m3fn-text-enc --use-sage-attention + # Let PyTorch's native caching allocator grow segments instead of + # pre-carving fixed blocks — cuts fragmentation OOMs on long-lived + # Qwen-Image-Edit sessions (a ~2 GB alloc failing with 1.75 GB free while + # 45 GB sat allocated + reserved-but-unallocated). Cache-preserving: packs + # better WITHOUT unloading the checkpoint, so no edit-latency hit. Only + # valid under the native allocator (paired with --disable-cuda-malloc + # above; incompatible with cudaMallocAsync). comfy-dev request 2026-06-25. + - PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True volumes: - ${COMFYUI_BASEDIR}:/basedir # models/ overlaid from storetank. The ~325 GB model tree was migrated