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

support release pipeline #3069

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

support release pipeline #3069

wants to merge 6 commits into from

Conversation

irexyc
Copy link
Collaborator

@irexyc irexyc commented Jan 21, 2025

Motivation

#3055
#2498

Currently only turbomind backend is supported and ytorch backend support should be added after #3051

from lmdeploy import pipeline
pipe = pipeline('/nvme/shared/vicuna-7b-v1.5/')
pipe('hello')
pipe.close()
from lmdeploy import pipeline
with pipeline('/nvme/shared/vicuna-7b-v1.5/') as pipe:
    pipe('hello')

There are two other issues that do not affect the usage

1: pipe.close will cancel all async tasks, but can't remove the callback. The callback in internal thread will raise error like below, while this will not blobk main thread.

exception calling callback for <Future at 0x7fe1541b6080 state=cancelled>
Traceback (most recent call last):
  File "/home/chenxin/miniconda3/envs/310/lib/python3.10/concurrent/futures/_base.py", line 342, in _invoke_callbacks
    callback(self)
  File "/home/chenxin/ws/lmdeploy/lmdeploy/serve/async_engine.py", line 440, in <lambda>
    asyncio.run_coroutine_threadsafe(_infer(), loop).add_done_callback(lambda x: x.result())
  File "/home/chenxin/miniconda3/envs/310/lib/python3.10/concurrent/futures/_base.py", line 449, in result
    raise CancelledError()
concurrent.futures._base.CancelledError
  1. pipe.close() won't clear all cuda resources. But if we repeatedly create and close the pipeline, the cuda memory will not exceed a small value.

@irexyc irexyc mentioned this pull request Jan 21, 2025
@lvhan028 lvhan028 added the enhancement New feature or request label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants