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

Model keeps reloading shards in every iteration #143

Closed
arunpatro opened this issue Jun 13, 2023 · 2 comments
Closed

Model keeps reloading shards in every iteration #143

arunpatro opened this issue Jun 13, 2023 · 2 comments
Labels
bug text Linked to text generation
Milestone

Comments

@arunpatro
Copy link
Contributor

arunpatro commented Jun 13, 2023

When I run this program, the HF model loads the shards again and again for each loop iteration. Could this be a bug, where the model is not cached in memory and needs to reload again and again?

import outlines.models as models
from tqdm import tqdm

inputs = ["apple", "banana", "oranges", "grapes"]

model  = models.text_completion.hf("mosaicml/mpt-7b-instruct", max_tokens=50)

for prompt in tqdm(inputs):
    answer = model(prompt)
    print(answer)
@rlouf
Copy link
Member

rlouf commented Jun 20, 2023

This is due to the fact that we load the model when it is called. We could load it when the model is initialized, but this leads to other problems when several models are involved. I will soon open an issue regarding the implementation of a supervisor process that handles the loading/unloading of models.

@rlouf rlouf added text Linked to text generation bug labels Jun 20, 2023
@rlouf
Copy link
Member

rlouf commented Jun 24, 2023

This won't happen anymore with the new API since #139, closing. We will have different problems when it comes to using different models, but this is tracked by #162

@rlouf rlouf added this to the 0.1 milestone Jul 13, 2023
@rlouf rlouf closed this as completed Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug text Linked to text generation
Projects
None yet
Development

No branches or pull requests

2 participants