Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
HN-CodeGen
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengzifu
HN-CodeGen
Commits
59c6745c
Commit
59c6745c
authored
Apr 29, 2025
by
zhengzifu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update fsm
parent
f70b8997
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
hllm/optimized/generate_fsm_wrapper.py
+3
-3
hllm/origin/generate_fsm_wrapper.py
+3
-3
main.py
+7
-7
No files found.
hllm/optimized/generate_fsm_wrapper.py
View file @
59c6745c
...
...
@@ -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
(
...
...
hllm/origin/generate_fsm_wrapper.py
View file @
59c6745c
...
...
@@ -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
(
...
...
main.py
View file @
59c6745c
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment