Gipagawas sa Nvidia ang CUDA-oxide, usa ka Rust-to-CUDA compiler.

Kompanya sa Nvidia gipatik unang pagpagawas sa toolkit CUDA-oxide, nga nagtugot kanimo sa paghimo og parallel GPU kernels sa Rust nga pinulongan CUDA SIMT (Usa ka Instruksyon, Daghang mga Hilo). Ang proyekto nagtugot kanimo sa pag-compile sa Rust code gamit ang standard type system ug modelo sa pagpanag-iya Rust, direkta sa mga instruksyon alang sa pagpatuman sa CUDA virtual machine PTX (nvidia.com) (Parallel Thread Execution) nga walay paggamit og intermediate domain-specific languages ​​(DSLs) ug bindings.

Ang toolkit code gisulat sa Rust ug giapod-apod sa ubos sa lisensya sa Apache 2.0. Ang unang pagpagawas gipahimutang isip inisyal nga alpha nga bersyon.

Ang toolkit naglakip sa:

  • Usa ka code generation backend para sa rustc compiler nga nagtugot kanimo sa pag-compile sa mga function gamit ang "#[ubod]" ngadto sa parallel GPU kernels sa CUDA PTX representation. Ang compilation naggamit sa standard rustc framework-based transformation chain. Pliron: Rust → MIR → Pliron IR → LLVM IR → PTX.
  • Usa ka nahiusang sistema para sa pag-assemble sa mga component nga nagdagan sa host system ug sa GPU, nga nag-agad sa pagpatuman sa mga command nga "cargo oxide build" ug "cargo oxide run".
  • Usa ka hugpong sa mga Rust abstraction nga magamit sa mga GPU-side kernel. Pananglitan, adunay mga function nga magamit para sa indexing, shared memory ug barrier usage, atomic operations, ug thread group synchronization. TMA (nvlabs.github.io) (Tensor Memory Accelerator). Posible nga motawag og mga binding para sa mga low-level nga instruksyon nga espesipiko sa arkitektura sa Blackwell (pananglitan, mga operasyon sa extended matrix).
  • Mga pakete sa crate nga adunay host-based CUDA runtime components nga makapahimo sa pagdumala sa memorya, pagpadagan sa mga kernel sa GPU, ug pagpakig-uban sa mga gimbuhaton nga nakabase sa GPU nga asynchronously.
  • Usa ka koleksyon sa mga ehemplo sa kernel nga nagpakita sa mga bahin sama sa vector manipulation, matrix multiplication (GEMM), atomic operations, asynchronous execution, ug library integration. MathDx, gamit ang mga generic ug closure, nga nakig-interact sa mga CUDA core sa C++/CCCL.

Ang mga GPU kernel gihimo sa regular nga Rust (dili usa ka diyalekto), apan gipadagan sa palibot walay_std ug magamit ra ang mga gimbuhaton gikan sa librarya libcore ug ang nahisgotan na nga espesyal nga mga abstraction sa Rust, nga walay access sa Rust standard library (libstd). Ang gisuportahan nga mga tipo naglakip sa mga primitive type (u8..u64, f32, f64, bool), mga istruktura, mga enumerasyon, mga tuple, mga array ([T; N]) ug mga slice (&[T]), mga operator sa match / if / if let, for ug while loops, mga iterator (.iter(), .enumerate()), mga closure, ug mga generic. Dili gisuportahan ang mga tipo sa String, Vec, ug Box, format!, panic!, ug println! macros, mga Trait object, ug mga standard library function nga gipatuman pinaagi sa mga tawag sa operating system (pagdumala sa file, I/O, ug mga operasyon sa network).

Anaa na Tulo ka lebel sa kaluwasan sa CUDA core sa Rust: proteksyon sa tipo sa sistema (luwas), paggamit sa dili luwas nga mga bloke, ug pag-access sa mga instruksyon sa hardware nga ubos ang lebel. Ang performance sa CUDA-oxide-based matrix multiplication implementation (GEMM SoL) sa usa ka B200 GPU nakaabot sa 868 trilyon nga operasyon kada segundo, nga 58% sa performance sa gi-optimize nga library. cuBLAS.

Source: linux.org.ru

Pagpalit kasaligan nga pag-host alang sa mga site nga adunay proteksyon sa DDoS, mga server sa VPS VDS 🔥 Pagpalit og kasaligang website hosting nga adunay proteksyon sa DDoS, VPS VDS servers | ProHoster