From e039ff382cb408790808ea8250a90da3bb352b51 Mon Sep 17 00:00:00 2001 From: Baizhou Zhang Date: Fri, 7 Nov 2025 20:07:06 -0800 Subject: [PATCH] [CI] Fix huggingface access for test_flash_attention_4.py (#12846) --- scripts/ci/ci_install_dependency.sh | 4 ++-- test/srt/test_flash_attention_4.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/ci/ci_install_dependency.sh b/scripts/ci/ci_install_dependency.sh index 5cf7c963a..4785abf4a 100755 --- a/scripts/ci/ci_install_dependency.sh +++ b/scripts/ci/ci_install_dependency.sh @@ -22,8 +22,6 @@ echo "CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-}" # Clear torch compilation cache python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TORCHINDUCTOR_CACHE_DIR") or os.path.join(tempfile.gettempdir(), "torchinductor_" + getpass.getuser()); shutil.rmtree(cache_dir, ignore_errors=True)' -rm -rf /root/.cache/flashinfer -pip3 uninstall flashinfer-python flashinfer-cubin flashinfer-jit-cache || true # Install apt packages apt install -y git libnuma-dev libssl-dev pkg-config @@ -80,6 +78,7 @@ if [ "$IS_BLACKWELL" = "1" ]; then # Clean up existing installations $PIP_CMD uninstall -y sgl-kernel sglang $PIP_INSTALL_SUFFIX || true + $PIP_CMD uninstall -y flashinfer-python flashinfer-cubin flashinfer-jit-cache $PIP_INSTALL_SUFFIX || true else # In normal cases, we use uv, which is much faster than pip. pip install --upgrade pip @@ -91,6 +90,7 @@ else # Clean up existing installations $PIP_CMD uninstall sgl-kernel sglang || true + $PIP_CMD uninstall flashinfer-python flashinfer-cubin flashinfer-jit-cache || true fi # Install the main package diff --git a/test/srt/test_flash_attention_4.py b/test/srt/test_flash_attention_4.py index 8bba922b6..2be593b4a 100644 --- a/test/srt/test_flash_attention_4.py +++ b/test/srt/test_flash_attention_4.py @@ -5,7 +5,6 @@ from sglang.srt.environ import envs from sglang.srt.utils import get_device_sm, kill_process_tree from sglang.test.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k from sglang.test.test_utils import ( - DEFAULT_MODEL_NAME_FOR_TEST, DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH, DEFAULT_URL_FOR_TEST, popen_launch_server, @@ -16,7 +15,7 @@ from sglang.test.test_utils import ( class TestFlashAttention4(unittest.TestCase): @classmethod def setUpClass(cls): - cls.model = DEFAULT_MODEL_NAME_FOR_TEST + cls.model = "Qwen/Qwen3-8B" cls.base_url = DEFAULT_URL_FOR_TEST other_args = [ "--trust-remote-code", @@ -49,7 +48,7 @@ class TestFlashAttention4(unittest.TestCase): metrics = run_eval_few_shot_gsm8k(args) print(metrics) - self.assertGreater(metrics["accuracy"], 0.65) + self.assertGreater(metrics["accuracy"], 0.75) if __name__ == "__main__":