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

bug: Not enough memory when running on Kaggle #829

Open
tonezzz opened this issue Jul 28, 2023 · 3 comments
Open

bug: Not enough memory when running on Kaggle #829

tonezzz opened this issue Jul 28, 2023 · 3 comments
Labels
question asking questions/giving suggestions
Projects

Comments

@tonezzz
Copy link

tonezzz commented Jul 28, 2023

Description

In order to use free accelerator I'm trying to run it on https://kaggle.com with GPU T4x2 config but I've got load_model error, not enough memory. Could you help me finding some solutions?

Is it possible to reduce some memory usage?
Is it possible to use TPU? How?

Thanks,
Tony.

image

Expected results

Program load model & execute successfully.

Current results

Program crashed, with error message:

  • Your notebook tried to allocate too much memory and could not be recovered. You will need to start a new session.
  • Your notebook tried to allocate more memory than is available. It has restarted.

Steps to reproduce

Open a notebook at Kaggle.com, set options to GPU T4 x2 and run the following code.

!pip install --pre --upgrade pythainlp[full]

from pythainlp.chat.core import ChatBotModel
import torch

chatbot = ChatBotModel()
chatbot.load_model(device="cpu" ,torch_dtype=torch.bfloat16)

image

PyThaiNLP version

4.1.0beta2

Python version

3.10.12

Operating system and version

Linux fc5394d1b557 5.15.120+ #1 SMP Fri Jul 21 03:39:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

More info

No response

Possible solution

No response

Files

No response

@wannaphong
Copy link
Member

Hello! You can use load_in_8bit=True in ChatBotModel.load_model.

@tonezzz
Copy link
Author

tonezzz commented Jul 28, 2023

Thanks, but there's still error.

image

@wannaphong
Copy link
Member

I think you should restart kernel after install bitsandbytes.

@wannaphong wannaphong added the question asking questions/giving suggestions label Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question asking questions/giving suggestions
Projects
PyThaiNLP
  
Awaiting triage
Development

No branches or pull requests

2 participants