GPU Offload in Rust: Portable, Safe, and Fast
摘要
论文提出一个直接内建在 rustc 与 LLVM 后端中的多厂商 GPU 编译框架,目标是零开销且不牺牲内存安全。作者利用 Rust 的类型系统、所有权模型与 noalias 严格别名保证,通过 LLVM 的 Offload 基础设施管理数据迁移,并针对主机与设备目标间的跨厂商 ABI 降级不匹配问题,引入两遍编译管线以安全处理手动与编译器生成的内存移动。在 RAJAPerf 基准上的评估显示,该 rustc 方案能为 GPU 内核生成有竞争力的 LLVM IR,内核性能接近原生手写优化的 CUDA 与 HIP C++ 基线。
荐读理由
这篇论文展示的 rustc 原生 GPU 卸载框架,能让你在 Rust 里写 GPU 内核时既保住内存安全又免去厂商锁定的 DSL,性能还对标手写 CUDA/HIP,值得你评估是否引入到自己的 AI 工程栈
原文
Computer Science > Programming Languages
[Submitted on 13 Aug 2026]
Title:GPU Offload in Rust: Portable, Safe, and Fast
Authors:Manuel S. Drehwald, Marcelo Domínguez, Kevin Sala, Alán Aspuru-Guzik, Johannes Doerfert
View a PDF of the paper titled GPU Offload in Rust: Portable, Safe, and Fast, by Manuel S. Drehwald and 4 other authors
Abstract:High-performance GPU programming has traditionally forced a compromise between execution efficiency and memory safety. While Rust guarantees compile-time memory safety for host CPUs via its strict ownership model, applying these constraints to massively parallel GPU execution environments has previously mandated either vendor-locked Domain-Specific Languages (DSLs) or escaping to explicit unsafe raw pointers. This paper presents a zero-overhead, multi-vendor GPU compilation framework built natively into the Rust compiler (rustc) and LLVM backends. We leverage Rust's rich type system, ownership system, and strict aliasing guarantees (noalias) to efficiently manage and optimize data transfers through LLVM's Offload infrastructure. We expose the technical challenges of cross-vendor ABI lowering mismatches between Host and Device targets and introduce a two-pass compilation pipeline capable of safely handling both manual and compiler-generated memory movements. Evaluating our framework on RAJAPerf demonstrates that our rustc-based solution can generate competitive LLVM IR for GPU kernels, achieving a solid kernel performance against native, hand-optimized CUDA and HIP C++ baselines.
https://doi.org/10.48550/arXiv.2608.13759
arXiv-issued DOI via DataCite (pending registration)
| Comments: | |
|---|---|
| Subjects: | Programming Languages (cs.PL) |
| Cite as: | arXiv:2608.13759 [cs.PL] |
| (or arXiv:2608.13759v1 [cs.PL] for this version) | |
Submission history
From: Manuel Sebastian Drehwald [view email] [v1] Thu, 13 Aug 2026 20:37:48 UTC (88 KB)
Full-text links:
Access Paper:
View a PDF of the paper titled GPU Offload in Rust: Portable, Safe, and Fast, by Manuel S. Drehwald and 4 other authors
Current browse context:
cs.PL
Change to browse by:
References & Citations
Loading...
BibTeX formatted citation
Data provided by:
Bookmark
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
ScienceCast (What is ScienceCast?)
Demos
Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
Author
Venue
Institution
Topic
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
这条对你有帮助吗?