Skip to content

Commit

Permalink
benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
simon1hofmann committed Sep 9, 2024
1 parent 8d1173c commit f11e096
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct graph_oriented_layout_design_params
enum effort_mode : std::uint8_t
{
/**
* LOW_EFFORT mode generates 3 search space graphs. This option minimizes runtime but may not always yield the
* LOW_EFFORT mode generates 2 search space graphs. This option minimizes runtime but may not always yield the
* optimal results.
*/
LOW_EFFORT,
Expand Down Expand Up @@ -886,7 +886,7 @@ class graph_oriented_layout_design_impl
{
return (cost == graph_oriented_layout_design_params::cost_objective::CUSTOM) ? 60u : 48u;
}
return (mode == graph_oriented_layout_design_params::effort_mode::HIGH_EFFORT) ? 12u : 3u;
return (mode == graph_oriented_layout_design_params::effort_mode::HIGH_EFFORT) ? 12u : 2u;
}
/**
* Checks if a solution has been found for the specified cost objective.
Expand Down Expand Up @@ -1817,16 +1817,14 @@ class graph_oriented_layout_design_impl
// initialize search space graphs with networks
ssg_vec[0].network = network_breadth_co_to_ci;
ssg_vec[1].network = network_breadth_co_to_ci;
ssg_vec[2].network = network_breadth_co_to_ci;

std::vector<mockturtle::node<decltype(network_breadth_co_to_ci)>> nodes_to_place_breadth_co_to_ci{};
prepare_nodes_to_place(network_breadth_co_to_ci, nodes_to_place_breadth_co_to_ci);

ssg_vec[0].nodes_to_place = nodes_to_place_breadth_co_to_ci;
ssg_vec[1].nodes_to_place = nodes_to_place_breadth_co_to_ci;
ssg_vec[2].nodes_to_place = nodes_to_place_breadth_co_to_ci;

for (uint64_t i = 0ul; i < 3; ++i)
for (uint64_t i = 0ul; i < 2; ++i)
{
ssg_vec[i].cost = ps.cost;
}
Expand Down
30 changes: 21 additions & 9 deletions test/benchmark/graph_oriented_layout_design.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,27 @@ TEST_CASE("Benchmark Graph-Oriented Layout Design", "[benchmark]")

BENCHMARK("graph_oriented_layout_design: low effort")
{
params.high_effort_mode = false;
params.mode = graph_oriented_layout_design_params::effort_mode::LOW_EFFORT;

return graph_oriented_layout_design<gate_layout>(ntk, params);
};

BENCHMARK("graph_oriented_layout_design: high effort")
{
params.high_effort_mode = true;
params.mode = graph_oriented_layout_design_params::effort_mode::HIGH_EFFORT;

return graph_oriented_layout_design<gate_layout>(ntk, params);
};

BENCHMARK("graph_oriented_layout_design: highest effort")
{
params.mode = graph_oriented_layout_design_params::effort_mode::HIGHEST_EFFORT;

return graph_oriented_layout_design<gate_layout>(ntk, params);
};
}

// Mac M1, Sonoma 14.5, Apple clang version 15.0.0 (09.08.24)
// Mac M1, Sonoma 14.6.1, Apple clang version 15.0.0 (09.09.24)

// -------------------------------------------------------------------------------
// Benchmark Graph-Oriented Layout Design
Expand All @@ -54,15 +61,20 @@ TEST_CASE("Benchmark Graph-Oriented Layout Design", "[benchmark]")
// mean low mean high mean
// std dev low std dev high std dev
// -------------------------------------------------------------------------------
// graph_oriented_layout_design: low
// graph_oriented_layout_design: low effort
//
// 169.42 ms 167.384 ms 171.921 ms
// 11.4759 ms 9.42369 ms 15.5996 ms
//
// graph_oriented_layout_design: high effort
//
// 157.227 ms 155.044 ms 159.725 ms
// 11.8494 ms 10.1235 ms 14.8552 ms
// 1.46627 s 1.44898 s 1.48316 s
// 87.3277 ms 78.1128 ms 99.3427 ms
//
// graph_oriented_layout_design: high
// graph_oriented_layout_design: highest effort
//
// 1.34778 s 1.32165 s 1.37673 s
// 1.34778 s 1.32165 s 1.37673 s
// 3.92325 s 3.81698 s 4.02528 s
// 530.342 ms 472.996 ms 604.419 ms
//
//
// ===============================================================================

0 comments on commit f11e096

Please sign in to comment.