# burnpipe **Repository Path**: jinfagang/burnpipe ## Basic Information - **Project Name**: burnpipe - **Description**: y i个色图,c++并行哭 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-02-15 - **Last Updated**: 2023-03-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Burn Pipe **burnpipe** 是一个极简、同时又功能强大的图异步调度框架,实现了包括图构建、节点注册、异步并行优化、图状态管理等功能,并且再并行中加入了多线程优化,线程池抢占、运行时缓存等策略,来使得 burnpipe 成为一个可以高校运行任何图的框架。 实际使用中, burnpipe 被用来构建离线的AI模型推理管线,相较于一些开源的方案,例如ray等,具有体积更小、更轻量、线程优化能力强等优点,比较适合用在单机场合,同时由于burnpipe天生带来的图异步执行优化功能,使得多个模型串联的管线 取得了更快的速度,一些耗时的操作,可以用来掩盖其他节点的耗时,极大的提升了整体的运行效率。 相较于一些cpu单机的异步调度框架,如taskflow也具有一些显著优点,如图构建更简单直观,调度延迟线程时间消耗更好,简单来说性能更好。另外,由于轻量性,使得burnpipe可以更好集成在其他终端,对算力要求很低。 总结来说,burnpipe的优势: - 轻量级,单个头文件任意项目可调用异步能力; - 高性能线程池,带有抢占式线程调度,运行时缓存等策略,且非常方便定制化,不依赖于任何第三方库; - 接口简单:通过接口优化能力,我们的图构建直观,且简单; - 体积小:整个静态库也就2M大小,Linux下体积更小; ## 编译 快速上手: ``` ./build.bat ``` 然后运行: ``` .\build\examples\Release\demo_sleep.exe ``` 可以看到输出: ``` [BURNPIPE] [2023-03-24 12:06:33.224] this is node: NodeDet, this node cost 3s [BURNPIPE] [2023-03-24 12:06:33.225] this is node: NodeHand, this node cost 2s [BURNPIPE] [2023-03-24 12:06:36.230] this is node: NodeBody3D, cost 2s [BURNPIPE] [2023-03-24 12:06:38.243] this is node: NodeFusion, final part cost 2s [BURNPIPE] [2023-03-24 12:06:40.258] run for frame: 0, current status: 0, cost: 7.034000 , [should be: 13s] [BURNPIPE] [2023-03-24 12:06:40.258] this is node: NodeHand, this node cost 2s [BURNPIPE] [2023-03-24 12:06:40.258] this is node: NodeDet, this node cost 3s [BURNPIPE] [2023-03-24 12:06:43.266] this is node: NodeBody3D, cost 2s [BURNPIPE] [2023-03-24 12:06:45.275] this is node: NodeFusion, final part cost 2s [BURNPIPE] [2023-03-24 12:06:47.284] run for frame: 1, current status: 0, cost: 7.026000 , [should be: 13s] ``` 实际上运行时间,并非是多个节点相加,而是根据图的并行,掩盖之后的时间叠加,实际耗时大大小于理论串行耗时。