[Spec]: Make Triton standalone spec test deterministic (#25303)
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
Variants combine this base with `CustomTestCase` and override class
|
Variants combine this base with `CustomTestCase` and override class
|
||||||
attributes (`attention_backend`, plus optional `speculative_eagle_topk` /
|
attributes (`attention_backend`, plus optional `speculative_eagle_topk` /
|
||||||
`speculative_num_draft_tokens` / `enable_spec_v2`) to select a backend
|
`speculative_num_draft_tokens` / `enable_spec_v2` /
|
||||||
|
`enable_deterministic_inference`) to select a backend, deterministic mode,
|
||||||
and the V1 / V2 spec engine.
|
and the V1 / V2 spec engine.
|
||||||
|
|
||||||
Pure mixin (does NOT inherit `TestCase`), so unittest does not collect
|
Pure mixin (does NOT inherit `TestCase`), so unittest does not collect
|
||||||
@@ -41,11 +42,12 @@ class StandaloneServerBase:
|
|||||||
speculative_eagle_topk: int = 1
|
speculative_eagle_topk: int = 1
|
||||||
speculative_num_draft_tokens: int = 5
|
speculative_num_draft_tokens: int = 5
|
||||||
enable_spec_v2: bool = True
|
enable_spec_v2: bool = True
|
||||||
|
enable_deterministic_inference: bool = False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_server_args(cls):
|
def get_server_args(cls):
|
||||||
assert cls.attention_backend, f"{cls.__name__} must set `attention_backend`"
|
assert cls.attention_backend, f"{cls.__name__} must set `attention_backend`"
|
||||||
return [
|
args = [
|
||||||
"--trust-remote-code",
|
"--trust-remote-code",
|
||||||
"--cuda-graph-max-bs",
|
"--cuda-graph-max-bs",
|
||||||
"8",
|
"8",
|
||||||
@@ -64,6 +66,9 @@ class StandaloneServerBase:
|
|||||||
"--attention-backend",
|
"--attention-backend",
|
||||||
cls.attention_backend,
|
cls.attention_backend,
|
||||||
]
|
]
|
||||||
|
if cls.enable_deterministic_inference:
|
||||||
|
args.append("--enable-deterministic-inference")
|
||||||
|
return args
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class TestStandaloneSpeculativeDecodingTriton(StandaloneServerBase, CustomTestCa
|
|||||||
speculative_eagle_topk = 2
|
speculative_eagle_topk = 2
|
||||||
speculative_num_draft_tokens = 7
|
speculative_num_draft_tokens = 7
|
||||||
enable_spec_v2 = False
|
enable_spec_v2 = False
|
||||||
|
enable_deterministic_inference = True
|
||||||
|
|
||||||
|
|
||||||
class TestStandaloneSpeculativeDecodingFlashinfer(StandaloneServerBase, CustomTestCase):
|
class TestStandaloneSpeculativeDecodingFlashinfer(StandaloneServerBase, CustomTestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user