Overview
- code read xml file and memory allocation file to generate
nx.Digraph
with node attributes: 'bank' and 'op'.panorama.py
->load_graph()
- code partition the graph with
num_cluster
clustersmain.py
->dfg_partition()
- code add virtual load and store nodes for cross-cluster edges. For multiple edges sharing the same source vertex, only one virtual store node will be added.
- code Repeatedly try merge two small clusters and generate memory allocation (to port) for all load\store nodes, virtual nodes included.
main.py
->merge()
- In 2-4, cluster size, memory nodes in one cluster and cluster-level cycles are checked, if fails, increase the
num_cluster
and repeat 2-4. In 4, if there is no valid memory node mapping, increase thenum_cluster
and repeat 2-4. - For a valid partition, add select node for each cluster (cluster inherently with select node are excluded), connect the select node with all load and store nodes, virtual included.
main.py
->add_select()
, - code dump each cluster to xml file.
main.py
->dump_to_xml()
Function:
- Allows a big DFG to be partitioned into multiple cluster, with store and load nodes added to pass intermediate result for cross cluster edges.
- Ensures no cycles among clusters.
- Ensures a valid memory allocation for intermediate values. The memory node placement can be seen in 'log.txt' and 'memPE_alloc.txt"
Configs:
- Shuffled the candidate ports during searching to avoid congestion in one memory bank. See
map_one()
in main.py - To modify the output format, check main.py line 334, function ‘dump_to_xml’.
- To disable array splitting (randomly choose bank [variable_address\bank_size] or [variable_address\bank_size + 1]), go panorama.py, line 62. Comment out “+ random.randint(0,1)”
- As the clustering algorithm also has randomness, uncomment panorama.py, line 12-13, to ensure reproducibility. Also, you can comment out and run multiple times to get more results.