Skip to content

Commit 9e9ffb5

Browse files
hsharma35facebook-github-bot
authored andcommitted
Create a MemoryPlanningAlgo class.
Summary: Refactor our memory planning algos into a `MemoryPlanningAlgo` base class + algo-specific implementation in derived class. This refactor separates common utility functions + constraint handling to the base class. This way, we can add support for hierarchical graphs (using maps), and add more types of constraints (like pinning a tensor to specific dtcm bank) without changing the algo itself. Differential Revision: D76954785
1 parent 496cb05 commit 9e9ffb5

File tree

3 files changed

+316
-225
lines changed

3 files changed

+316
-225
lines changed

backends/cadence/aot/TARGETS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,15 @@ python_unittest(
448448
],
449449
)
450450

451+
python_library(
452+
name = "memory_planning_algo",
453+
srcs = [
454+
"memory_planning_algo.py",
455+
],
456+
deps = [
457+
],
458+
)
459+
451460
python_library(
452461
name = "memory_planning",
453462
srcs = [
@@ -456,6 +465,7 @@ python_library(
456465
deps = [
457466
"fbsource//third-party/pypi/tabulate:tabulate",
458467
":memory_constraints",
468+
":memory_planning_algo",
459469
":pass_utils",
460470
"//caffe2:torch",
461471
"//executorch/exir:lib",

0 commit comments

Comments
 (0)