[AMD] Clean up DeepSeek-R1-MXFP4 TP2/TP4 MLA GSM8K tests (#27243)
This commit is contained in:
@@ -9,11 +9,6 @@ Registry: nightly-amd-2-gpu-mi35x-deepseek-r1-mxfp4-tp2 suite
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Set HF cache for MI35x.
|
|
||||||
os.environ.setdefault("HF_HOME", "/data2/models/huggingface")
|
|
||||||
os.environ.setdefault("HF_HUB_CACHE", "/data2/models/huggingface/hub")
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
@@ -39,21 +34,10 @@ register_amd_ci(
|
|||||||
|
|
||||||
INVALID = -9999999
|
INVALID = -9999999
|
||||||
|
|
||||||
DEEPSEEK_R1_MXFP4_LOCAL_PATH = "/data2/models/amd-DeepSeek-R1-MXFP4-Preview"
|
|
||||||
DEEPSEEK_R1_MXFP4_HF_MODEL_ID = "amd/DeepSeek-R1-MXFP4-Preview"
|
|
||||||
SERVER_LAUNCH_TIMEOUT = 3600
|
SERVER_LAUNCH_TIMEOUT = 3600
|
||||||
GSM8K_ACCURACY_THRESHOLD = 0.93
|
GSM8K_ACCURACY_THRESHOLD = 0.93
|
||||||
|
|
||||||
|
|
||||||
def get_model_path() -> str:
|
|
||||||
env_path = os.environ.get("DEEPSEEK_R1_MXFP4_MODEL_PATH")
|
|
||||||
if env_path:
|
|
||||||
return env_path
|
|
||||||
if os.path.exists(DEEPSEEK_R1_MXFP4_LOCAL_PATH):
|
|
||||||
return DEEPSEEK_R1_MXFP4_LOCAL_PATH
|
|
||||||
return DEEPSEEK_R1_MXFP4_HF_MODEL_ID
|
|
||||||
|
|
||||||
|
|
||||||
def get_one_example(lines, i, include_answer):
|
def get_one_example(lines, i, include_answer):
|
||||||
ret = "Question: " + lines[i]["question"] + "\nAnswer:"
|
ret = "Question: " + lines[i]["question"] + "\nAnswer:"
|
||||||
if include_answer:
|
if include_answer:
|
||||||
@@ -128,9 +112,9 @@ def run_gsm8k_benchmark(
|
|||||||
class TestDeepSeekR1MXFP4TP2MI35x(unittest.TestCase):
|
class TestDeepSeekR1MXFP4TP2MI35x(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.model = get_model_path()
|
cls.model = os.environ.get("DEEPSEEK_R1_MXFP4_MODEL_PATH", "amd/DeepSeek-R1-MXFP4-Preview")
|
||||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||||
cls.num_questions = int(os.environ.get("GSM8K_NUM_QUESTIONS", "200"))
|
cls.num_questions = int(os.environ.get("GSM8K_NUM_QUESTIONS", "1319"))
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["SGLANG_USE_AITER"] = "1"
|
env["SGLANG_USE_AITER"] = "1"
|
||||||
|
|||||||
@@ -8,11 +8,6 @@ Registry: nightly-amd-8-gpu-mi35x-deepseek-r1-mxfp4-tp4 suite
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Set HF cache for MI35x.
|
|
||||||
os.environ.setdefault("HF_HOME", "/data2/models/huggingface")
|
|
||||||
os.environ.setdefault("HF_HUB_CACHE", "/data2/models/huggingface/hub")
|
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
@@ -38,21 +33,10 @@ register_amd_ci(
|
|||||||
|
|
||||||
INVALID = -9999999
|
INVALID = -9999999
|
||||||
|
|
||||||
DEEPSEEK_R1_MXFP4_LOCAL_PATH = "/data2/models/amd-DeepSeek-R1-MXFP4-Preview"
|
|
||||||
DEEPSEEK_R1_MXFP4_HF_MODEL_ID = "amd/DeepSeek-R1-MXFP4-Preview"
|
|
||||||
SERVER_LAUNCH_TIMEOUT = 3600
|
SERVER_LAUNCH_TIMEOUT = 3600
|
||||||
GSM8K_ACCURACY_THRESHOLD = 0.93
|
GSM8K_ACCURACY_THRESHOLD = 0.93
|
||||||
|
|
||||||
|
|
||||||
def get_model_path() -> str:
|
|
||||||
env_path = os.environ.get("DEEPSEEK_R1_MXFP4_MODEL_PATH")
|
|
||||||
if env_path:
|
|
||||||
return env_path
|
|
||||||
if os.path.exists(DEEPSEEK_R1_MXFP4_LOCAL_PATH):
|
|
||||||
return DEEPSEEK_R1_MXFP4_LOCAL_PATH
|
|
||||||
return DEEPSEEK_R1_MXFP4_HF_MODEL_ID
|
|
||||||
|
|
||||||
|
|
||||||
def get_one_example(lines, i, include_answer):
|
def get_one_example(lines, i, include_answer):
|
||||||
ret = "Question: " + lines[i]["question"] + "\nAnswer:"
|
ret = "Question: " + lines[i]["question"] + "\nAnswer:"
|
||||||
if include_answer:
|
if include_answer:
|
||||||
@@ -127,9 +111,9 @@ def run_gsm8k_benchmark(
|
|||||||
class TestDeepSeekR1MXFP4TP4MI35x(unittest.TestCase):
|
class TestDeepSeekR1MXFP4TP4MI35x(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
cls.model = get_model_path()
|
cls.model = os.environ.get("DEEPSEEK_R1_MXFP4_MODEL_PATH", "amd/DeepSeek-R1-MXFP4-Preview")
|
||||||
cls.base_url = DEFAULT_URL_FOR_TEST
|
cls.base_url = DEFAULT_URL_FOR_TEST
|
||||||
cls.num_questions = int(os.environ.get("GSM8K_NUM_QUESTIONS", "200"))
|
cls.num_questions = int(os.environ.get("GSM8K_NUM_QUESTIONS", "1319"))
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["SGLANG_USE_AITER"] = "1"
|
env["SGLANG_USE_AITER"] = "1"
|
||||||
|
|||||||
Reference in New Issue
Block a user