Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Multithreading support for gold #529

Merged
merged 47 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
eb9411b
working solution
simon1hofmann Aug 30, 2024
c0ffd5b
Merge branch 'cda-tum:main' into gold_cost_functions
simon1hofmann Aug 30, 2024
7052f8c
:memo: Update pyfiction docstrings
actions-user Aug 30, 2024
0cfac62
Merge branch 'cda-tum:main' into gold_cost_functions
simon1hofmann Sep 3, 2024
a228dfb
structure
simon1hofmann Sep 3, 2024
05e474a
Merge remote-tracking branch 'origin/gold_cost_functions' into gold_c…
simon1hofmann Sep 3, 2024
152a335
cost objectives
simon1hofmann Sep 9, 2024
470771d
:memo: Update pyfiction docstrings
actions-user Sep 9, 2024
d999c8f
add bindings
simon1hofmann Sep 9, 2024
8d1173c
clean-up
simon1hofmann Sep 9, 2024
f11e096
benchmark
simon1hofmann Sep 9, 2024
c1a4fc0
:memo: Update pyfiction docstrings
actions-user Sep 9, 2024
1deb773
Merge branch 'main' into gold_cost_functions
simon1hofmann Sep 9, 2024
5203e35
increase coverage
simon1hofmann Sep 9, 2024
6dcaa86
Merge remote-tracking branch 'origin/gold_cost_functions' into gold_c…
simon1hofmann Sep 9, 2024
ca245c5
clang-tidy
simon1hofmann Sep 9, 2024
e777d29
small fix
simon1hofmann Sep 10, 2024
c205b2a
code review
simon1hofmann Sep 13, 2024
c2b7556
:memo: Update pyfiction docstrings
actions-user Sep 13, 2024
4d78d12
Merge branch 'main' into gold_cost_functions
simon1hofmann Sep 13, 2024
bba3919
bug fixes
simon1hofmann Sep 13, 2024
c67585b
Merge remote-tracking branch 'origin/gold_cost_functions' into gold_c…
simon1hofmann Sep 13, 2024
244f152
:memo: Update pyfiction docstrings
actions-user Sep 13, 2024
c26e5db
formatting
simon1hofmann Sep 13, 2024
7abf365
missing header
simon1hofmann Sep 13, 2024
27199a4
100% test coverage
simon1hofmann Sep 13, 2024
d13581f
more tests
simon1hofmann Sep 13, 2024
32a63f3
multithreading
simon1hofmann Sep 23, 2024
af4ee2a
:memo: Update pyfiction docstrings
actions-user Sep 23, 2024
584f824
Merge branch 'main' into gold_multithreading
simon1hofmann Sep 23, 2024
c8823a5
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 23, 2024
71e119c
Update graph_oriented_layout_design.cpp
simon1hofmann Sep 23, 2024
8cb66fe
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 23, 2024
8ff9a94
Update graph_oriented_layout_design.cpp
simon1hofmann Sep 23, 2024
6abf906
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 23, 2024
430008a
Update network_blueprints.hpp
simon1hofmann Sep 23, 2024
8eead9a
use atomics instead of mutex
simon1hofmann Sep 24, 2024
e9b4960
:memo: Update pyfiction docstrings
actions-user Sep 24, 2024
23b4ab8
rerun benchmarks
simon1hofmann Sep 25, 2024
ee0393e
remove empty statement
simon1hofmann Sep 25, 2024
06cb113
Jan's feedback
simon1hofmann Sep 26, 2024
344c138
Apply suggestions from code review
simon1hofmann Oct 7, 2024
ea21dc4
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 7, 2024
8e0e6d6
Merge branch 'main' into gold_multithreading
simon1hofmann Oct 7, 2024
96b281f
:memo: Update pyfiction docstrings
actions-user Oct 7, 2024
7da09c2
Feedback from Marcel
simon1hofmann Oct 7, 2024
949d7ce
:memo: Update pyfiction docstrings
actions-user Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -70,8 +70,8 @@ inline void graph_oriented_layout_design(pybind11::module& m)
DOC(fiction_graph_oriented_layout_design_params_return_first))
.def_readwrite("planar", &fiction::graph_oriented_layout_design_params::planar,
DOC(fiction_graph_oriented_layout_design_params_planar))

;
.def_readwrite("enable_multithreading", &fiction::graph_oriented_layout_design_params::enable_multithreading,
DOC(fiction_graph_oriented_layout_design_params_enable_multithreading));

py::class_<fiction::graph_oriented_layout_design_stats>(m, "graph_oriented_layout_design_stats",
DOC(fiction_graph_oriented_layout_design_stats))
32 changes: 30 additions & 2 deletions bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
Original file line number Diff line number Diff line change
@@ -6094,8 +6094,6 @@ static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_max_pl

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_ntk = R"doc(The network to be placed and routed.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_evaluated_paths = R"doc(Count evaluated paths in the search space graphs.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_search_space_graphs = R"doc(Number of search space graphs.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_search_space_graphs_high_efficiency = R"doc(In high-efficiency mode, only 2 search space graphs are used)doc";
@@ -6200,6 +6198,14 @@ static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_start

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_timeout = R"doc(Timeout limit (in ms).)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_timeout_limit_reached = R"doc(Timeout limit reached.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_update_stats =
R"doc(This function updates statistical metrics.

Parameter ``best_lyt``:
The new best layout found.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_valid_layout =
R"doc(Validates the given layout based on the nodes in the network and their
mappings in the node dictionary. It checks if the placement of nodes
@@ -11160,6 +11166,28 @@ wider exploration increases the chance of finding optimal layouts but
also extends runtime. When a solution is found in any graph, its cost
is used to prune the remaining graphs.)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_enable_multithreading =
R"doc(BETA feature: Flag to enable or disable multithreading during the
execution of the layout design algorithm.

When set to `true`, the algorithm will utilize multiple threads to
process different search space graphs in parallel, improving
performance by distributing the workload across available CPU cores.
If set to `false`, the algorithm will run sequentially on a single
thread.

Only recommended for `HIGH_EFFORT` and `HIGHEST_EFFORT` modes and
complex networks (> 100 nodes).

Enabling multithreading can significantly speed up the algorithm,
especially when using multiple search space graphs and dealing with
complex networks, by concurrently expanding them. However, it may
introduce additional overhead for thread synchronization and can
increase memory usage. It is therefore not recommended for small input
networks.

Default value: `false`)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_mode = R"doc(The effort mode used. Defaults to HIGH_EFFORT.)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_num_vertex_expansions =
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ def test_graph_oriented_layout_design_with_different_parameters(self):
params.num_vertex_expansions = 5
params.planar = False
params.cost = gold_cost_objective.WIRES
params.enable_multithreading = False

layout = graph_oriented_layout_design(network, params)

@@ -76,5 +77,17 @@ def custom_cost_objective(layout):

self.assertNotEqual(equivalence_checking(network, layout), eq_type.NO)

def test_graph_oriented_layout_design_with_multithreading(self):
network = read_technology_network(dir_path + "/../../resources/mux21.v")

params = graph_oriented_layout_design_params()
params.return_first = True
params.mode = gold_effort_mode.HIGH_EFFORT
params.enable_multithreading = True

layout = graph_oriented_layout_design(network, params)

self.assertNotEqual(equivalence_checking(network, layout), eq_type.NO)

if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions cli/cmd/physical_design/gold.hpp
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ class gold_command : public command
add_flag("--return_first,-r", ps.return_first,
"Terminate on the first found layout; reduces runtime but might sacrifice result quality");
add_flag("--planar,-p", ps.planar, "Enable planar layout generation");
add_flag("--multithreading,-m", ps.enable_multithreading, "Enable multithreading (beta feature)");
add_flag("--verbose,-v", ps.verbose, "Be verbose");
}

Loading