MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / Correctness

Class Correctness

src/sol_execbench/core/data/trace.py:27–55  ·  view source on GitHub ↗

Correctness metrics from numerical evaluation. Contains error measurements comparing the solution output against a reference implementation to assess numerical accuracy. When the output contains non-finite values, ``max_absolute_error`` and ``max_relative_error`` are set to ``0.0``

Source from the content-addressed store, hash-verified

25
26
27class Correctness(BaseModelWithDocstrings):
28 """Correctness metrics from numerical evaluation.
29
30 Contains error measurements comparing the solution output against
31 a reference implementation to assess numerical accuracy.
32
33 When the output contains non-finite values, ``max_absolute_error`` and
34 ``max_relative_error`` are set to ``0.0`` (since no meaningful error
35 metric can be computed) and one of ``has_nan`` / ``has_inf`` is set to
36 ``True`` to signal the reason.
37 """
38
39 max_relative_error: float = Field(default=0.0)
40 """Maximum relative error observed across all output elements."""
41 max_absolute_error: float = Field(default=0.0)
42 """Maximum absolute error observed across all output elements."""
43 has_nan: bool = Field(default=False)
44 """True when the solution or reference output contains NaN values."""
45 has_inf: bool = Field(default=False)
46 """True when the solution or reference output contains Inf values (but no NaN)."""
47 extra: Optional[dict[str, Any]] = Field(default=None)
48 """Extra metrics for correctness evaluation."""
49
50 @field_validator("max_relative_error", "max_absolute_error")
51 @classmethod
52 def non_negative(cls, v: float):
53 if v < 0:
54 raise ValueError("must be non-negative")
55 return v
56
57
58class Performance(BaseModelWithDocstrings):

Callers 3

check_tensor_sanityFunction · 0.90
compute_error_statsFunction · 0.90
eval_driver.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected