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

Method test_configuration

utils/tune_gemm_config.py:110–151  ·  view source on GitHub ↗

Test single configuration

(self, act_parallel, row_block_size, col_block_size, parallel_size)

Source from the content-addressed store, hash-verified

108 return None
109
110 def test_configuration(self, act_parallel, row_block_size, col_block_size, parallel_size):
111 """Test single configuration"""
112 config_name = f"ACT_{'ON' if act_parallel else 'OFF'}_R{row_block_size}_C{col_block_size}_P{parallel_size}"
113 print(f"\n{'='*80}")
114 print(f"🧪 Testing configuration: {config_name}")
115 print(f" ACT_PARALLEL: {act_parallel}")
116 print(f" ROW_BLOCK_SIZE: {row_block_size}")
117 print(f" COL_BLOCK_SIZE: {col_block_size}")
118 print(f" PARALLEL_SIZE: {parallel_size}")
119 print(f"{'='*80}")
120
121 # Generate configuration
122 self.generate_config(act_parallel, row_block_size, col_block_size, parallel_size)
123
124 # Rebuild project
125 if not self.rebuild_project():
126 print("⚠️ Build failed, skipping this configuration")
127 return None
128
129 # Run benchmark test
130 output = self.run_benchmark()
131 if output is None:
132 return None
133
134 # Parse results
135 metrics = self.parse_throughput(output)
136
137 if metrics is not None:
138 result = {
139 'act_parallel': act_parallel,
140 'row_block_size': row_block_size,
141 'col_block_size': col_block_size,
142 'parallel_size': parallel_size,
143 'config_name': config_name,
144 **metrics
145 }
146 self.results.append(result)
147 print(f"✅ PP128: {metrics['pp_throughput']:.2f} ± {metrics['pp_std_dev']:.2f} t/s")
148 return result
149 else:
150 print("❌ Failed to parse throughput")
151 return None
152
153 def save_results(self, csv_path):
154 """Save results to CSV file"""

Callers 1

run_tuningMethod · 0.95

Calls 4

generate_configMethod · 0.95
rebuild_projectMethod · 0.95
run_benchmarkMethod · 0.95
parse_throughputMethod · 0.95

Tested by

no test coverage detected