Smelt is a simple and extensible task runner optimized for chip development workflows. Smelt makes it easy to programmatically define arbitrarily many test variants, run those tests in parallel, and analyze their results. Smelt provides simple and efficient workflows to both local and distributed compute contexts.
Smelt is distributed as a Python package and can be installed via:
pipx install pysmelt
With smelt installed, you can describe a test list using a simple YAML
schema in a file with a .smelt.yaml
extension or procedurally with Python.
A snippet of a Python testlist from yves:
num_branches = 1024
bhist_iterations = 10000
branch_tests = []
for size in [2**n for n in range(12)]:
# This rule compiles a file and can be run in parallel
benchmark = compile_local_ubench_zig(
name=f"directional_branch_history_{size}",
compiler_path=compiler_path,
benchmark_path=branch_hist,
ubench_parameters={
"INNER_ITERATIONS": size,
"ITERATIONS": bhist_iterations,
"NUM_BRANCHES": num_branches,
},
compiler_target=cpp_compiler.as_ref,
)
bench_bin = benchmark.get_outputs()["binary"]
# This is a test that benchmarks the local system, and should exhibit no parallelism, to avoid crosstalk
bench = local_benchmark(
name=f"directional_branch_history_{size}_local",
profiler_path=profiler_bin,
benchmark_path=bench_bin,
metadata={
"BRANCHES_OBSERVED": size * num_branches * bhist_iterations,
"HISTORY": size,
},
)
branch_tests.append(bench)
dbh = test_group(name="directional_branch_history_sweep", tests=branch_tests)
ftcg = test_group(name="all_frontend_tests", tests=[dbh.as_ref])
You can define a hierarchical test group that depends on these tests and others:
- name: all_tests
rule: test_group
rule_args:
tests:
- //benches/memory/loadtouse_tl.py:all_mem_tests
- //benches/midcore/bandwidths_etc.py:all_mc_tests
- //benches/frontend/frontend_tl.py:all_frontend_tests
Smelt will execute these tests with as much parallelism as possible:
Features
Smelt is designed to make running multiple tasks as simple as possible. To achieve this, each command under smelt creates a bash script that can be inspected, re-run, and modified.
Built for EDA (electronic design automation), smelt seeks to unify the "best practices" for testing infrastructure:
- Procedural test generation: Programatically generate tests with Python
- Automatic rerun on failure: Describe the computation required to re-run failing tests
- Analysis APIs: All of the data needed to track and reproduce tests
- Extensible: Define your tests with a simple Python interface