Skip to content

Colab quickstart example#111

Draft
asda488 wants to merge 2 commits into
ServerlessLLM:mainfrom
asda488:main
Draft

Colab quickstart example#111
asda488 wants to merge 2 commits into
ServerlessLLM:mainfrom
asda488:main

Conversation

@asda488

@asda488 asda488 commented Oct 20, 2024

Copy link
Copy Markdown

Description

Added draft of example colab roughly implementing the steps in the quickstart.

Motivation

Allows users to easily try out library, follow on from issue #108.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • I have read the CONTRIBUTION guide.
  • [N/A] I have updated the tests (if applicable).
  • [N/A] I have updated the documentation (if applicable).

@asda488 asda488 mentioned this pull request Oct 20, 2024
@asda488

asda488 commented Oct 20, 2024

Copy link
Copy Markdown
Author

I will just add the points of note from the issue here:

  • Attempting to use vLLM as the deployment backend yields a generic 500 error, as well as ray workers dying due to OOM errors, however transformers appears to work.
  • There appears to be extremely low vRAM usage, even during inference, I am not sure if this is as intended.

@future-xy future-xy self-requested a review October 21, 2024 08:24
@future-xy

Copy link
Copy Markdown
Member

Thanks for sharing this example!

I’ve reviewed your PR, and it looks great overall. Regarding your comments:

  1. To use vllm as the deployment backend, you’ll need to apply a patch file. You can do this by running:
    conda activate sllm-worker
    ./serverless_llm/store/vllm_patch/patch.sh
  2. The low vRAM usage during inference could be due to several factors, including model size, batch size, and the total available vRAM. Since this example uses a relatively small model (opt-1.3b), the low vRAM usage is expected.

Let me know if you have further questions!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this Colab example to the examples/colab directory? Thanks!

@asda488 asda488 Oct 21, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be that done 👍 (I believe you also have write access to the branch if you need to change anything else small)

@asda488

asda488 commented Oct 21, 2024

Copy link
Copy Markdown
Author

Thanks for the quick reply, regarding your replies:

  1. The main issue here is more that vLLM seems to have too much overhead for the colab's RAM resources, and seems to be patched in by default (running the .sh file to check returns true), but if you are fine with transformers as the backend for the demo that is what has been used.
  2. That's fine then, again not a massive issue for this, just was a bit concerned as the model only seemed to use ~0.1GB VRAM so I was unsure whether the layers were being correctly offloaded to the GPU.

@future-xy

Copy link
Copy Markdown
Member

We’ve just released our first PyPI package, which significantly reduces installation time. Could you please update the notebook according to the latest installation guide?

  1. That's fine then, again not a massive issue for this, just was a bit concerned as the model only seemed to use ~0.1GB VRAM so I was unsure whether the layers were being correctly offloaded to the GPU.

While using a small portion of VRAM is expected, 0.1GB is unusually low. For example, opt-1.3 loaded with fp16 should consume at least 2.6GB. This might be caused by a bug. Have you checked the nohup output? You can check it with !cat nohup.out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants