Smelt는 칩 개발 워크플로 (workflows)에 최적화된 단순하고 확장 가능한 태스크 러너 (task runner)입니다. Smelt를 사용하면 임의의 수만큼 테스트 변형 (test variants)을 프로그래밍 방식으로 쉽게 정의하고, 이러한 테스트를 병렬로 실행하며, 그 결과를 분석할 수 있습니다. Smelt는 로컬 및 분산 컴퓨팅 환경 (distributed compute contexts) 모두에 단순하고 효율적인 워크플로를 제공합니다.
Smelt는 Python 패키지로 배포되며 다음과 같이 설치할 수 있습니다:
pipx install pysmelt
Smelt가 설치되면, .smelt.yaml 확장자를 가진 파일 내의 단순한 YAML 스키마 (schema)를 사용하거나 Python을 사용하여 절차적으로 테스트 목록을 기술할 수 있습니다.
yves의 Python 테스트 목록 (testlist) 스니펫 (snippet):
num_branches = 1024
bhist_iterations = 10000
branch_tests = []
for size in [2**n for n in range(12)]:
이 규칙은 파일을 컴파일하며 병렬로 실행될 수 있습니다
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"]
이것은 로컬 시스템을 벤치마크하는 테스트이며, 간섭 (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])
이러한 테스트 및 다른 테스트들에 의존하는 계층적 테스트 그룹 (hierarchical test group)을 정의할 수 있습니다:
- 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는 가능한 한 많은 병렬성을 사용하여 이러한 테스트를 실행합니다:
주요 기능 (Features)
Smelt는 여러 작업을 실행하는 과정을 가능한 한 단순하게 만들도록 설계되었습니다. 이를 달성하기 위해, smelt 아래의 각 명령은 검사, 재실행 및 수정이 가능한 bash 스크립트를 생성합니다.
EDA (electronic design automation, 전자 설계 자동화)를 위해 구축된 smelt는 테스트 인프라를 위한 "모범 사례 (best practices)"를 통합하고자 합니다:
- 절차적 테스트 생성 (Procedural test generation): Python을 사용하여 프로그래밍 방식으로 테스트를 생성
- 실패 시 자동 재실행 (Automatic rerun on failure): 실패한 테스트를 재실행하는 데 필요한 계산 과정을 기술
- 분석 API (Analysis APIs): 테스트를 추적하고 재현하는 데 필요한 모든 데이터 제공
- 확장 가능성 (Extensible): 단순한 Python 인터페이스로 테스트 정의