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

Function cli

src/sol_execbench/cli/main.py:230–390  ·  view source on GitHub ↗

Evaluate a SOL-ExecBench solution on GPU. \b Two ways to specify the problem: 1) Positional: sol-execbench --solution sol.json (reads definition.json and workload.jsonl from problem_dir) 2) Explicit: sol-execbench --definition def.json --workload wkl.jso

(
    problem_dir: Optional[Path],
    definition_file: Optional[Path],
    workload_file: Optional[Path],
    solution_file: Path,
    config_file: Optional[Path],
    compile_timeout: int,
    timeout: int,
    output_file: Optional[Path],
    json_output: bool,
    lock_clocks: bool,
    keep_staging: bool,
    verbose: bool,
)

Source from the content-addressed store, hash-verified

228)
229@click.option("--verbose", "-v", is_flag=True, help="Show subprocess output")
230def cli(
231 problem_dir: Optional[Path],
232 definition_file: Optional[Path],
233 workload_file: Optional[Path],
234 solution_file: Path,
235 config_file: Optional[Path],
236 compile_timeout: int,
237 timeout: int,
238 output_file: Optional[Path],
239 json_output: bool,
240 lock_clocks: bool,
241 keep_staging: bool,
242 verbose: bool,
243):
244 """Evaluate a SOL-ExecBench solution on GPU.
245
246 \b
247 Two ways to specify the problem:
248 1) Positional: sol-execbench <problem_dir> --solution sol.json
249 (reads definition.json and workload.jsonl from problem_dir)
250 2) Explicit: sol-execbench --definition def.json --workload wkl.jsonl --solution sol.json
251 """
252 # Resolve definition + workloads
253 if problem_dir:
254 def_path, wkl_path, cfg_path, sol_path = _resolve_problem_dir(problem_dir)
255 definition_file = definition_file or def_path
256 workload_file = workload_file or wkl_path
257 config_file = config_file or cfg_path
258 solution_file = solution_file or sol_path
259
260 if not definition_file:
261 raise click.ClickException("Provide PROBLEM_DIR or --definition")
262 if not workload_file:
263 raise click.ClickException("Provide PROBLEM_DIR or --workload")
264 if not solution_file:
265 raise click.ClickException(
266 "Provide PROBLEM_DIR with solution.json or --solution"
267 )
268
269 # Load data models
270 definition = _load_definition(definition_file)
271 workloads = _load_workloads(workload_file)
272 solution = _load_solution(solution_file)
273 config = _load_config(config_file)
274
275 if lock_clocks:
276 config.lock_clocks = True
277
278 console.print(f"[bold]Problem:[/bold] {definition.name}")
279 console.print(f"[bold]Solution:[/bold] {solution.name}")
280 console.print(f"[bold]Workloads:[/bold] {len(workloads)}")
281 if config_file:
282 console.print(
283 f"[bold]Config:[/bold] {json.dumps(dataclasses.asdict(config))}"
284 )
285
286 # Create staging directory
287 staging_dir = Path(tempfile.mkdtemp(prefix="sol_execbench_"))

Callers 1

main.pyFile · 0.85

Calls 10

compileMethod · 0.95
executeMethod · 0.95
_resolve_problem_dirFunction · 0.85
_load_definitionFunction · 0.85
_load_workloadsFunction · 0.85
_load_solutionFunction · 0.85
_load_configFunction · 0.85
ProblemPackagerClass · 0.85
_print_traces_tableFunction · 0.85

Tested by

no test coverage detected