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

[Feature Request] ORT-Profiler: Include timestamps for tensor allocations and deallocations. #21337

Open
hashJoe opened this issue Jul 12, 2024 · 2 comments
Labels
api:Java issues related to the Java API feature request request for unsupported feature or enhancement

Comments

@hashJoe
Copy link

hashJoe commented Jul 12, 2024

Describe the feature request

I'm currently working with ONNXRuntime for performance-critical applications in Java, and I've found it challenging to optimize memory usage without detailed insights into tensor allocation lifetimes. In TensorFlow, I am accustomed to using the profiler to obtain metadata about tensor allocations, such as allocation/deallocation timestamps and bytes allocated.

More information about tensorflow profiler can be found here: RunMetadata and StepStats

Given the above information, allocation time can be inferred for each tensor.

Is there similar profiling capabilities that allow us to track the lifetime of tensor allocations in ONNXRuntime?

Using SessionOptions#enableProfiling gives no such information.

Describe scenario use case

This information is crucial for identifying bottlenecks and optimizing the memory footprint of models during inference or training.

Such a feature should provide:

  • Timestamps for tensor allocations and deallocations.
  • The size (in bytes) of each tensor allocation.
  • Peak memory usage statistics.
  • Live bytes currently allocated.
@hashJoe hashJoe added the feature request request for unsupported feature or enhancement label Jul 12, 2024
@github-actions github-actions bot added the api:Java issues related to the Java API label Jul 12, 2024
@Craigacp
Copy link
Contributor

Are you trying to optimize native memory usage, Java memory usage or total memory?

@hashJoe
Copy link
Author

hashJoe commented Jul 12, 2024

Are you trying to optimize native memory usage, Java memory usage or total memory?

I am interested in total memory: on cpu, Resident Set Size is measured; on gpu, cuda memory + rss are measured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api:Java issues related to the Java API feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants