[CI] Fix huggingface access for test_flash_attention_4.py (#12846)

This commit is contained in:
Baizhou Zhang
2025-11-07 20:07:06 -08:00
committed by GitHub
parent b8ddc296f4
commit e039ff382c
2 changed files with 4 additions and 5 deletions

View File

@@ -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

View File

@@ -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__":