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

Arm backend: Track target memory usage #5788

Closed

Conversation

zingo
Copy link
Collaborator

@zingo zingo commented Oct 1, 2024

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.

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
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 1, 2024
Copy link

pytorch-bot bot commented Oct 1, 2024

🔗 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 Failure

As of commit 20b7716 with merge base 393553c (image):

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.

@zingo zingo added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Oct 1, 2024
@zingo
Copy link
Collaborator Author

zingo commented Oct 1, 2024

@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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Comment on lines +163 to +170
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_;
}
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@digantdesai merged this pull request in b78ec1b.

@zingo zingo deleted the Arm-backend-Track-target-memory-usage branch October 3, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants