timerring

CUDA Thread Indexing

August 9, 2023 · 18 min read
Tutorial
CUDA | GPU

结合向量相加和图像处理,介绍 CPU 与 GPU 内存操作、线程索引以及 Grid 和 Block 的配置。

我们要处理的问题

如图,有离散型的,例如向量相加等等。有 local 卷积类型的,用其他一片的元素值求得一个元素。还有 All to All 类型的,类似于傅里叶变换。

回顾一下 CUDA 程序的编写:

  1. 把输入数据从 CPU 内存复制到 GPU 显存
  2. 在执行芯片上缓存数据,加载 GPU 程序并执行
  3. 将计算结果从 GPU 显存中复制到 CPU 内存中
...


Apache Thrift RPC and Matchmaking Service

August 8, 2023 · 72 min read
Tutorial
Thrift | VPS

thrift 是一种接口描述语言和二进制通讯协议,它被用来定义和创建跨语言的服务。

Thrift 是 Facebook 于 2007 年开发的跨语言的 RPC(Remote Procedure Call,远程过程调用)服务框架,提供多语言的编译功能,并提供多种服务器工作模式;用户通过 Thrift 的 IDL(接口定义语言)来描述接口函数及数据类型,然后通过 Thrift 的编译环境生成各种语言类型的接口文件,用户可以根据自己的需要采用不同的语言开发客户端代码和服务器端代码,让不同语言构建的服务可以做到远程调用无缝对接。(它们的目的都是提供本地调用远程服务的能力)

RPC(Remote Procedure Call,远程过程调用)是一个计算机通信协议,此协议允许进程间通信。简单来说,当机器 A 上的进程调用机器 B 上的进程时,A 上的调用进程被挂起,而 B 上的被调用进程开始执行。调用方可以通过参数将信息传送给被调用方,然后可以通过被调用方传回的结果得到返回
大部分的RPC框架都遵循如下三个开发步骤:

  1. 定义一个接口说明文件:描述了对象(结构体)、对象成员、接口方法等一系列信息;
  2. 通过RPC框架所提供的编译器,将接口说明文件编译成具体的语言文件;
  3. 在客户端和服务器端分别引入RPC编译器所生成的文件,即可像调用本地方法一样调用服务端代码;
    RPC是一种C/S架构的服务模型,server端提供接口供client调用,client端向server端发送数据,server端接收client端的数据进行相关计算并将结果返回给client端。
...


Go Practical Examples: Guessing Game, CLI Dictionary, and SOCKS5 Proxy

August 2, 2023 · 47 min read
Tutorial
Go

这篇文章完整整理自本地的 Go 语言实战入门笔记,依次练习猜数字、命令行词典和 SOCKS5 代理。保留原笔记的分步讲解、代码及外部图床图片。

运行前注意:词典案例使用第三方接口,当前可用性及授权方式尚未验证。原笔记的浏览器令牌和 Cookie 已从代码中移除;运行前应从服务提供方取得合法凭据,并在本机环境变量 CAIYUN_DICT_TOKEN 中设置,切勿将凭据提交到仓库。SOCKS5 示例没有认证,仅用于本机学习,请勿作为公网代理部署。图片链接指向原笔记的外部图床,是否可长期访问取决于图床。

...


LaTex basic concepts

August 2, 2023 · 10 min read
Tutorial
TeX

TEX #

TEX is software developed by Donald E. Knuth for typesetting text and mathematical formulas. In 1977, while writing The Art of Computer Programming, Knuth realized that the steadily declining typesetting quality would affect the publication of his work. To reverse this situation, he began developing TEX, tapping into the potential of digital printing equipment that had just begun to be used in the publishing industry at the time. In 1982, Knuth released the TEX typesetting engine, and later improved it in 1989 to better support 8-bit characters and multilingual typesetting. TEX is renowned for its outstanding stability, cross-platform capabilities, and almost bug-free nature. Its version number continuously approaches π, and is currently 3.141592653.

...


AI开发硬件环境综述

March 14, 2023 · 17 min read
Tutorial
GPU

笔记本选配 #

出于通勤等因素,建议型号

  • MacBook Air M1 16+ 256

  • MacBook Pro M1 16 + 256

M1芯片的mbp非常强大,发热不严重,甚至在Air版没风扇.

...