Commit 59c6745c by zhengzifu

update fsm

parent f70b8997
......@@ -80,7 +80,7 @@ def generate_module(
"fsm_rstn": "rstn",
"LM_sel": "LM_sel",
"Top_in": "Top_in",
"WT_result_acc": f"WT_result_acc[{i}*VN:{i + 1}*VN-1]",
"WT_result_acc": f"WT_result_acc[{i + 1}*VN-1:{i}*VN]",
"result_valid": f"result_valid_all[{i}]",
}
add_instance(
......@@ -103,8 +103,8 @@ def process_task(i, name, weights_file_name, matrix, H, L, VN, config: CFG):
WW = calculate_WW(matrix, config.value_range)
file_dir = os.path.join(config.output_dir, name, weights_file_name)
os.makedirs(file_dir, exist_ok=True)
file_name = os.path.join(file_dir, f"{name}_tp_{weights_file_name}_vc_{i}.sv")
module_name = f"{name}_tp_{weights_file_name}_vc_{i}"
file_name = os.path.join(file_dir, f"{name}_tp_{weights_file_name}.sv")
module_name = f"{name}_tp_{weights_file_name}"
with open(file_name, "w") as f:
f.write(
generate_module(
......
......@@ -80,7 +80,7 @@ def generate_module(
"fsm_rstn": "rstn",
"LM_sel": "LM_sel",
"Top_in": "Top_in",
"WT_result_acc": f"WT_result_acc[{i}*VN:{i + 1}*VN-1]",
"WT_result_acc": f"WT_result_acc[{i + 1}*VN-1:{i}*VN]",
"result_valid": f"result_valid_all[{i}]",
}
add_instance(
......@@ -103,8 +103,8 @@ def process_task(i, name, weights_file_name, matrix, H, L, VN, config: CFG):
WW = calculate_WW(matrix, config.value_range)
file_dir = os.path.join(config.output_dir, name, weights_file_name)
os.makedirs(file_dir, exist_ok=True)
file_name = os.path.join(file_dir, f"{name}_tp_{weights_file_name}_vc_{i}.sv")
module_name = f"{name}_tp_{weights_file_name}_vc_{i}"
file_name = os.path.join(file_dir, f"{name}_tp_{weights_file_name}.sv")
module_name = f"{name}_tp_{weights_file_name}"
with open(file_name, "w") as f:
f.write(
generate_module(
......
......@@ -15,14 +15,14 @@ def run_origin(config: CFG):
import hllm.origin.generate_fsm_wrapper as generate_fsm_wrapper
config.output_dir = "outputs-qwen/origin"
# generate_ww.run(name="WW", config=config)
# generate_layer_mux.run(name="Layer_mux", config=config)
# generate_hn.run(name="HN", config=config)
generate_ww.run(name="WW", config=config)
generate_layer_mux.run(name="Layer_mux", config=config)
generate_hn.run(name="HN", config=config)
# generate_sub_wrapper.run(name="Sub_wrapper", config=config)
# generate_wallace.run(name="SerialWallaceTree", config=config)
generate_sub_wrapper.run(name="Sub_wrapper", config=config)
generate_wallace.run(name="SerialWallaceTree", config=config)
# generate_wrappers.run(name="Wrappers", config=config)
# generate_wt_group.run(name="WT_group", config=config)
generate_wt_group.run(name="WT_group", config=config)
generate_mid_wrapper.run(name="Mid_wrapper", config=config)
generate_fsm.run(name="FSM", config=config)
generate_fsm_wrapper.run(name="FSM_wrapper", config=config)
......@@ -79,7 +79,7 @@ def batch_run(config: CFG):
config.run_weights = config.run_weights_batch[i]
config.group_number = config.group_numbers_batch[i]
run_origin(config)
run_optimized(config)
# run_optimized(config)
run_verify(config)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment