GPU Offload in Rust: Portable, Safe, and Fast

(arxiv.org)

101 points | by linggen 3 hours ago

9 comments

  • whateverboat 20 minutes ago
    > This module is under active development. Once upstream, it should allow Rust developers to run Rust code on GPUs. We aim to develop a rusty GPU programming interface, which is safe, convenient and sufficiently fast by default. This includes automatic data movement to and from the GPU, in a efficient way. We will (later) also offer more advanced, possibly unsafe, interfaces which allow a higher degree of control.

    I really appreciate the work and the effort that went into this. However, such an approach has previously not really worked for C++ with LLVM offload. Why would it work for Rust?

  • boywitharupee 27 minutes ago
    is this mainly about making host binaries self-contained for heterogenous workloads?

    also, seems like this is mostly targeted towards HPC audience?

  • Thomashuet 2 hours ago
    That's promising but did they publish any code? I can't find anything in the abstract.
  • maxchisto 1 hour ago
    does anyone know Mojo well enough to comment how Rust + gpu-offload compares to it?
    • giancarlostoro 1 hour ago
      Mojo is not fully open sourced yet, but it will eventually be, would be an interesting comparison though.
      • maxchisto 53 minutes ago
        Mojo's OSS status doesn't prevent us from evaluating its memory model, writing and benchmarking kernels in it, etc
        • giancarlostoro 51 minutes ago
          Sure, and I realized after I posted the std lib is opened up, not sure how much of it will reveal the underlying Mojo specifics though.
  • jasonjmcghee 1 hour ago
    > the rust-gpu project has to emulate pointers[8], which we consider a blocking issue for most HPC benchmarks.

    Why is it a blocking issue?

    I feel like this is very aligned with the goals of rust-gpu.

    • minraws 55 minutes ago
      Pointers are sort of needed for high performance memory management for HPC targets for existing design patterns, maybe we can think of better solutions down the line but it's hard for me to say anything I just use/abuse CUDA pointers as well.
      • adgjlsfhk1 50 minutes ago
        Julia has pretty good design heritage for how to deal with this sort of thing. you build the right abstractions and everything works (the main key is making sure the compiler elides bounds checks)
  • Alephinitesimal 1 hour ago
    The NVIDIA+AMD support is the part I find really interesting. I know OpenMP and SYCL can already target multiple GPU vendors, but doing this while keeping Rust's safety model seems pretty compelling. I'm curious how portable the performance is in practice.
  • jheriko 1 hour ago
    [dead]
  • iberator 2 hours ago
    [flagged]
    • aabhay 2 hours ago
      Genuinely curious what these constant changes are. In fact I don’t feel they’re moving fast enough to give us improvements to core.
      • frollogaston 2 hours ago
        It was changing quickly in the earliest releases, about 10 years ago. Like one day I pulled our repo and there was new "?" syntax, but that was a feature I'd been wanting anyway.

        Edit: Oh, async/await was a bigger and more recent one, 2019. I've heard that this wasn't an easy decision for them but was kinda needed.

        • aabhay 1 hour ago
          A few years in between releases with a sane versioning system seems fine to me. If you don’t want new features don’t build with that new toolchain.

          It’s not javascript where you need to support all possible browsers.

          • frollogaston 1 hour ago
            Teams will disagree over what toolchain to use, and you will read others' code, so this doesn't dodge the issue. Otherwise there'd be no complaint about C++. I don't think Rust is bloated though, every feature has a very good reason.
    • jjice 2 hours ago
      That's an opinion. One you're very welcome to hold, but it's not universal by any means. Lots of people enjoy rust.
  • rfgplk 1 hour ago
    Fascinating how many people still overcomplicate offloading to GPUs.