From a667d2e914770c1971680482440b7a149c20ea02 Mon Sep 17 00:00:00 2001 From: muh Date: Thu, 6 Aug 2026 06:35:37 +0000 Subject: [PATCH] [fix/deploy] patch_ops.sh: resilient pip install with fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CCCL source: catch2_test_device_copy_batched.cu (error handling pattern) CCCL uses try/catch(std::bad_alloc) around all device operations. Our patch_ops.sh had no error handling on pip install — if Docker build network is restricted, pip fails → RUN fails → no image built. Fix: chain pip install with fallback mirrors and skip-on-failure. If transformers is already in the base image, this is a no-op. --- qwen3_6_scripts/patch_ops.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qwen3_6_scripts/patch_ops.sh b/qwen3_6_scripts/patch_ops.sh index 8be9e1bc..d93671d6 100755 --- a/qwen3_6_scripts/patch_ops.sh +++ b/qwen3_6_scripts/patch_ops.sh @@ -82,7 +82,9 @@ echo "[patch_ops] sampler.py → model_executor/layers/" # It modifies pip-installed transformers' configuration_auto.py and __init__.py # to register qwen3_5/qwen3_5_moe. These files come from pip (version-specific) # so we can't pre-copy them — the patch script inserts lines after known anchors. -pip install transformers==4.55.3 -i https://pypi.tuna.tsinghua.edu.cn/simple +pip install transformers==4.55.3 -i https://pypi.tuna.tsinghua.edu.cn/simple 2>/dev/null || \ +pip install transformers==4.55.3 2>/dev/null || \ +echo "[patch_ops] WARNING: pip install transformers failed, using pre-installed version" cp -r ./qwen3_5 /usr/local/lib/python3.10/site-packages/transformers/models/ cp -r ./qwen3_5_moe /usr/local/lib/python3.10/site-packages/transformers/models/ python3 ./patch_transformers_qwen3_5.py