[AMD] Pin mem_fraction_static for the piecewise CUDA graph 1-GPU test on MI300 (#32862)
This commit is contained in:
@@ -13,6 +13,7 @@ from sglang.test.test_utils import (
|
|||||||
DEFAULT_URL_FOR_TEST,
|
DEFAULT_URL_FOR_TEST,
|
||||||
CustomTestCase,
|
CustomTestCase,
|
||||||
SimpleNamespace,
|
SimpleNamespace,
|
||||||
|
is_in_amd_ci,
|
||||||
popen_launch_server,
|
popen_launch_server,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -21,6 +22,13 @@ register_cuda_ci(est_time=180, suite="nightly-1-gpu", nightly=True)
|
|||||||
register_amd_ci(est_time=180, suite="stage-b-test-1-gpu-large-amd")
|
register_amd_ci(est_time=180, suite="stage-b-test-1-gpu-large-amd")
|
||||||
|
|
||||||
|
|
||||||
|
# The 192GB mi300x runners have less headroom than the 256GB mi325x ones they
|
||||||
|
# replaced: the auto-derived fraction left too little room for the ViT
|
||||||
|
# activations plus the piecewise graph private pools, and the server died under
|
||||||
|
# the 1024-thread gsm8k load.
|
||||||
|
AMD_MEM_FRACTION_STATIC = 0.6
|
||||||
|
|
||||||
|
|
||||||
class TestPiecewiseCudaGraphQwen25VL(CustomTestCase):
|
class TestPiecewiseCudaGraphQwen25VL(CustomTestCase):
|
||||||
"""Test piecewise CUDA graph with Qwen2.5-VL-7B-Instruct model"""
|
"""Test piecewise CUDA graph with Qwen2.5-VL-7B-Instruct model"""
|
||||||
|
|
||||||
@@ -28,14 +36,17 @@ class TestPiecewiseCudaGraphQwen25VL(CustomTestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.model = "Qwen/Qwen2.5-VL-7B-Instruct"
|
cls.model = "Qwen/Qwen2.5-VL-7B-Instruct"
|
||||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||||
|
other_args = [
|
||||||
|
"--cuda-graph-backend-prefill=tc_piecewise",
|
||||||
|
"--disable-radix-cache",
|
||||||
|
]
|
||||||
|
if is_in_amd_ci():
|
||||||
|
other_args += ["--mem-fraction-static", str(AMD_MEM_FRACTION_STATIC)]
|
||||||
cls.process = popen_launch_server(
|
cls.process = popen_launch_server(
|
||||||
cls.model,
|
cls.model,
|
||||||
cls.base_url,
|
cls.base_url,
|
||||||
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
timeout=DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||||
other_args=[
|
other_args=other_args,
|
||||||
"--cuda-graph-backend-prefill=tc_piecewise",
|
|
||||||
"--disable-radix-cache",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -64,12 +75,16 @@ class TestPiecewiseCudaGraphQwen25VLEmbedding(CustomTestCase):
|
|||||||
model_path = "Qwen/Qwen2.5-VL-3B-Instruct"
|
model_path = "Qwen/Qwen2.5-VL-3B-Instruct"
|
||||||
chat_template = get_chat_template_by_model_path(model_path)
|
chat_template = get_chat_template_by_model_path(model_path)
|
||||||
text = f"{chat_template.image_token}What is in this picture? Answer: "
|
text = f"{chat_template.image_token}What is in this picture? Answer: "
|
||||||
|
extra_args = (
|
||||||
|
{"mem_fraction_static": AMD_MEM_FRACTION_STATIC} if is_in_amd_ci() else {}
|
||||||
|
)
|
||||||
|
|
||||||
engine = Engine(
|
engine = Engine(
|
||||||
model_path=model_path,
|
model_path=model_path,
|
||||||
enable_multimodal=True,
|
enable_multimodal=True,
|
||||||
is_embedding=True,
|
is_embedding=True,
|
||||||
cuda_graph_backend_prefill="tc_piecewise",
|
cuda_graph_backend_prefill="tc_piecewise",
|
||||||
|
**extra_args,
|
||||||
)
|
)
|
||||||
out = engine.encode([text], image_data=[DEFAULT_IMAGE_URL])[0]["embedding"]
|
out = engine.encode([text], image_data=[DEFAULT_IMAGE_URL])[0]["embedding"]
|
||||||
engine.shutdown()
|
engine.shutdown()
|
||||||
@@ -80,6 +95,7 @@ class TestPiecewiseCudaGraphQwen25VLEmbedding(CustomTestCase):
|
|||||||
enable_multimodal=True,
|
enable_multimodal=True,
|
||||||
is_embedding=True,
|
is_embedding=True,
|
||||||
cuda_graph_backend_prefill="disabled",
|
cuda_graph_backend_prefill="disabled",
|
||||||
|
**extra_args,
|
||||||
)
|
)
|
||||||
out_without_pcg = engine.encode([text], image_data=[DEFAULT_IMAGE_URL])[0][
|
out_without_pcg = engine.encode([text], image_data=[DEFAULT_IMAGE_URL])[0][
|
||||||
"embedding"
|
"embedding"
|
||||||
|
|||||||
Reference in New Issue
Block a user