[AMD] ci: add label-gated extra-a tier (kv_canary + mock_model unit tests) (#27822)
This commit is contained in:
@@ -12,10 +12,11 @@ from sglang.srt.kv_canary.pool_patcher.buffer_alloc import (
|
||||
make_row_source,
|
||||
resolve_real_kv_read_bytes,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=10, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=10, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _config(mode: RealKvHashMode) -> CanaryConfig:
|
||||
|
||||
@@ -21,11 +21,12 @@ from sglang.srt.kv_canary.expected_inputs import ExpectedInputs
|
||||
from sglang.srt.kv_canary.state import (
|
||||
ViolationLog,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import DEFAULT_DEVICE
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=20, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=20, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _make_endpoint(*, device, kernel_kind=CanaryLaunchTag.HEAD_K_FULL, swa_lut=None):
|
||||
|
||||
@@ -6,10 +6,11 @@ from typing import cast
|
||||
import torch
|
||||
|
||||
from sglang.srt.kv_canary.runner.future_tensor import FutureTensors
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=20, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=20, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class _FakeEvent:
|
||||
|
||||
@@ -27,7 +27,7 @@ from sglang.srt.kv_canary.perturb.utils import (
|
||||
flip_first_byte_in_source,
|
||||
pick_target_group,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import (
|
||||
DEFAULT_DEVICE,
|
||||
make_buffer_group,
|
||||
@@ -41,6 +41,7 @@ if TYPE_CHECKING:
|
||||
from sglang.srt.mem_cache.base_prefix_cache import BasePrefixCache
|
||||
|
||||
register_cuda_ci(est_time=10, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=10, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestParseTargetGroupKind(CustomTestCase):
|
||||
|
||||
@@ -6,7 +6,7 @@ from types import SimpleNamespace
|
||||
import torch
|
||||
|
||||
from sglang.srt.kv_canary.plan_input import PlanInput
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import (
|
||||
DEFAULT_DEVICE,
|
||||
make_forward_batch,
|
||||
@@ -14,6 +14,7 @@ from sglang.test.kv_canary.fixtures import (
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=30, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=30, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _make_static_plan_input(*, bs_capacity: int, device) -> PlanInput:
|
||||
|
||||
@@ -15,7 +15,7 @@ from sglang.jit_kernel.kv_canary.verify import (
|
||||
)
|
||||
from sglang.srt.kv_canary.buffer_group import PoolKind
|
||||
from sglang.srt.kv_canary.pool_patcher.api import attach_canary_buffers
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import (
|
||||
DEFAULT_DEVICE,
|
||||
make_base_config,
|
||||
@@ -25,6 +25,7 @@ from sglang.test.kv_canary.fixtures import (
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=45, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=45, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class PoolPatcherHelper:
|
||||
|
||||
@@ -3,10 +3,11 @@ from __future__ import annotations
|
||||
import unittest
|
||||
|
||||
from sglang.srt.kv_canary.pool_patcher.utils import wrap_method
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=10, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=10, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class _FakeObj:
|
||||
|
||||
@@ -6,11 +6,12 @@ import torch
|
||||
|
||||
from sglang.srt.kv_canary.radix_cache_walker import walk_radix_cache_for_canary
|
||||
from sglang.srt.mem_cache.swa_radix_cache import SWARadixCache, TreeNode
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import DEFAULT_DEVICE, make_radix_cache
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=30, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=30, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestSelfUnitRadixWalker(CustomTestCase):
|
||||
|
||||
@@ -10,11 +10,12 @@ from sglang.srt.kv_canary.req_to_expected_token_ids_manager import (
|
||||
compute_req_all_ids_info,
|
||||
populate_req_to_expected_token_ids,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import DEFAULT_DEVICE, make_forward_batch
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=15, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=15, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _make_req(*, origin: list[int], output: list[int]) -> SimpleNamespace:
|
||||
|
||||
@@ -11,7 +11,7 @@ from sglang.srt.kv_canary.config import CanaryConfig
|
||||
from sglang.srt.kv_canary.runner import stats_logger as stats_logger_module
|
||||
from sglang.srt.kv_canary.runner.health_checker import KernelRunCounterHealthChecker
|
||||
from sglang.srt.kv_canary.state import CanaryDeviceState
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.runner_test_base import (
|
||||
CanaryManagerTestCase,
|
||||
make_config,
|
||||
@@ -20,6 +20,7 @@ from sglang.test.kv_canary.runner_test_base import (
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=45, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=45, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestSelfUnitManagerHealth(CanaryManagerTestCase):
|
||||
|
||||
@@ -12,7 +12,7 @@ from sglang.srt.kv_canary import endpoint as endpoint_module
|
||||
from sglang.srt.kv_canary.expected_inputs import ExpectedInputs
|
||||
from sglang.srt.kv_canary.runner import kernel_launcher as kernel_launcher_module
|
||||
from sglang.srt.kv_canary.state import ViolationLog
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import make_buffer_group, make_forward_batch
|
||||
from sglang.test.kv_canary.runner_test_base import (
|
||||
CanaryManagerTestCase,
|
||||
@@ -21,6 +21,7 @@ from sglang.test.kv_canary.runner_test_base import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=45, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=45, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestManagerPerForward(CanaryManagerTestCase):
|
||||
|
||||
@@ -15,12 +15,13 @@ from sglang.srt.kv_canary.runner.swa_divergence import (
|
||||
SwaDivergenceReporter,
|
||||
compute_swa_full_idx_divergence,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import make_buffer_group
|
||||
from sglang.test.kv_canary.runner_test_base import CanaryManagerTestCase, make_manager
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=45, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=45, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
_DEVICE = torch.device("cuda")
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from sglang.srt.kv_canary import endpoint as endpoint_module
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import (
|
||||
make_forward_batch,
|
||||
make_radix_cache,
|
||||
@@ -17,6 +17,7 @@ from sglang.test.kv_canary.runner_test_base import (
|
||||
)
|
||||
|
||||
register_cuda_ci(est_time=45, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=45, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _run_one_cycle(manager, forward_batch) -> None:
|
||||
|
||||
@@ -5,7 +5,7 @@ import unittest
|
||||
import torch
|
||||
|
||||
from sglang.srt.kv_canary.sweep_plan_builder import build_verify_plan_radix_sweep
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import (
|
||||
DEFAULT_DEVICE,
|
||||
make_radix_cache,
|
||||
@@ -14,6 +14,7 @@ from sglang.test.kv_canary.fixtures import (
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=30, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=30, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestSelfUnitSweepPlanBuilder(CustomTestCase):
|
||||
|
||||
@@ -9,11 +9,12 @@ from sglang.srt.kv_canary.expected_inputs import ExpectedInputs
|
||||
from sglang.srt.kv_canary.token_oracle.oracle import HashOracle
|
||||
from sglang.srt.kv_canary.token_oracle.oracle_manager import TokenOracleManager
|
||||
from sglang.srt.model_executor.forward_batch_info import ForwardMode
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.kv_canary.fixtures import DEFAULT_DEVICE
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=1, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=1, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestTokenOracleManager(CustomTestCase):
|
||||
|
||||
@@ -15,10 +15,11 @@ from sglang.srt.kv_canary.runner.violation_reporter import (
|
||||
ViolationReporter,
|
||||
_format_violation,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=5, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=5, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _make_row(
|
||||
|
||||
@@ -12,11 +12,12 @@ from sglang.srt.model_executor.forward_batch_info import (
|
||||
ForwardMode,
|
||||
_stable_hash_str_to_i64,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.mock_model.utils import mock_model_server_args, mock_model_server_env
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=60, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=60, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
|
||||
@@ -9,10 +9,11 @@ os.environ["SGLANG_KV_CANARY_ENABLE_TOKEN_ORACLE"] = "1"
|
||||
from sglang.srt.kv_canary.token_oracle.install import install_token_oracle_from_env
|
||||
from sglang.srt.kv_canary.token_oracle.oracle import HashOracle
|
||||
from sglang.srt.layers.sampler import _CUSTOM_SAMPLER_FACTORIES
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=60, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=60, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
def _make_server_args(*, sampling_backend: str) -> SimpleNamespace:
|
||||
|
||||
@@ -10,10 +10,11 @@ from sglang.srt.kv_canary.token_oracle.oracle import (
|
||||
HashOracle,
|
||||
_splitmix64_tensor,
|
||||
)
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=60, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=60, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
_U64_MASK: int = (1 << 64) - 1
|
||||
|
||||
@@ -7,10 +7,11 @@ import torch
|
||||
|
||||
from sglang.jit_kernel.kv_canary.verify_ref import splitmix64
|
||||
from sglang.srt.kv_canary.token_oracle.oracle import HashOracle
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=30, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=30, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestHashOracleTorchVsRef(CustomTestCase):
|
||||
|
||||
@@ -18,10 +18,11 @@ from sglang.srt.kv_canary.token_oracle.oracle import HashOracle
|
||||
from sglang.srt.kv_canary.token_oracle.sampler import install_oracle_sampler
|
||||
from sglang.srt.layers.sampler import _CUSTOM_SAMPLER_FACTORIES
|
||||
from sglang.srt.server_args import SAMPLING_BACKEND_CHOICES
|
||||
from sglang.test.ci.ci_register import register_cuda_ci
|
||||
from sglang.test.ci.ci_register import register_amd_ci, register_cuda_ci
|
||||
from sglang.test.test_utils import CustomTestCase
|
||||
|
||||
register_cuda_ci(est_time=60, stage="extra-a", runner_config="1-gpu-small")
|
||||
register_amd_ci(est_time=60, suite="extra-a-test-1-gpu-small-amd")
|
||||
|
||||
|
||||
class TestInstallOracleSampler(CustomTestCase):
|
||||
|
||||
@@ -43,6 +43,14 @@ PER_COMMIT_SUITES = {
|
||||
"stage-c-test-4-gpu-amd",
|
||||
"stage-c-test-large-8-gpu-amd",
|
||||
"stage-c-test-large-8-gpu-amd-mi35x",
|
||||
# extra-a: label-gated PR opt-in suite in pr-test-amd-extra.yml
|
||||
# (mirror of CUDA extra-a; tests stay tagged per-commit but only
|
||||
# dispatch when the PR carries the `run-ci-extra` label). Only the
|
||||
# 1-gpu-small mock-model / kv_canary *unit* tests are onboarded so
|
||||
# far; the canary *e2e* tests (1-/2-gpu-large) need the canary JIT
|
||||
# kernel ported to ROCm first, so those suites are intentionally
|
||||
# not yet registered for AMD.
|
||||
"extra-a-test-1-gpu-small-amd",
|
||||
],
|
||||
HWBackend.MUSA: [],
|
||||
HWBackend.CUDA: [
|
||||
|
||||
Reference in New Issue
Block a user