MCPcopy Create free account
hub / github.com/microsoft/BitNet / run_benchmark

Method run_benchmark

utils/tune_gemm_config.py:66–91  ·  view source on GitHub ↗

Run benchmark test

(self)

Source from the content-addressed store, hash-verified

64 return True
65
66 def run_benchmark(self):
67 """Run benchmark test"""
68 cmd = [
69 f"{self.build_dir}/bin/llama-bench",
70 "-m", self.model_path,
71 "-p", "128",
72 "-n", "0",
73 "-t", str(self.threads),
74 "-ngl", "0"
75 ]
76
77 print(f"⚡ Running benchmark: {' '.join(cmd)}")
78
79 result = subprocess.run(
80 cmd,
81 capture_output=True,
82 text=True,
83 cwd=os.getcwd(),
84 timeout=300 # 5分钟超时
85 )
86
87 if result.returncode != 0:
88 print(f"❌ Benchmark failed: {result.stderr}")
89 return None
90
91 return result.stdout
92
93 def parse_throughput(self, output):
94 """Parse pp128 throughput from output"""

Callers 1

test_configurationMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_configurationMethod · 0.76