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

Method generate_config

utils/tune_gemm_config.py:37–50  ·  view source on GitHub ↗

Generate new configuration file with simplified format

(self, act_parallel, row_block_size, col_block_size, parallel_size)

Source from the content-addressed store, hash-verified

35 shutil.copy2(self.backup_path, self.config_path)
36
37 def generate_config(self, act_parallel, row_block_size, col_block_size, parallel_size):
38 """Generate new configuration file with simplified format"""
39 content = ""
40
41 # Simplified configuration format
42 if act_parallel:
43 content += "#define ACT_PARALLEL\n"
44
45 content += f"#define ROW_BLOCK_SIZE {row_block_size}\n"
46 content += f"#define COL_BLOCK_SIZE {col_block_size}\n"
47 content += f"#define PARALLEL_SIZE {parallel_size}\n"
48
49 with open(self.config_path, 'w') as f:
50 f.write(content)
51
52 def rebuild_project(self):
53 """Rebuild project"""

Callers 2

test_configurationMethod · 0.95
run_tuningMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by 1

test_configurationMethod · 0.76