摘要: Triton 源码初步研读 一、核心接口形态 def jit( fn: Optional[T] = None, *, version=None, do_not_specialize: Optional[Iterable[int]] = None, debug: Optional[bool] = None, ) -> Union 阅读全文
posted @ 2023-05-06 10:08 Aurelius84 阅读(1110) 评论(0) 推荐(0) 编辑
摘要: TVM 中的 Profiler 设计 一、基本用法 首先看 Profiler 的用法: with ms.Profiler() as profiler: # .... 用户代码 print("Tuning Time:") print(profiler.table()) 二、前端接口设计 其中 Profiler 类的设计是绑定和映射到了 C 阅读全文
posted @ 2023-05-06 09:50 Aurelius84 阅读(145) 评论(0) 推荐(0) 编辑
摘要: CINN 中子图编译缓存机制 采用 「问-答」形式记录研读 CINN 开源框架的笔记 Q:CINN中子图编译的入口是在哪里? for (const auto& node_vec : clusters) { // < 逐个遍历每个子图 // Classify var node to inputs, outputs, and int 阅读全文
posted @ 2023-05-06 09:45 Aurelius84 阅读(54) 评论(0) 推荐(0) 编辑
摘要: CUDA 的随机数算法 API 参考自 Nvidia cuRand 官方 API 文档 一、具体使用场景 如下是是在 dropout 优化中手写的 uniform_random 的 Kernel: #include <cuda_runtime.h> #include <curand_kernel.h> __device__ inl 阅读全文
posted @ 2023-05-06 09:35 Aurelius84 阅读(475) 评论(0) 推荐(0) 编辑
摘要: Tensorflow和飞桨Paddle的控制流算子设计 一、概览 注:整体方案上尚存在技术疑点,需进一步小组内讨论对齐,避免方案设计上存在后期难以扩展(或解决)的局限性 |框架 | TensorFlow 1.x | TensorFlow 2.x | Paddle | |: :|: :|: :|: :| | cond/while| √ | √ | √ | 阅读全文
posted @ 2022-09-27 17:42 Aurelius84 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 飞桨PaddleLite架构研读 一、架构全景图 二、源码详细解读 1. Lite体系下似乎有多种 op_desc/program_desc 的定义,之间的关系是什么?这样设计的背景和好处是什么? model_parser目录下,包含 flatbuffers——结构描述定义在 framework.fbs 文件中,命名空间为paddl 阅读全文
posted @ 2022-09-27 17:35 Aurelius84 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 飞桨动态图PyLayer机制 一、主要用法 如下是官方文档上的使用样例: import paddle from paddle.autograd import PyLayer # Inherit from PyLayer class cus_tanh(PyLayer): @staticmethod def forward(ctx, 阅读全文
posted @ 2022-09-27 17:28 Aurelius84 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 技术书籍 — EffectiveMordenCpp 研读 一、类型推导 PROs: 源码某处的类型修改,可以自动传播其他地方 Cons: 会让代码更复杂(How?) 在模板类型推导时,有引用的实参会被视为无引用,他们的引用会被忽略 template<typename T> void f(T & param); // param 是一个引用 int x = 阅读全文
posted @ 2021-04-11 12:09 Aurelius84 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Google C++ 语言规范 1. 命名空间 KeyNotes: 鼓励在.cc文件里使用匿名命名空间或者sttic声明 禁止使用内联命令空间,X::Y::foo 等价与X::foo。其主要用于跨版本的ABI兼容问题 namespace X{ inline namespace Y{ void foo(); } // namespa 阅读全文
posted @ 2021-04-11 12:07 Aurelius84 阅读(248) 评论(0) 推荐(0) 编辑
摘要: C++基础知识复习 第一部分:基础知识 一、const 1. 作用 修饰变量,表示不可能更改 修饰指针 const int *ptr——pointer to const int const *ptr—— const pointer 原则:被const修饰的后面的值是不可改变的 修饰引用 常用于形参。即避免了copy,又 阅读全文
posted @ 2021-04-11 12:06 Aurelius84 阅读(262) 评论(0) 推荐(0) 编辑