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

Arena on GPU throw Segmentation fault in C++ #13458

Closed
veelion opened this issue Oct 26, 2022 · 1 comment
Closed

Arena on GPU throw Segmentation fault in C++ #13458

veelion opened this issue Oct 26, 2022 · 1 comment

Comments

@veelion
Copy link

veelion commented Oct 26, 2022

I followed the steps below, but onnxruntime gave the message and then exit with segmentation falut:
[F:onnxruntime:, bfc_arena.h:330 RegionFor] Could not find Region for 0x7ffb2b04d000


   Thanks @Z-XQ for the explanation.

The GPU memory is backed by a memory pool (arena) and we have a config knob to shrink the arena (de-allocated unused memory chunks).

Not sure if we have enough tools to accomplish this in Python just yet. The best way to use this feature in C++ is to:

  1. Not allocate weights memory through the arena: See here

  2. Configure the arena to have high enough initial chunk to support most Run() calls. See "initial_chunk_size_bytes" here

  3. Finally, configure the arena to shrink on every Run(). See here. This will keep the initial chunk allocated but de-allocate any unused chunk remaining after the Run() call ends.

For example, if the initial chunk size is set as 500MB, the first Run() will allocate 500MB + any additional chunks required to service the Run() call. The additional chunks will get de-allocated after Run() and only keep 500MB of memory allocated. It is important to not allocate weights (initializers) memory through the arena as that complicates the shrinkage. Hence, step (1).

Originally posted by @hariharans29 in #9509 (comment)

@veelion
Copy link
Author

veelion commented Oct 26, 2022

not issure

@veelion veelion closed this as completed Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant