之前我负责过一个推荐系统深度学习 Serving 框架的功能开发与性能优化。
我们的系统主要跑在 CPU 上,以 TensorFlow 为主力 inference engine。随着模型迭代,尤其是 Embedding 层越来越大,模型导出、传输和上线变得非常慢,Serving 节点的内存成本也眼看着往上飙。
起因 # 在上一篇《从进程视角重新理解 Docker》中,我总结了 Docker 最核心的价值:它通过 namespace 和 cgroup 给进程构造了独立的视图和资源限制,并把这套运行环境固化成了可以直接分发的 artifact。
起因 # 最近在家办公,需要连公司 VPN(UniVPN)进内网。但一连上 VPN,浏览器里的 chatgpt.com 就直接打不开了。
起因 # 最近在团队内部重新整理 Python 项目的打包、发布和依赖管理规范,逐渐把各个工程统一收敛到:
起因 # 第一次接触 Docker 是 2017 年,在深圳网警机房驻场做审核项目。机房完全没有外网,模型、依赖、运行环境全靠 U 盘拷贝 docker image 来传输。后来做模型转换系统,再到量化行业负责机器学习平台,和 Docker、K8s 打了不少交道。但距离上一次系统梳理 namespace、cgroup 这些底层机制,已经过去好几年了。
背景 # 需要在gitlab pipelines中跑一堆测试 其中某些测试需要与rancher交互,在训练集群上执行一个训练任务
背景 # 每一个cpp expression都有一个type 和 value category 属性 前者大家都比较了解,但是后者却常常被忽视
最近在做一个智能算力的项目,其中需要用到redis维护某个全局的时间窗口
arena是levelDB中的内存池实现
接口 # 没有太多好说的,都非常直观。补了些注释
FilterPolicy接口 # 1 2class LEVELDB_EXPORT FilterPolicy { 3 public: 4 virtual ~FilterPolicy(); 5 6 // Return the name of this policy. Note that if the filter encoding 7 // changes in an incompatible way, the name returned by this method 8 // must be changed. Otherwise, old incompatible filters may be 9 // passed to methods of this type. 10 virtual const char* Name() const = 0; 11 12 // keys[0,n-1] contains a list of keys (potentially with duplicates) 13 // that are ordered according to the user supplied comparator. 14 // Append a filter that summarizes keys[0,n-1] to *dst. 15 // 16 // Warning: do not change the initial contents of *dst. Instead, 17 // append the newly constructed filter to *dst. 18 virtual void CreateFilter(const Slice* keys, int n, 19 std::string* dst) const = 0; 20 21 // "filter" contains the data appended by a preceding call to 22 // CreateFilter() on this class. This method must return true if 23 // the key was in the list of keys passed to CreateFilter(). 24 // This method may return true or false if the key was not on the 25 // list, but it should aim to return false with a high probability. 26 virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const = 0; 27}; 其中CreateFilter的含义是从n个key生成一个 std::string. 生成的std::string可以包含n个key的信息(类似于生成了一个全集) 从而后续判断某个key是否在其中。
从 Cache 接口进入 LevelDB 的 LRUCache、Handle 生命周期与分片并发设计。
梳理 shared_ptr 的控制块、引用计数、线程安全边界和常见使用陷阱。
背景 # 一种很常见的背景是,需要表示未知类型的数据。比如可能是用户提供的数据,也可能是一个 Cache 的实现,其 value 想支持任意类型的数据
levelDB是一个有序的KV存储,因此key的顺序是十分关键的 levelDB提供用户自己定义key顺序的能力
背景 # 最近在做一个智能算力相关的项目,类似美团外卖广告智能算力的探索与实践 其中实现控制系统需要与数据库交互。虽然最后技术选型并没有使用到levelDB,但是想趁机把代码读了吧。
博客要长草了。。趁着过年时间多,打理一下。。
添加google analytics # hugo本身已经集成了这个功能 要点是集成的是旧版本的universal analytics (对应的是UA-ID) 而目前google主推得其实是新版本google analytics 4(对应的是GA4-ID)
围绕 Robin Hood Hashing、探测距离和存储布局,拆解 ska::flat_hash_map 的实现思路。
从最小复现、指令集与 ABI 差异入手,定位旧版 GCC 环境中的 AVX2 崩溃问题。
继续把 k8s 用于模型转换和部署的自动化流程,然后发现之前安装 k8s 的文档不 work 了…… 时间是 2020 年 5 月 7 日,当前最新的 k8s 版本是 v1.18.2。