Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • VisualDL
  • Issue
  • #284

V
VisualDL
  • 项目概览

PaddlePaddle / VisualDL
大约 2 年 前同步成功

通知 89
Star 4655
Fork 642
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 10
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 2
  • Wiki 5
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
V
VisualDL
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 10
    • Issue 10
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 2
    • 合并请求 2
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 5
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 2月 28, 2018 by saxon_zh@saxon_zhGuest

Improve backend performance

Created by: Superjomn

Currently, some implementation of the backend is naive, work not slow. For that, the user will embed backend SDK into their training phase, and the backend will be triggered frequently, so the logger's performance is crucial.

A rough look at the details, there are several modules should be tuned, I list them based on the importance order:

  1. storage/Storage::PersistToDisk, this method will save all the tablets from memory into disk even if some of them are not changed at all.
  2. WRITE_GUARD, it is a trick to use a counter and mod some frequency to avoid the need for concurrency. But the write operation takes overhead, it better to use an async operation instead.
  3. Adding record is expensive, for example, Image 's record adding needs to rescale all the pixels, such operations should change to asnyc.

All in all, there are two aspects to improve. First, the PersistToDist should ignore the tablets that havn't changed; second, some expensive operations should change to async ones.

The first issue is quite intuitive; let's focus on the second one.

For async tasks, thread queue is a good choice, but not suitable for this task. The operations on tablets have some dependencies which are hard to describe by stateless threads, and it is painful to introduce more condition variable or mutex. Dependency engine is a good choice, it handles dependencies naturally, and support concurrency programming without the need for condition variable or mutex.

dependency engine as a concurrent programming framework

VisualDL might be used in a parallel system, that is the SDK might be called parallelly. The dependency engine is similar to a task queue; the tasks can be added parallelly with a single mutex to protect the internal states.

The tasks can be executed parallelly by a thread pool. Both the state control and thread pool are hidden in the dependency engine, the change to VisualDL is just the task pushing logic.

For example, the heavy Image::SetSample can embed into a task and accelerated by the underlying thread-pool.

performance stats

We can reference CPU prof to get some details of the backend performance.

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/VisualDL#284
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7