[CI] Fix huggingface access for test_flash_attention_4.py (#12846)
This commit is contained in:
@@ -22,8 +22,6 @@ echo "CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-}"
|
|||||||
|
|
||||||
# Clear torch compilation cache
|
# 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)'
|
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
|
# Install apt packages
|
||||||
apt install -y git libnuma-dev libssl-dev pkg-config
|
apt install -y git libnuma-dev libssl-dev pkg-config
|
||||||
@@ -80,6 +78,7 @@ if [ "$IS_BLACKWELL" = "1" ]; then
|
|||||||
|
|
||||||
# Clean up existing installations
|
# Clean up existing installations
|
||||||
$PIP_CMD uninstall -y sgl-kernel sglang $PIP_INSTALL_SUFFIX || true
|
$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
|
else
|
||||||
# In normal cases, we use uv, which is much faster than pip.
|
# In normal cases, we use uv, which is much faster than pip.
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
@@ -91,6 +90,7 @@ else
|
|||||||
|
|
||||||
# Clean up existing installations
|
# Clean up existing installations
|
||||||
$PIP_CMD uninstall sgl-kernel sglang || true
|
$PIP_CMD uninstall sgl-kernel sglang || true
|
||||||
|
$PIP_CMD uninstall flashinfer-python flashinfer-cubin flashinfer-jit-cache || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install the main package
|
# Install the main package
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from sglang.srt.environ import envs
|
|||||||
from sglang.srt.utils import get_device_sm, kill_process_tree
|
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.few_shot_gsm8k import run_eval as run_eval_few_shot_gsm8k
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_MODEL_NAME_FOR_TEST,
|
|
||||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||||
DEFAULT_URL_FOR_TEST,
|
DEFAULT_URL_FOR_TEST,
|
||||||
popen_launch_server,
|
popen_launch_server,
|
||||||
@@ -16,7 +15,7 @@ from sglang.test.test_utils import (
|
|||||||
class TestFlashAttention4(unittest.TestCase):
|
class TestFlashAttention4(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.model = DEFAULT_MODEL_NAME_FOR_TEST
|
cls.model = "Qwen/Qwen3-8B"
|
||||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||||
other_args = [
|
other_args = [
|
||||||
"--trust-remote-code",
|
"--trust-remote-code",
|
||||||
@@ -49,7 +48,7 @@ class TestFlashAttention4(unittest.TestCase):
|
|||||||
metrics = run_eval_few_shot_gsm8k(args)
|
metrics = run_eval_few_shot_gsm8k(args)
|
||||||
print(metrics)
|
print(metrics)
|
||||||
|
|
||||||
self.assertGreater(metrics["accuracy"], 0.65)
|
self.assertGreater(metrics["accuracy"], 0.75)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user