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

Class Workload

src/sol_execbench/core/data/workload.py:102–143  ·  view source on GitHub ↗

Concrete workload configuration for benchmarking. Defines a specific instance of a computational workload with concrete values for all variable axes and specifications for all input data. This represents an executable configuration that can be benchmarked.

Source from the content-addressed store, hash-verified

100
101
102class Workload(BaseModelWithDocstrings):
103 """Concrete workload configuration for benchmarking.
104
105 Defines a specific instance of a computational workload with concrete
106 values for all variable axes and specifications for all input data.
107 This represents an executable configuration that can be benchmarked.
108 """
109
110 axes: dict[str, NonNegativeInt]
111 """Dictionary mapping axis names to their concrete integer values. All values must be
112 positive."""
113 inputs: dict[str, InputSpec]
114 """Dictionary mapping input names to their data specifications."""
115 uuid: NonEmptyString
116 """Unique identifier for this specific workload configuration."""
117 tolerance: ToleranceSpec = Field(default=ToleranceSpec())
118 """Tolerance specification for the workload."""
119
120 @model_validator(mode="after")
121 def _validate_inputs(self) -> Workload:
122 custom_inputs = [
123 name
124 for name, input in self.inputs.items()
125 if isinstance(input, CustomInput)
126 ]
127 non_custom_inputs = [
128 name
129 for name, input in self.inputs.items()
130 if not isinstance(input, CustomInput)
131 ]
132 if len(custom_inputs) > 0 and len(non_custom_inputs) > 0:
133 raise ValueError(
134 f"A workload cannot have both custom and non-custom inputs. Custom: {custom_inputs}. Non-custom: {non_custom_inputs}"
135 )
136 return self
137
138 def get_scalar_inputs(self) -> dict[str, int]:
139 return {
140 name: input.value
141 for name, input in self.inputs.items()
142 if isinstance(input, ScalarInput)
143 }

Calls 1

ToleranceSpecClass · 0.85

Tested by 12

_load_sampleFunction · 0.72
test_reward_hack_e2eFunction · 0.72
_wklFunction · 0.72
_make_workloadFunction · 0.72
workloadsFunction · 0.72
_load_exampleFunction · 0.72