ci: migrate quantization kernel tests to test/registered/quant/ (#16323)
This commit is contained in:
@@ -7,6 +7,7 @@ import unittest
|
|||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
from sglang.test.run_eval import run_eval
|
from sglang.test.run_eval import run_eval
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_AUTOROUND_MODEL_NAME_FOR_TEST,
|
DEFAULT_AUTOROUND_MODEL_NAME_FOR_TEST,
|
||||||
@@ -16,6 +17,9 @@ from sglang.test.test_utils import (
|
|||||||
popen_launch_server,
|
popen_launch_server,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# AutoRound quantization tests
|
||||||
|
register_cuda_ci(est_time=77, suite="stage-b-test-small-1-gpu")
|
||||||
|
|
||||||
|
|
||||||
class TestAutoRound(CustomTestCase):
|
class TestAutoRound(CustomTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -16,8 +16,12 @@ from sglang.srt.layers.quantization.awq_triton import (
|
|||||||
awq_dequantize_triton,
|
awq_dequantize_triton,
|
||||||
awq_gemm_triton,
|
awq_gemm_triton,
|
||||||
)
|
)
|
||||||
|
from sglang.test.ci.ci_register import register_amd_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# AWQ dequantization tests (AMD only)
|
||||||
|
register_amd_ci(est_time=2, suite="stage-a-test-1")
|
||||||
|
|
||||||
device = "cuda"
|
device = "cuda"
|
||||||
|
|
||||||
|
|
||||||
@@ -7,8 +7,13 @@ from sglang.srt.layers.activation import SiluAndMul
|
|||||||
from sglang.srt.layers.moe.fused_moe_triton.fused_moe import fused_moe
|
from sglang.srt.layers.moe.fused_moe_triton.fused_moe import fused_moe
|
||||||
from sglang.srt.layers.moe.topk import TopKConfig, select_experts
|
from sglang.srt.layers.moe.topk import TopKConfig, select_experts
|
||||||
from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler
|
from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler
|
||||||
|
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# Block INT8 quantization kernel tests
|
||||||
|
register_cuda_ci(est_time=44, suite="stage-b-test-small-1-gpu")
|
||||||
|
register_amd_ci(est_time=22, suite="stage-a-test-1")
|
||||||
|
|
||||||
|
|
||||||
# For test
|
# For test
|
||||||
def native_per_token_group_quant_int8(x, group_size, eps=1e-10, dtype=torch.int8):
|
def native_per_token_group_quant_int8(x, group_size, eps=1e-10, dtype=torch.int8):
|
||||||
@@ -6,8 +6,12 @@ from sglang.srt.layers.quantization.fp8_kernel import (
|
|||||||
per_token_group_quant_fp8,
|
per_token_group_quant_fp8,
|
||||||
w8a8_block_fp8_matmul,
|
w8a8_block_fp8_matmul,
|
||||||
)
|
)
|
||||||
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# FP8 quantization kernel tests
|
||||||
|
register_cuda_ci(est_time=10, suite="stage-b-test-small-1-gpu")
|
||||||
|
|
||||||
|
|
||||||
class TestFP8Base(CustomTestCase):
|
class TestFP8Base(CustomTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
+4
-1
@@ -1,12 +1,15 @@
|
|||||||
# test/srt/quant/test_fused_rms_fp8_group_quant.py
|
|
||||||
import itertools
|
import itertools
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
|
|
||||||
|
from sglang.test.ci.ci_register import register_amd_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# Fused RMS FP8 group quantization tests (AMD/ROCm only)
|
||||||
|
register_amd_ci(est_time=10, suite="stage-a-test-1")
|
||||||
|
|
||||||
|
|
||||||
def _fp8_available() -> bool:
|
def _fp8_available() -> bool:
|
||||||
# requirement:1) GPU;2) ROCm;3) torch support float8_e4m3fn
|
# requirement:1) GPU;2) ROCm;3) torch support float8_e4m3fn
|
||||||
@@ -8,8 +8,12 @@ from sglang.srt.layers.moe.fused_moe_triton.fused_moe import fused_moe
|
|||||||
from sglang.srt.layers.moe.topk import TopKConfig, select_experts
|
from sglang.srt.layers.moe.topk import TopKConfig, select_experts
|
||||||
from sglang.srt.layers.quantization.int8_kernel import per_token_quant_int8
|
from sglang.srt.layers.quantization.int8_kernel import per_token_quant_int8
|
||||||
from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler
|
from sglang.srt.server_args import ServerArgs, set_global_server_args_for_scheduler
|
||||||
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# INT8 quantization kernel tests
|
||||||
|
register_cuda_ci(est_time=8, suite="stage-b-test-small-1-gpu")
|
||||||
|
|
||||||
|
|
||||||
def native_w8a8_per_token_matmul(A, B, As, Bs, output_dtype=torch.float16):
|
def native_w8a8_per_token_matmul(A, B, As, Bs, output_dtype=torch.float16):
|
||||||
"""Matrix multiplication function that supports per-token input quantization and per-column weight quantization"""
|
"""Matrix multiplication function that supports per-token input quantization and per-column weight quantization"""
|
||||||
+5
@@ -5,8 +5,13 @@ import torch
|
|||||||
import torch.testing
|
import torch.testing
|
||||||
|
|
||||||
from sglang.srt.layers.quantization.fp8_kernel import triton_scaled_mm
|
from sglang.srt.layers.quantization.fp8_kernel import triton_scaled_mm
|
||||||
|
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||||
from sglang.test.test_utils import CustomTestCase
|
from sglang.test.test_utils import CustomTestCase
|
||||||
|
|
||||||
|
# Triton scaled matrix multiplication tests
|
||||||
|
register_cuda_ci(est_time=8, suite="stage-b-test-small-1-gpu")
|
||||||
|
register_amd_ci(est_time=12, suite="stage-a-test-1")
|
||||||
|
|
||||||
|
|
||||||
def torch_scaled_mm(
|
def torch_scaled_mm(
|
||||||
a: torch.Tensor,
|
a: torch.Tensor,
|
||||||
+4
@@ -5,6 +5,7 @@ from types import SimpleNamespace
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from sglang.srt.utils import kill_process_tree
|
from sglang.srt.utils import kill_process_tree
|
||||||
|
from sglang.test.ci.ci_register import register_cuda_ci
|
||||||
from sglang.test.few_shot_gsm8k import run_eval
|
from sglang.test.few_shot_gsm8k import run_eval
|
||||||
from sglang.test.test_utils import (
|
from sglang.test.test_utils import (
|
||||||
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
DEFAULT_TIMEOUT_FOR_SERVER_LAUNCH,
|
||||||
@@ -13,6 +14,9 @@ from sglang.test.test_utils import (
|
|||||||
popen_launch_server,
|
popen_launch_server,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# W8A8 quantization server integration tests
|
||||||
|
register_cuda_ci(est_time=160, suite="stage-b-test-small-1-gpu")
|
||||||
|
|
||||||
|
|
||||||
class BaseW8A8Test(CustomTestCase):
|
class BaseW8A8Test(CustomTestCase):
|
||||||
model: str = None
|
model: str = None
|
||||||
+2
-10
@@ -41,12 +41,7 @@ suites = {
|
|||||||
TestFile("openai_server/validation/test_openai_server_ignore_eos.py", 6),
|
TestFile("openai_server/validation/test_openai_server_ignore_eos.py", 6),
|
||||||
TestFile("openai_server/validation/test_request_length_validation.py", 38),
|
TestFile("openai_server/validation/test_request_length_validation.py", 38),
|
||||||
TestFile("ops/test_repeat_interleave.py", 60),
|
TestFile("ops/test_repeat_interleave.py", 60),
|
||||||
TestFile("quant/test_block_int8.py", 44),
|
# quant tests moved to test/registered/quant/
|
||||||
TestFile("quant/test_fp8_kernel.py", 10),
|
|
||||||
TestFile("quant/test_int8_kernel.py", 8),
|
|
||||||
TestFile("quant/test_triton_scaled_mm.py", 8),
|
|
||||||
TestFile("quant/test_w8a8_quantization.py", 160),
|
|
||||||
TestFile("quant/test_autoround.py", 77),
|
|
||||||
TestFile("rl/test_fp32_lm_head.py", 9),
|
TestFile("rl/test_fp32_lm_head.py", 9),
|
||||||
# TestFile("rl/test_update_weights_from_disk.py", 210), # Temporarily disabled, see https://github.com/sgl-project/sglang/pull/13998
|
# TestFile("rl/test_update_weights_from_disk.py", 210), # Temporarily disabled, see https://github.com/sgl-project/sglang/pull/13998
|
||||||
TestFile("rl/test_update_weights_from_tensor.py", 195),
|
TestFile("rl/test_update_weights_from_tensor.py", 195),
|
||||||
@@ -228,10 +223,7 @@ suite_amd = {
|
|||||||
TestFile("openai_server/validation/test_openai_server_ignore_eos.py", 85),
|
TestFile("openai_server/validation/test_openai_server_ignore_eos.py", 85),
|
||||||
TestFile("openai_server/validation/test_request_length_validation.py", 31),
|
TestFile("openai_server/validation/test_request_length_validation.py", 31),
|
||||||
TestFile("ops/test_repeat_interleave.py", 75),
|
TestFile("ops/test_repeat_interleave.py", 75),
|
||||||
TestFile("quant/test_awq_dequant.py", 2),
|
# quant tests moved to test/registered/quant/
|
||||||
TestFile("quant/test_block_int8.py", 22),
|
|
||||||
TestFile("quant/test_fused_rms_fp8_group_quant.py", 10),
|
|
||||||
TestFile("quant/test_triton_scaled_mm.py", 12),
|
|
||||||
TestFile("rl/test_fp32_lm_head.py", 15),
|
TestFile("rl/test_fp32_lm_head.py", 15),
|
||||||
# TestFile("rl/test_update_weights_from_disk.py", 210), # Temporarily disabled, see https://github.com/sgl-project/sglang/pull/13998
|
# TestFile("rl/test_update_weights_from_disk.py", 210), # Temporarily disabled, see https://github.com/sgl-project/sglang/pull/13998
|
||||||
TestFile("rotary_embedding/test_mrope.py", 15),
|
TestFile("rotary_embedding/test_mrope.py", 15),
|
||||||
|
|||||||
Reference in New Issue
Block a user