Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions tests/integration/defs/accuracy/test_llm_api_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2679,22 +2679,21 @@ def test_auto_dtype_long_rope(self):

class TestGPTOSS(LlmapiAccuracyTestHarness):
kv_cache_config = KvCacheConfig(free_gpu_memory_fraction=0.5)
extra_evaluator_kwargs = {
"fewshot_as_multiturn": True,
"apply_chat_template": True,
"scores_filter": "exact_match,flexible-extract",
"MAX_OUTPUT_LEN": 8192
}
Comment thread
byshiue marked this conversation as resolved.

MODEL_PATH = f"{llm_models_root()}/gpt_oss/gpt-oss-120b"

def update_task_kwargs(self, task):
task.EVALUATOR_KWARGS["fewshot_as_multiturn"] = True
task.EVALUATOR_KWARGS["apply_chat_template"] = True
task.EVALUATE_KWARGS["scores_filter"] = "exact_match,flexible-extract"
task.MAX_OUTPUT_LEN = 8192
return task

@pytest.mark.parametrize("moe_backend", ["CUTLASS", "TRTLLM", "TRITON"],
ids=["cutlass", "trtllm", "triton"])
@pytest.mark.parametrize("cuda_graph,overlap_scheduler", [
(True, True),
])
def test_w4_1gpu(self, moe_backend, cuda_graph, overlap_scheduler):
def test_w4_1gpu(self, moe_backend, cuda_graph, overlap_scheduler, mocker):
if moe_backend == "TRITON" and not IS_TRITON_KERNELS_AVAILABLE:
pytest.skip("Triton kernels are not available")

Expand All @@ -2712,9 +2711,10 @@ def test_w4_1gpu(self, moe_backend, cuda_graph, overlap_scheduler):

with llm:
model_name = "GPT-OSS/MXFP4"
mocker.patch.object(GSM8K, {"MAX_OUTPUT_LEN": 8192})
task = GSM8K(model_name)
task = self.update_task_kwargs(task)
task.evaluate(llm)
task.evaluate(llm,
extra_evaluator_kwargs=self.extra_evaluator_kwargs)

@pytest.mark.skip_less_device(4)
@pytest.mark.parametrize("moe_backend", ["CUTLASS", "TRTLLM", "TRITON"])
Expand All @@ -2726,7 +2726,7 @@ def test_w4_1gpu(self, moe_backend, cuda_graph, overlap_scheduler):
],
ids=["tp4", "ep4", "dp4"])
def test_w4_4gpus(self, moe_backend, tp_size, pp_size, ep_size,
attention_dp, cuda_graph, overlap_scheduler):
attention_dp, cuda_graph, overlap_scheduler, mocker):
if moe_backend == "TRITON":
if not IS_TRITON_KERNELS_AVAILABLE:
pytest.skip("Triton kernels are not available")
Expand All @@ -2747,8 +2747,9 @@ def test_w4_4gpus(self, moe_backend, tp_size, pp_size, ep_size,
with llm:
model_name = "GPT-OSS/MXFP4"
task = GSM8K(model_name)
task = self.update_task_kwargs(task)
task.evaluate(llm)
mocker.patch.object(GSM8K, {"MAX_OUTPUT_LEN": 8192})
task.evaluate(llm,
extra_evaluator_kwargs=self.extra_evaluator_kwargs)
Comment thread
byshiue marked this conversation as resolved.

@pytest.mark.skip_less_device(4)
@pytest.mark.parametrize(
Expand All @@ -2757,7 +2758,7 @@ def test_w4_4gpus(self, moe_backend, tp_size, pp_size, ep_size,
],
ids=["dp4"])
def test_w4a16(self, tp_size, pp_size, ep_size, attention_dp, cuda_graph,
overlap_scheduler, monkeypatch):
overlap_scheduler, monkeypatch, mocker):
if not IS_TRITON_KERNELS_AVAILABLE:
pytest.skip("Triton kernels are not available")
monkeypatch.setenv("OVERRIDE_QUANT_ALGO", "W4A16_MXFP4")
Expand All @@ -2777,8 +2778,9 @@ def test_w4a16(self, tp_size, pp_size, ep_size, attention_dp, cuda_graph,
with llm:
model_name = "GPT-OSS/BF16"
task = GSM8K(model_name)
task = self.update_task_kwargs(task)
task.evaluate(llm)
mocker.patch.object(GSM8K, {"MAX_OUTPUT_LEN": 8192})
task.evaluate(llm,
extra_evaluator_kwargs=self.extra_evaluator_kwargs)
Comment thread
byshiue marked this conversation as resolved.


class TestEXAONE4(LlmapiAccuracyTestHarness):
Expand Down