ESC
开源 3 分钟阅读

Rust 中的 GPU 卸载:可移植、安全且快速

研究人员提出了一个内置于 Rust 编译器 rustc 和 LLVM 后端的零开销、多厂商 GPU 卸载编译框架。利用 Rust 的所有权与严格别名保证,通过 LLVM Offload 基础设施管理数据迁移,提出两遍编译流程处理跨厂商 ABI 差异。RAJAPerf 基准测试显示,其生成的 LLVM IR 在 GPU 内核性能上可与手写优化的 CUDA/HIP C++ 基线匹敌。

来源:Hacker News

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

View PDF HTML (experimental)

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.

Comments:

Subjects:

Programming Languages (cs.PL)

Cite as: arXiv:2608.13759 [cs.PL]

  (or arXiv:2608.13759v1 [cs.PL] for this version)

  https://doi.org/10.48550/arXiv.2608.13759

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Manuel Sebastian Drehwald [view email] [v1] Thu, 13 Aug 2026 20:37:48 UTC (88 KB)

Full-text links:

Access Paper:

license icon view license

Current browse context:

cs.PL

[   |   next >

new | recent | 2026-08

Change to browse by:

cs

References & Citations

Loading…

BibTeX formatted citation

loading…

Data provided by:

Bookmark

[ BibSonomy ](http://www.bibsonomy.org/BibtexHandler?requTask=upload&url=https://arxiv.org/abs/2608.13759&description=GPU Offload in Rust: Portable, Safe, and Fast) [ Reddit ](https://reddit.com/submit?url=https://arxiv.org/abs/2608.13759&title=GPU Offload in Rust: Portable, Safe, and Fast)

Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer (What is the Explorer?)

Connected Papers Toggle

Connected Papers (What is Connected Papers?)

Litmaps Toggle

Litmaps (What is Litmaps?)

scite.ai Toggle

scite Smart Citations (What are Smart Citations?)

Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv (What is alphaXiv?)

Links to Code Toggle

CatalyzeX Code Finder for Papers (What is CatalyzeX?)

DagsHub Toggle

DagsHub (What is DagsHub?)

GotitPub Toggle

Gotit.pub (What is GotitPub?)

Huggingface Toggle

Hugging Face (What is Huggingface?)

ScienceCast Toggle

ScienceCast (What is ScienceCast?)

Demos

Demos

Replicate Toggle

Replicate (What is Replicate?)

Spaces Toggle

Hugging Face Spaces (What is Spaces?)

Spaces Toggle

TXYZ.AI (What is TXYZ.AI?)

Related Papers

Recommenders and Search Tools

Link to Influence Flower

Influence Flower (What are Influence Flowers?)

CORE Recommender (What is CORE?)

  • Author
  • Venue
  • Institution
  • Topic

About arXivLabs

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?)