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

[gpt-J] swap space support #22

Open
joshuachris2001 opened this issue Feb 14, 2023 · 5 comments
Open

[gpt-J] swap space support #22

joshuachris2001 opened this issue Feb 14, 2023 · 5 comments

Comments

@joshuachris2001
Copy link

is it possible to have swap space support? ( I heard about ' Handling big models for inference' and was wondering if ggml can support a similar feature or store part of the large model in swap.)

@ggerganov
Copy link
Owner

Can you clarify what is "swap space"? Is it partially loading the weights from disk and then unloading, etc.

@joshuachris2001
Copy link
Author

joshuachris2001 commented Feb 16, 2023

sorry, I meant to ask if it is possible to split a larger model. as looking at the standard gpt-j ggml usage goes from 16 to 32GB of ram, I do have 16GB of ram but I also have 32GB of swap space that ggml does not seem to use.
swap space uses reserved disk space as virtual memory, where the parts of memory gets 'swapped' between disk and ram.

@biemster
Copy link

As far as I know swap space is handled by the kernel, to copy memory pages that it deems inactive. I don't think user space applications have any control over that? And since the whole model is actively in use by ggml, swapping those in and out will be detrimental for performance, probably not usable at all.
If, and that's a big if, you could convince the kernel that parts of it are currently inactive.

@ggerganov
Copy link
Owner

Yes, I agree with @biemster
The OS automatically decides when to use the swap space. There is nothing special that has to be done in the user code

@chatbots
Copy link

chatbots commented Feb 27, 2023

For Discussion Purposes Only. Do Not Try at Home!
As an experiment, I ran gpt-j on 6GB RAM with 10GB swapfile.
I wanted to run this test before physically uninstalling and
reinstalling RAM chips between two computers.
NOTE: While NOT recommended as an alternative,
this experiment did run very slowly without errors.

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

4 participants