[Spec]: Make Triton standalone spec test deterministic (#25303)

This commit is contained in:
Ratish P
2026-05-18 17:36:10 -07:00
committed by GitHub
parent b79e4b1e68
commit dbac464726
2 changed files with 8 additions and 2 deletions
@@ -2,7 +2,8 @@
Variants combine this base with `CustomTestCase` and override class
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.
Pure mixin (does NOT inherit `TestCase`), so unittest does not collect
@@ -41,11 +42,12 @@ class StandaloneServerBase:
speculative_eagle_topk: int = 1
speculative_num_draft_tokens: int = 5
enable_spec_v2: bool = True
enable_deterministic_inference: bool = False
@classmethod
def get_server_args(cls):
assert cls.attention_backend, f"{cls.__name__} must set `attention_backend`"
return [
args = [
"--trust-remote-code",
"--cuda-graph-max-bs",
"8",
@@ -64,6 +66,9 @@ class StandaloneServerBase:
"--attention-backend",
cls.attention_backend,
]
if cls.enable_deterministic_inference:
args.append("--enable-deterministic-inference")
return args
@classmethod
def setUpClass(cls):