GPU Resource Management On JDOSGPU Resource Management On JDOS 梁永清 liangyongqing1@jd.com 提供的服务 1. 用于实验的 GPU 容器 2.基于 Kubeflow 的机器学习训练服务 3.模型管理和模型 Serving 服务 Experiment Training Serving 均基于容器,不对业务方直接提供 GPU 物理机 GPU 实验 JDOS 常规的容器服务0 码力 | 11 页 | 13.40 MB | 1 年前3
C++20: An (Almost) Complete Overviewatomic waiting, latches, and barriers std::atomic_ref Designated Initializers Spaceship Operator <=> Range-based for Loop Initializer Non-Type Template Parameters [[likely]] and [[unlikely]] shared_ptrnext; }; atomic_shared_ptr head; // in C++11: remove "atomic_" and use special // functions every time you touch head public: class reference { shared_ptr p; concept: mutex, latches, barriers, … Two types: counting semaphore: models a non-negative resource count binary semaphore: only has 1 slot, i.e. only has two states: free slot or no free slot 0 码力 | 85 页 | 512.18 KB | 6 月前3
Working with Asynchrony Generically: A Tour of C++ ExecutorsP2300: STD::EXECUTION Proposes: • A set of concepts that represent: • A handle to a compute resource (aka, scheduler) • A unit of lazy async work (aka, sender) • A completion handler (aka, receiver) sender adaptor to send stop request when Ctrl-C sender completes. 2. Remove no-longer-necessary special handling for Ctrl-C from the keyclick_operation. … UNTIL INTERRUPT SENDER COMPLETES… UNTIL INTERRUPT assert(previous == nullptr); } }; Since we are externalizing the stop condition, we can remove the special handling for Ctrl-C from keyclick_operation. (demo 3)113 Q: Why doesn’t this work? A: Although0 码力 | 121 页 | 7.73 MB | 6 月前3
Bringing Existing Code to CUDA Using constexpr and std::pmrC++17: • std::pmr::memory_resource • std::pmr::polymorphic_allocator • std::pmr::vector • std::pmr::monotonic_buffer_resource • … std::pmr 16 |// gpu unified_memory_resource mem; std::pmr::vectorstd::pmr::vector y(N, &mem); // … Memory Allocation 17 |struct unified_memory_resource : std::pmr::memory_resource { void* do_allocate(std::size_t, std::size_t); void do_deallocate( do_is_equal( const std::pmr::memory_resource& other) const noexcept; }; A Unified Memory Resource 18 |struct unified_memory_resource : std::pmr::memory_resource { void* do_allocate(std::size_t 0 码力 | 51 页 | 3.68 MB | 6 月前3
hazard pointer synchronous reclamationunder synchronization/Hazptr.h Is Asynchronous Reclamation Always Enough? delete ptr shutdown_resource_X() Hazard Pointer Synchronous Reclamation Beyond Concurrency TS2 – Maged Michael Example: Removed reclamation ~Foo() { use_resource_X (); } Foo* ptr = new Foo; Remove ptr Is Asynchronous Reclamation Always Enough? No Asynchronous reclamation: delete ptr Using unavailable resource X Hazard Pointer Synchronous Michael Same example but using hazard pointer deferred reclamation ptr-retire() shutdown_resource_X() ~Foo() { use_resource_X (); } Foo* ptr = new Foo; Remove ptr Some use cases need synchronous reclamation0 码力 | 31 页 | 856.38 KB | 6 月前3
C++高性能并行编程与优化 - 课件 - 02 现代 C++ 入门:RAII 内存管理,就没必要去搞封装,只会让程序员 变得痛苦,同时还有一定性能损失:特别 是如果 getter/setter 函数分离了声明和定 义,实现在另一个文件时! C++ 思想: RAII ( Resource Acquisition Is Initialization ) 资源获取视为初始化,反之,资源释放视为销毁 C++ 除了用于初始化的构造函数( constructor ) 还包括了用于销毁的解构函数( 器默认生成,可以都用 这两个显式地声明一下。 编译器默认生成的特殊函数:拷贝赋值函数 • 除了拷贝构造函数外,编译器默认还会生成这样一个重载’ =’ 这个运算符的函数: • Pig &operator=(Pig const &other); • 拷贝构造函数的作用是在 Pig 尚未初始化时,将另一个 Pig 拷贝进来,以初始化当前 Pig 。 • Pig pig = pig2; //0 码力 | 96 页 | 16.28 MB | 1 年前3
C++23: An Overview of Almost All New and Updated FeaturesC++23 Core Language Explicit Object Parameters if consteval Multidimensional Subscript Operator Attributes on Lambda-Expressions Literal Suffix for size_t auto(x): decay-copy in The Language C++23 Core Language Explicit Object Parameters if consteval Multidimensional Subscript Operator Attributes on Lambda-Expressions Literal Suffix for size_t auto(x): decay-copy in The Language C++23 Core Language Explicit Object Parameters if consteval Multidimensional Subscript Operator Attributes on Lambda-Expressions Literal Suffix for size_t auto(x): decay-copy in The Language0 码力 | 105 页 | 759.96 KB | 6 月前3
Автоматизация управления ClickHouse-кластерами в Kubernetesсисадмина. ClickHouse operator? Что это? Программа, управляющая кластером ClickHouse в Kubernetes. Кодифицированные шаблоны. Кодифицированные best practices. ClickHouse operator? Зачем это? • Позволяет именно ClickHouse кластеризуется. • Позволяет легко автоматизировать типовые задачи. ClickHouse operator? Кому это надо? • Тем, кто находится в начале пути. • Тем, у кого есть типовая инсталляция. • много типовых задач, т.е. требуется автоматизация. ClickHouse operator – управление кластером как ОДНИМ РЕСУРСОМ ClickHouse Operator ClickHouseInstallation YAML file Лицензия: Apache 2.0, Распространяется0 码力 | 44 页 | 2.24 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 13 C++ STL 容器全解之 vectornoexcept; vector 容器: operator[] • 要访问 vector 里的元素,只需用 [] 运算符 : • 例如 a[0] 访问第 0 个元素(人类的第一 个) • 例如 a[1] 访问第 1 个元素(人类的第二 个) • int &operator[](size_t i) noexcept; • int const &operator[](size_t i) const vector 容器: operator[] • 值得注意的是, [] 运算符在索引超出数组大 小时并不会直接报错,这是为了性能的考虑。 • 如果你不小心用 [] 访问了越界的索引,可能 会覆盖掉别的变量导致程序行为异常,或是访 问到操作系统未映射的区域导致奔溃。 • int &operator[](size_t i) noexcept; • int const &operator[](size_t const; vector 容器: operator[] 和 at • [] 和 at 除了可以读取元素,还可以写入。 • 这是因为他们返回的是元素的引用 int& 。 • 例如给第 i 个元素赋值 val : • a[i] = val; • 读取第 i 个元素并打印: • cout << a[i] << endl; • int &operator[](size_t i) noexcept;0 码力 | 90 页 | 4.93 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 15 C++ 系列课:字符与字符串还得套一层壳 string(“hello”) 才能变成安全封装的类型,才能用他 的成员函数。 • 因此, C++14 引入了一项缓解“键盘压力”的新特性: • 写 “ hello”_s 就相当于写 operator“”_s(“hello”, 5) ,就相当于 string(“hello”, 5) 了。 • 为什么还需要指定长度 5 ?其实不指定也可以,就是 “ hello\0world” 会退化 这个特殊的名字空间里包含了所有的 operator“” 函数。 小彭老师锐评:何谓“键盘压力” • 高情商:键盘压力,指的是程序员敲击键盘时产生的心理压力。 • 低情商:键盘压力,指的是 rust 键盘侠对 cpp 标准委员会的压力。 • rust 键盘侠曰:我们有 233_i32 , cpp 做得到吗? • cpp 标准委员会:谢邀,人在 cpp14 ,已经在 operator“”_i32 了。 • allocator 不必占据额外的空间。 • 问题:既然 allocator 往往都是个空类( std::allocator默认就是空类,只有几个 成员函数负责调用 operator new 和 operator delete ),为什么还要把 allocator 对 象存到 string 对象里,最后还要搞什么空基类优化防止他浪费空间,多此一举? • 因为最近开始流行“有状态分配器”了,侯杰老师显然不知道这一点,在他的 0 码力 | 162 页 | 40.20 MB | 1 年前3
共 20 条
- 1
- 2













