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

Exported beam search model consumes a lot of more memory #12246

Open
HaoboGu opened this issue Jul 20, 2022 · 3 comments
Open

Exported beam search model consumes a lot of more memory #12246

HaoboGu opened this issue Jul 20, 2022 · 3 comments
Labels
core runtime issues related to core runtime

Comments

@HaoboGu
Copy link

HaoboGu commented Jul 20, 2022

Hello, I used convert_beam_search.py in latest master to convert my gpt2 model to beam search gpt2 model. I found that loading converted beam search model consumes more memory than raw gpt2 model(approximately doubled). Here is the screen shot for loading my gpt2 model before and after the convension:
image
image

I also tried using tiny-gpt2 on huggingface model hub, the memory consumption also increases a lot(30MB -> 43MB) after converting tiny-gpt2 to beam search model:
image
image

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Monterey
  • ONNX Runtime installed from (source or binary): ort-nightly
  • ONNX Runtime version: 1.12.0
  • Python version: 3.7.9
@harshithapv harshithapv added the core runtime issues related to core runtime label Jul 20, 2022
@tianleiwu tianleiwu added the bug label Jul 20, 2022
@tianleiwu
Copy link
Contributor

I can reproduce the issue. Let me investigate the cause.

@tianleiwu
Copy link
Contributor

@HaoboGu, please git pull the master branch, and re-generate the onnx model with convert_generation.py.

@HaoboGu
Copy link
Author

HaoboGu commented Jul 27, 2022

install from source is quite slow.. is ort-nightly which contains this fix released?

@sophies927 sophies927 removed the bug label Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core runtime issues related to core runtime
Projects
None yet
Development

No branches or pull requests

4 participants