Skip to content
Open
Show file tree
Hide file tree
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
24 changes: 22 additions & 2 deletions tests/integration/defs/accuracy/accuracy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def compute_threshold(num_samples: int,
return ref_accuracy - z_alpha * scale


STDERR_MARGIN_SIGMAS = 2.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Implement the advertised stderr_margin_sigmas parameter.

The PR contract describes stderr_margin_sigmas as configurable, but this class only exposes the hard-coded STDERR_MARGIN_SIGMAS = 2.0; reference entries cannot select another margin.

Suggested fix
 class HypothesisTestingParams:
     stderr: Optional[float] = None
+    stderr_margin_sigmas: float = STDERR_MARGIN_SIGMAS

     def __post_init__(self) -> None:
         self.ref_accuracy_anchor = self.ref_accuracy
         if self.stderr is not None and self.stderr > 0:
             sign = -1 if self.higher_is_better else 1
-            self.ref_accuracy += sign * STDERR_MARGIN_SIGMAS * self.stderr
+            self.ref_accuracy += sign * self.stderr_margin_sigmas * self.stderr

Also forward entry.get("stderr_margin_sigmas", STDERR_MARGIN_SIGMAS) from get_hypothesis_testing_params().

Based on the PR objectives, stderr_margin_sigmas is part of the intended HypothesisTestingParams API.

Also applies to: 84-96, 204-213

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/integration/defs/accuracy/accuracy_core.py` at line 72, Make
stderr_margin_sigmas configurable in the HypothesisTestingParams API instead of
relying only on STDERR_MARGIN_SIGMAS. Update the relevant parameter construction
and reference-entry handling, including get_hypothesis_testing_params(), to
forward entry.get("stderr_margin_sigmas", STDERR_MARGIN_SIGMAS) so entries can
override the default while preserving 2.0 when unspecified.



@dataclass(slots=True)
class HypothesisTestingParams:
ref_accuracy: float
Expand All @@ -78,10 +81,19 @@ class HypothesisTestingParams:
beta: float = 0.2
sigma: float = 50.0
higher_is_better: bool = True
# lm-eval-style per-metric stderr. When set, ref_accuracy is treated as an
# anchor and the strict floor is offset by STDERR_MARGIN_SIGMAS * stderr so
# single-run noise does not trip the outer assertion (nvbugs/6506920).
stderr: Optional[float] = None
ref_accuracy_anchor: float = field(init=False)
theta: float = field(init=False)
threshold: float = field(init=False)

def __post_init__(self) -> None:
self.ref_accuracy_anchor = self.ref_accuracy
if self.stderr is not None and self.stderr > 0:
sign = -1 if self.higher_is_better else 1
self.ref_accuracy += sign * STDERR_MARGIN_SIGMAS * self.stderr
self.theta = compute_theta(self.num_samples,
sigma=self.sigma,
alpha=self.alpha,
Expand All @@ -95,6 +107,13 @@ def __post_init__(self) -> None:

def report(self, accuracy: Optional[float] = None) -> str:
metric_name = self.metric_name.upper()
if self.stderr is not None and self.stderr > 0:
stderr_line = (
f"\nAnchor {self.metric_name}: {self.ref_accuracy_anchor:.3f}"
f" (adjusted by {STDERR_MARGIN_SIGMAS:.1f}sigma * stderr={self.stderr:.3f})"
)
else:
stderr_line = ""
report = f"""===========================================================
= {metric_name} HYPOTHESIS TESTING
===========================================================
Expand All @@ -104,7 +123,7 @@ def report(self, accuracy: Optional[float] = None) -> str:
#Samples: {self.num_samples}
Higher is better: {self.higher_is_better}
Theta (Minimum detectable effect): {self.theta:.3f}
Reference {self.metric_name}: {self.ref_accuracy:.3f}
Reference {self.metric_name}: {self.ref_accuracy:.3f}{stderr_line}
Threshold: {self.threshold:.3f}
==========================================================="""
if accuracy is not None:
Expand Down Expand Up @@ -190,7 +209,8 @@ def get_hypothesis_testing_params(self,
sigma=entry.get("sigma", self.SIGMA),
num_samples=entry.get("num_samples", self.NUM_SAMPLES),
higher_is_better=entry.get("higher_is_better",
self.HIGHER_IS_BETTER))
self.HIGHER_IS_BETTER),
stderr=entry.get("stderr"))

def evaluate(self,
llm: Union[PyTorchLLM, AutoDeployLLM],
Expand Down
11 changes: 8 additions & 3 deletions tests/integration/defs/accuracy/references/gsm8k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,16 @@ deepseek-ai/DeepSeek-V4-Pro:
spec_dec_algo: MTP
accuracy: 96.0
# Full GSM8K DEP8 DSpark path: TP=8, EP=8, attention DP, MegaMoE DeepGEMM,
# and max_draft_len=5. Measured 96.475 on 1319 samples; floor set to 96.0
# for run-to-run margin.
# and max_draft_len=5. Author-anchor 96.475 on 1319 samples with lm-eval
# reporting per-metric stderr ~0.55; observed spread across runs
# 95.94..96.55 tracks that stderr. accuracy_core subtracts 2*stderr from
# the anchor for the strict floor (95.375), so single-run tails no longer
# trip the outer gate (nvbugs/6506920). The hypothesis-testing threshold
# (~92.3) remains the primary regression gate.
- quant_algo: FP8_BLOCK_SCALES
spec_dec_algo: DSpark
accuracy: 96.0
accuracy: 96.475
stderr: 0.55
Qwen3/Qwen3-4B:
- spec_dec_algo: Eagle
accuracy: 85.823
Expand Down
1 change: 0 additions & 1 deletion tests/integration/test_lists/waives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ full:B300/disaggregated/test_auto_scaling.py::test_service_discovery[http-kv_cac
full:B300/disaggregated/test_disaggregated.py::test_disaggregated_ctxpp2_genpp2[TinyLlama-1.1B-Chat-v1.0] SKIP (https://nvbugs/6322073)
full:B300/test_e2e.py::test_qwen_e2e_cpprunner_large_new_tokens[DeepSeek-R1-Distill-Qwen-1.5B-DeepSeek-R1-Distill-Qwen-1.5B] SKIP (https://nvbugs/6414760)
full:DGX_B200/accuracy/test_disaggregated_serving.py::TestQwen3NextInstruct::test_auto_dtype[use_py_transceiver=True] SKIP (https://nvbugs/6501837)
full:DGX_B200/accuracy/test_llm_api_pytorch.py::TestDeepSeekV4ProDSpark::test_gsm8k_dep8_megamoe_deepgemm SKIP (https://nvbugs/6506920)
full:DGX_H100/unittest/_torch/multi_gpu/test_linear.py::test_column_linear[2-unbalanced] SKIP (https://nvbugs/6506918)
full:DGX_H200/accuracy/test_llm_api_pytorch.py::TestDeepSeekV32::test_fp8_blockscale[disable_skip_indexer] SKIP (https://nvbugs/6476233)
full:DGX_H200/accuracy/test_llm_api_pytorch.py::TestDeepSeekV32::test_fp8_blockscale[latency_default] SKIP (https://nvbugs/6476233)
Expand Down
Loading