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

关于PaddlePaddle Serving的一点调研 #394

Open
gongweibao opened this issue Oct 18, 2017 · 5 comments
Open

关于PaddlePaddle Serving的一点调研 #394

gongweibao opened this issue Oct 18, 2017 · 5 comments

Comments

@gongweibao
Copy link
Collaborator

gongweibao commented Oct 18, 2017

TensorFlow serving

首先是调研了一下TensorFlow Serving。他的arch view文档在这里 或者这里

除了提供基础的rpc server的功能外,亮点在于一下几个feature:

  • 多版本管理:
    • 可以同时load多个版本的model,并且客户端可以访问指定的版本。
    • 模型热加载:新版本的model发布后,自动加载新版本。
      • 版本管理的policy是可以定制的。默认主要实现的有两种:Availability Preserving PolicyResource Preserving Policy
TensorFlow Serving includes two policies that accommodate most known use- cases. 
These are the Availability Preserving Policy (avoid leaving zero versions loaded; 
typically load a new version before unloading an old one), and the Resource Preserving Policy 
(avoid having two versions loaded simultaneously, thus requiring double the resources; 
unload an old version before loading a new one)
  • 支持从多种存储上加载模型:
    • 可以扩展支持更多种类的存储。
  • client端访问的批处理功能:
    • 同样,这个功能也是可以自定义policy。
Batching of multiple requests into a single request can significantly reduce the cost 
of performing inference, especially in the presence of hardware accelerators such as GPUs. 

根据文档描述,其Loaders 是可以扩展的,这样具有了支持非TensorFlow model的能力。社区已经有人为TensorFlow Serving增加caffe模型的支持:tensorflow/serving#261
https://github.com/rayglover-ibm/serving-caffe

厂内情况

讨论:

我们在大会之前做一个可以和TensorFlow Serving对标的Serving服务作为亮点,时间有点来不及。

  • TensorFlow Serving的基础上做插件支持PaddlePaddle的模型?
  • 做一个简单的C++版本Infer Server(如HttpServer)?
@gongweibao gongweibao changed the title 关于paddle serving的一点调研 关于PaddlePaddle Serving的一点调研 Oct 18, 2017
@helinwang
Copy link
Collaborator

helinwang commented Oct 18, 2017

  1. 不是很理解为什么TF Serving要做model更新和版本管理。在分布式的情况下似乎更适合Kubernetes来做rolling update和load balancing,单机情况下需要框架来支持model更新和版本管理吗?个人不是很认同TF Serving中LoaderSourceManager概念的必要性。如果要做TF Serving的插件,可能需要论证下TF Serving思路的合理性。

  2. TF Serving我理解是gRPC和protobuf(有protobuf message不能大于64MB的限制,需要打patch重新编译解除限制),如果要HTTP接口,还需要在上面包一层。我们需要确定下咱们讲的PaddlePaddle Serving是直接暴露HTTP接口吗?

  3. 我个人认为比较理想的方式是serving可以直接用重构后的remote session(这里是Python的接口,如果需要高性能我们可以提供C++/Go的接口),这里是模块示意图。如果用户需要HTTP接口,可以自己在上面再包一层。

@wangkuiyi
Copy link

我个人认为比较理想的方式是serving可以直接用重构后的remote session(这里是Python的接口,如果需要高性能我们可以提供C++/Go的接口),这里是模块示意图。如果用户需要HTTP接口,可以自己在上面再包一层。

好啊!

@unship
Copy link

unship commented Nov 3, 2017

可以弄一个纯净版serving grpc

@helinwang
Copy link
Collaborator

@biolee grpc用的protobuf不适合tensor这种binary blob,因为protobuf是为小message设计的,这里有一些benchmark: PaddlePaddle/Paddle#4610

@lxl910915
Copy link

http://wiki.baidu.com/pages/viewpage.action?pageId=253167629
这个地址更新了吗? 请问最新地址是什么? 谢谢!

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

No branches or pull requests

8 participants