-
Notifications
You must be signed in to change notification settings - Fork 355
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
Arm backend: Track target memory usage #5788
Conversation
This adds memory stats API to a subclass of Memory Allocator and make it possible for the backend to track and report runtime memory usage. Signed-off-by: Zingo Andersen <zingo.andersen@arm.com> Change-Id: I3570d689f4614d85e098c014717402fa6c619d9f
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5788
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Cancelled Job, 1 Unrelated FailureAs of commit 20b7716 with merge base 393553c (): NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label ciflow/trunk |
@@ -135,6 +135,44 @@ void et_pal_emit_log_message( | |||
|
|||
namespace { | |||
|
|||
// Setup our own allocator that can show some extra stuff like used and free | |||
// memory info | |||
class ArmMemoryAllocator : public executorch::runtime::MemoryAllocator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
size_t used_size() const { | ||
return used_; | ||
} | ||
|
||
// Returns the free size of the allocator's memory buffer. | ||
size_t free_size() const { | ||
return executorch::runtime::MemoryAllocator::size() - used_; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add tests for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is in our user example code I tried to keep it clean but it would be really nice to have some test on this code in some way Ill have it the back of my mind for maturing a bit.
@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@digantdesai merged this pull request in b78ec1b. |
This adds memory stats API to a subclass of Memory Allocator and make it possible for the backend to track and report runtime memory usage.