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

http://{server_ip}:{server_port}/generate使得instance挂起 #408

Closed
HuaYZhao opened this issue Sep 12, 2023 · 9 comments
Closed

http://{server_ip}:{server_port}/generate使得instance挂起 #408

HuaYZhao opened this issue Sep 12, 2023 · 9 comments

Comments

@HuaYZhao
Copy link

HuaYZhao commented Sep 12, 2023

当我发送一个stream=true的请求,并用ctrl+c中断它,出现了以下现象:
1、该instance_id永久性挂起无法使用,
2、ctrl+c并未立刻使得gpu资源得到释放;

我认为这是一个潜在的bug,请帮忙看看;

请求为docs中的示例

curl http://{server_ip}:{server_port}/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello! How are you?",
    "instance_id": 1,
    "sequence_start": true,
    "sequence_end": true
  }'
@AllentDan
Copy link
Collaborator

#380
传 stop 字段停止一个正在响应的会话

@HuaYZhao
Copy link
Author

传stop确实有所反应,但当我再用同一个instance_id进行请求时,引擎直接core dumped了。这非常不解;
具体步骤如下:
1、Python -m ... start server
2、curl
3、ctrl+c
4、curl with stop=true
5、curl 和第二步相同
6、server core dumped!

当我发送一个stream=true的请求,并用ctrl+c中断它,出现了以下现象: 1、该instance_id永久性挂起无法使用, 2、ctrl+c并未立刻使得gpu资源得到释放;

我认为这是一个潜在的bug,请帮忙看看;

请求为docs中的示例

curl http://{server_ip}:{server_port}/generate \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello! How are you?",
    "instance_id": 1,
    "sequence_start": true,
    "sequence_end": true
  }'

@AllentDan
Copy link
Collaborator

AllentDan commented Sep 12, 2023

不是,是说,停止一个正在响应的请求的方法应该是传 stop 而不是直接 ctrl C

@HuaYZhao
Copy link
Author

HuaYZhao commented Sep 12, 2023

我改变了顺序:
1、启动服务
2、curl正常请求
3、开启新窗口,curl一个带stop参数的请求
4、第二步的请求被中断并返回bash,第三步的请求无法返回bash
5、在第二步的窗口中,curl正常请求
6、服务core dumped
请帮忙再看看;

我使用stream=True进行调用

@AllentDan
Copy link
Collaborator

你可以调用 app.py 吗? app.py 可以调用 restful api,界面可以做到停止某个会话。你可以看看怎么实现的

@AllentDan
Copy link
Collaborator

不过,ctrl + C 这是个问题,我后面修一下吧,毕竟不能阻止用户随便停止某个响应

@HuaYZhao
Copy link
Author

HuaYZhao commented Sep 12, 2023

我启动的gradio.app的服务,当我点击cancel按钮时,服务端报一个IndexError的错误,并且后续对话都无法进行,这和我用curl时保持一致。
因为在内网,所以无法附上详细的内容。具体错误发生在https://github.com/InternLM/lmdeploy/blob/e37915e598a250b0262bb7f957163194c5601fb3/lmdeploy/turbomind/turbomind.py#L347C32-L347C32
index -1 is out of bounds

@AllentDan
Copy link
Collaborator

The same as #402
Will be fixed in #405

@HuaYZhao
Copy link
Author

感谢,我正好也实验了这样做,它可以成功工作

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

3 participants