SIGN IN SIGN UP

Change memory planning API to accept full algorithm as argument as opposed to string name (#4727)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/4727

Executorch memory planning currently accepts a string identifier to represent the desired algorithm.

However, this makes it difficult to pass custom arguments to write more customized memory planning algorithms. This change allows users to pass the full memory planning function as an argument as opposed to just the string identifier.

Core changes in:
- fbcode/executorch/exir/passes/memory_planning_pass.py
- fbcode/executorch/exir/tests/test_memory_planning.py

Remaining changes are just to enforce compliance with new API at all call sites in codebase

NOTE: A less intrusive change could be to allow argument to be either string or entire custom functions. I opted for just passing only functions to simplify and avoid confusion

Reviewed By: zonglinpeng, hsharma35, mcremon-meta

Differential Revision: D60433641

fbshipit-source-id: 0fe3677b7c3f4c3763cb1b4fe6d28ef814f2ecf9
E
Eashan Garg committed
618466ed56191fb21fc581c012363ed79911ea13
Parent: acfe0ba
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 9/17/2024, 6:38:02 PM