fhelium.benchmarks.v1.model
Strict data model for the immutable FHElium Benchmark v1 specification.
BENCHMARK_VERSION
constant View source
BENCHMARK_VERSION = 'v1'CaseStatus
class View source
CaseStatus()Bases: StrEnum
Lifecycle state of one Benchmark v1 case.
Attributes
| Name | Type | Default/value |
|---|---|---|
PENDING | 'pending' | |
RUNNING | 'running' | |
MEASURED | 'measured' | |
UNAVAILABLE | 'unavailable' | |
FAILED | 'failed' | |
INTERRUPTED | 'interrupted' |
ReportStatus
class View source
ReportStatus()Bases: StrEnum
Lifecycle state of one Benchmark v1 report.
Attributes
| Name | Type | Default/value |
|---|---|---|
RUNNING | 'running' | |
COMPLETED | 'completed' | |
FAILED | 'failed' | |
INTERRUPTED | 'interrupted' |
ExecutionBackend
class View source
ExecutionBackend()Bases: StrEnum
Native execution backend selected for one complete v1 run.
Attributes
| Name | Type | Default/value |
|---|---|---|
CPU | 'cpu' | |
CUDA | 'cuda' |
BenchmarkExecution
class View source
BenchmarkExecution(backend: ExecutionBackend, device: str)Report-level backend and indexed device shared by every v1 case.
Attributes
| Name | Type | Default/value |
|---|---|---|
backend | ExecutionBackend | |
device | str |
to_dict
method
def to_dict() -> dict[str, str]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> BenchmarkExecution: ...BenchmarkCase
class View source
BenchmarkCase(id: str, title: str, category: str, benchmark: str, workload_id: str, profile: str | None = None, parameters: Mapping[str, Any] = field(default_factory=dict), requirements: Mapping[str, Any] = field(default_factory=dict), comparison: Mapping[str, Any] = field(default_factory=dict), unavailable_reason: str | None = None)One fixed leaf-benchmark invocation in Benchmark v1.
parameters overrides the selected leaf profile. The v1 resolver records the resulting effective parameter object in its canonical manifest and in every case record. unavailable_reason declares a deterministic manifest-level absence; runners can additionally raise fhelium.benchmarks.v1.BenchmarkCaseUnavailable after preflight.
Attributes
| Name | Type | Default/value |
|---|---|---|
id | str | |
title | str | |
category | str | |
benchmark | str | |
workload_id | str | |
profile | str | None | None |
parameters | Mapping[str, Any] | field(default_factory=dict) |
requirements | Mapping[str, Any] | field(default_factory=dict) |
comparison | Mapping[str, Any] | field(default_factory=dict) |
unavailable_reason | str | None | None |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> BenchmarkCase: ...BenchmarkSpecification
class View source
BenchmarkSpecification(benchmark_version: str, title: str, description: str, cases: tuple[BenchmarkCase, ...])The ordered, immutable Benchmark v1 case specification.
Attributes
| Name | Type | Default/value |
|---|---|---|
benchmark_version | str | |
title | str | |
description | str | |
cases | tuple[BenchmarkCase, ...] |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> BenchmarkSpecification: ...ProbeError
class View source
ProbeError(probe: str, error_type: str, message: str)Non-fatal error from an optional platform-information probe.
Attributes
| Name | Type | Default/value |
|---|---|---|
probe | str | |
error_type | str | |
message | str |
to_dict
method
def to_dict() -> dict[str, str]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> ProbeError: ...FHEliumBuildIdentity
class View source
FHEliumBuildIdentity(version: str, distribution: Mapping[str, Any], source_git: Mapping[str, Any], native: Mapping[str, Any])FHElium distribution, source, and native-build provenance.
Attributes
| Name | Type | Default/value |
|---|---|---|
version | str | |
distribution | Mapping[str, Any] | |
source_git | Mapping[str, Any] | |
native | Mapping[str, Any] |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> FHEliumBuildIdentity: ...PlatformSnapshot
class View source
PlatformSnapshot(system: Mapping[str, Any], cpu: Mapping[str, Any], memory: Mapping[str, Any], python: Mapping[str, Any], fhelium_build: FHEliumBuildIdentity, torch: Mapping[str, Any], cuda: Mapping[str, Any], environment: Mapping[str, Any], invocation: tuple[str, ...], probe_errors: tuple[ProbeError, ...] = ())Normalized hardware, runtime, build, and invocation provenance.
Attributes
| Name | Type | Default/value |
|---|---|---|
system | Mapping[str, Any] | |
cpu | Mapping[str, Any] | |
memory | Mapping[str, Any] | |
python | Mapping[str, Any] | |
fhelium_build | FHEliumBuildIdentity | |
torch | Mapping[str, Any] | |
cuda | Mapping[str, Any] | |
environment | Mapping[str, Any] | |
invocation | tuple[str, ...] | |
probe_errors | tuple[ProbeError, ...] | () |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> PlatformSnapshot: ...CaseUnavailable
class View source
CaseUnavailable(reason: str, details: Mapping[str, Any] = field(default_factory=dict))Structured explanation for a case that cannot be measured.
Attributes
| Name | Type | Default/value |
|---|---|---|
reason | str | |
details | Mapping[str, Any] | field(default_factory=dict) |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> CaseUnavailable: ...CaseFailure
class View source
CaseFailure(stage: str, error_type: str, message: str, traceback: tuple[str, ...])Structured exception information retained in a Benchmark v1 run.
Attributes
| Name | Type | Default/value |
|---|---|---|
stage | str | |
error_type | str | |
message | str | |
traceback | tuple[str, ...] |
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> CaseFailure: ...CaseRecord
class View source
CaseRecord(id: str, title: str, category: str, benchmark: str, workload_id: str, profile: str, parameters: Mapping[str, Any], requirements: Mapping[str, Any], comparison: Mapping[str, Any], status: CaseStatus = CaseStatus.PENDING, started_at: str | None = None, finished_at: str | None = None, result: BenchmarkResult | None = None, unavailable: CaseUnavailable | None = None, failure: CaseFailure | None = None)Resolved case identity, execution state, and optional leaf result.
Attributes
| Name | Type | Default/value |
|---|---|---|
id | str | |
title | str | |
category | str | |
benchmark | str | |
workload_id | str | |
profile | str | |
parameters | Mapping[str, Any] | |
requirements | Mapping[str, Any] | |
comparison | Mapping[str, Any] | |
status | CaseStatus | CaseStatus.PENDING |
started_at | str | None | None |
finished_at | str | None | None |
result | BenchmarkResult | None | None |
unavailable | CaseUnavailable | None | None |
failure | CaseFailure | None | None |
validate_state
method
def validate_state() -> None: ...Reject contradictory terminal-state payloads.
to_dict
method
def to_dict() -> dict[str, Any]: ...from_dict
method
def from_dict(payload: Mapping[str, Any]) -> CaseRecord: ...BenchmarkReport
class View source
BenchmarkReport(benchmark_version: str, manifest_sha256: str, execution: BenchmarkExecution, platform: PlatformSnapshot, started_at: str, finished_at: str | None, status: ReportStatus, cases: list[CaseRecord])Outer report for one complete or checkpointed Benchmark v1 run.
benchmark_version versions the entire Benchmark specification. FHElium, Python, Torch, CUDA, and native-build versions remain platform provenance. No total or composite score is defined.
Attributes
| Name | Type | Default/value |
|---|---|---|
benchmark_version | str | |
manifest_sha256 | str | |
execution | BenchmarkExecution | |
platform | PlatformSnapshot | |
started_at | str | |
finished_at | str | None | |
status | ReportStatus | |
cases | list[CaseRecord] |
requires_nonzero_exit
property
requires_nonzero_exit: boolWhether a CLI should fail due to failure or interruption.
suggested_exit_code
property
suggested_exit_code: intReturn the decision for a CLI without exiting the process.
to_dict
method
def to_dict() -> dict[str, Any]: ...validate_state
method
def validate_state() -> None: ...Reject contradictory report lifecycle and outcome fields.
from_dict
method
def from_dict(payload: Mapping[str, Any]) -> BenchmarkReport: ...