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

Support memory profiling feature from on-demand path #889

Open
briancoutinho opened this issue Mar 10, 2024 · 0 comments
Open

Support memory profiling feature from on-demand path #889

briancoutinho opened this issue Mar 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@briancoutinho
Copy link
Contributor

Summary

Currently the memory profiler feature in PyTorch is available via the profiler API by passing profile_memory=True in the interface. It is desirable to also enable memory profiling using the Kineto on-demand API.

Dynolog (profiling daemon) can communicate to a PyTorch program to enable on-demand profiling. Dynolog sends the configuration using a string. Dynolog already configuring the profile_memory option. However, the memory profiles are not obtained.

Understanding the code path.

Dynolog sends this string "PROFILE_PROFILE_MEMORY" as implemented here in PR159.

Inside Kineto

  1. Profiler memory is accepted in Kineto config in Config.cpp
  2. This is passed to the PyTorch client interface here
  3. Pytorch client receives this and calls enableProfiler [here[(https://github.com/pytorch/pytorch/blob/660ec3d38d9d1c8567471ae7fe5b40ae7c6d7438/torch/csrc/profiler/kineto_client_interface.cpp#L44-L53C5)
  4. We have this field being set in ProfilerConfig , details in observer.h
  5. I lost track of how the config_ gets passed around from here. But i see it being checked in profiler_kineto.cpp

Few things to confirm

  • Does it work with input shapes enabled
  • dyno gputrace <..> --record_shapes --profile_memory
@briancoutinho briancoutinho added bug Something isn't working enhancement New feature or request labels Mar 10, 2024
@aaronenyeshi aaronenyeshi changed the title Suport memory profiling feature from on-demand path Support memory profiling feature from on-demand path Apr 22, 2024
@aaronenyeshi aaronenyeshi removed the bug Something isn't working label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants