tf serving 快速模型加载

相关的代码在
load_servables_fast.h/cc中

  const uint32 prev_num_load_threads = manager->num_load_threads();
  manager->SetNumLoadThreads(num_threads);
  ConnectSourceToTarget(source, manager);
  const Status status = wait_until_loaded_fn();
  manager->SetNumLoadThreads(prev_num_load_threads);
  return status;

如注释中所写:临时增加线程数
// Connects 'source' to 'manager', and speeds up loading of the servables
// matching 'initial_servables'. The speeding up is accomplished by boosting the
// number of threads used for loading until the initial servables have been
// loaded, and then resetting it to the manager's originally configured value.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 周五做日文阅读时遇到一篇讲一日本人出差到E国,本来与客户约好后天见面,结果后天果真来到时,对方不仅爽约,而且没有提...
    离家难阅读 4,921评论 5 19
  • 雨轻点着屋檐 在我的对面 分不清是雨还是你的容颜 模糊了视线 门外空荡的秋千 笑声传去多远 而我只能眺望天边 祭奠...
    Mohistmen阅读 3,089评论 0 0
  • 01去年暑假,那是我大学的最后一个假期,就没去兼职了,果断回了家好好享受大学仅剩的假期额度,渐渐地在家闷着慌,就开...
    一只牛哥哥阅读 1,586评论 0 0
  • 一瓶一瓶的墨水 流干 沿着桌子顺势而下 一张一张的白纸 起皱 被时间填满 浑厚的汁液是倒映不出你的神态的 一双明眸...
    麦茫阅读 1,579评论 2 3