首页›Raph Levien›文章

I want a good parallel computer

2025年3月21日

AI 摘要 AI 生成,可能有误

文章认为,尽管GPU的算力是CPU的10到100倍,但贫乏的执行模型以及不足的语言和工具阻碍了它成为通用并行计算机,作者在Vello 2D渲染器中与有界内存作斗争的艰难经历便是例证。通过回顾连接机、Cell和Larrabee等历史设计,作者表明曾经存在很有前景的并行架构,但都未能流行开来,最终只留下了如今过于复杂的GPU和功能受限的AI加速器。随着工作负载日益向计算密集型转移,作者相信一种更简单、更强大的并行计算机是可能的,并指出了前进的路径,例如配备大规模CPU核心阵列的芯片。

The GPU in your computer is about 10 to 100 times more powerful than the CPU, depending on workload. For real-time graphics rendering and machine learning, you are enjoying that power, and doing those workloads on a CPU is not viable. Why aren’t we exploiting that power for other workloads? What prevents a GPU from being a more general purpose computer?

I believe there are two main things holding it back. One is an impoverished execution model, which makes certain tasks difficult or impossible to do efficiently; GPUs excel at big blocks of data with predictable shape, such as dense matrix multiplication, but struggle when the workload is dynamic. Second, our languages and tools are inadequate. Programming a parallel computer is just a lot harder.

Modern GPUs are also extremely complex, and getting more so rapidly. New features such as mesh shaders and work graphs are two steps forward one step back; for each new capability there is a basic task that isn’t fully supported.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Raph Levien

A note on Metal shader converter

AI 摘要The author critiques Apple's new Metal shader converter, which eases porting DirectX 12 games by translating DXIL/HLSL shaders to Metal, arguing it adds underspecified complexity rather than advancing robust GPU infrastructure. A key complaint is that Metal remains the only major GPU API lacking device-scope atomic barriers (present in HLSL since Direct3D 11 in 2009), which prevents single-pass prefix sum implementations and reliable cross-threadgroup coordination, and in turn holds back WebGPU's performance. The author recommends Apple document which HLSL features are unsupported, and points to WebGPU and Asahi Linux's work as more promising paths toward well-specified, portable GPU compute.

Simplifying Bézier paths

AI 摘要The article describes refinements to curve-fitting techniques for approximating arbitrary curves with near-optimal Bézier paths, implemented in the Rust library kurbo, built around a new ParamCurveFit trait and efficient error evaluation using Green's theorem area/moment prefix sums. It covers error metrics, favoring Fréchet distance approximated via Tiller-Hanson ray casting, with a slower but more robust arc-length approach used for 'spicy' high-curvature regions, and goes beyond simple adaptive subdivision by optimizing subdivision point placement to minimize segment count. Finally, it addresses an unexpected problem where aggressively Fréchet-optimized curves develop bumps, solved by penalizing extreme control-point configurations to keep the output smooth at a cost of only one additional segment.

Moving from Rust to C++

AI 摘要This is a satirical April Fools' post in which the author, a longtime Rust developer, mock-announces that the Linebender GUI projects will migrate from Rust to C++. In a deliberately persuasive style, the piece humorously dismisses memory safety concerns, praises C++'s abundance of build systems and rapid language evolution, and claims the C++ community is friendlier. The post is intended to satirize bad arguments commonly made against Rust, with the author noting afterward that its serious points and tone confused some readers.

Requiem for piet-gpu-hal

AI 摘要The article explains why the Vello 2D GPU renderer (formerly piet-gpu) abandoned piet-gpu-hal, its hand-rolled GPU abstraction layer, in favor of wgpu and the WebGPU/WGSL ecosystem. Although the custom layer achieved goals like precompiled shaders (saving binary size and startup time) and access to advanced GPU features such as subgroups and descriptor indexing, wgpu offers a better developer experience, community tooling, and web deployment. The author reflects on lessons learned, notes WebGPU pain points, and says the roadmap may eventually revisit precompiled shaders and native back-ends to regain those lost capabilities.

Raph’s reflections and wishes for 2023

AI 摘要The author reflects on 2022 and sets goals for 2023, centered on his ambitious portfolio of Rust UI infrastructure projects. His biggest priority is shipping Vello, a GPU-accelerated 2D renderer (formerly piet-gpu), while Xilem, a reactive UI architecture he believes is the best for Rust, will depend largely on community contributions. He also plans to continue curve and GPU compute research, but explicitly rules out writing a shader language or academic papers, preferring his blog and open source work as his main channels for sharing results.