NVIDIA သည် Rust ဘာသာစကားဖြင့် GPU kernel များ တီထွင်ရန်အတွက် CUDA Rust ကို မိတ်ဆက်ခဲ့သည်။

NVIDIA သည် Rust ဘာသာစကားအား GPU ပေါ်တွင် လည်ပတ်နေသော kernel များကို တီထွင်နိုင်စေမည့် CUDA Rust toolkit ၏ ဖွံ့ဖြိုးတိုးတက်မှုကို ကြေညာခဲ့သည်။ toolkit သည် compile time တွင် memory safety ကို သေချာစေပြီး race condition များကို ကာကွယ်ပေးသည်။ လာမည့်နှစ်တွင် CUDA Rust ကို CUDA C++ နှင့် CUDA Python toolkit ကဲ့သို့ production project များအတွက် သင့်လျော်သော အဆင့်အထိ တီထွင်ရန် စီစဉ်ထားသည်။

CUDA Rust toolchain သည် parallel kernels များ တည်ဆောက်ရန်အတွက် မော်ဒယ်နှစ်ခုကို ပံ့ပိုးပေးသည်- SIMT (Single Instruction, Multiple Threads) နှင့် Tile။ SIMT မော်ဒယ်သည် single thread ၏ low-level definition၊ ထိုကဲ့သို့သော thread ထောင်ပေါင်းများစွာကို launching နှင့် management လုပ်ခွင့်ပြုသည်။ Tile မော်ဒယ်သည် ပိုမိုမြင့်မားသော abstraction အဆင့်ကို ပေးဆောင်ပြီး တစ်ဦးချင်းစီ thread များကို ရှင်းလင်းစွာ စီမံခန့်ခွဲမည့်အစား data blocks (tiles) များပေါ်တွင် လုပ်ဆောင်ရန် algorithms များကို သတ်မှတ်ထားပြီး Tile IR compiler သည် thread manipulation၊ access synchronization၊ memory management နှင့် tensor cores များတစ်လျှောက် data distribution အားလုံးကို ကိုင်တွယ်သည်။

SIMT မော်ဒယ်ကို အသုံးပြု၍ Rust ဘာသာစကားတွင် ဖွံ့ဖြိုးတိုးတက်မှုအတွက်၊ စံအမျိုးအစားစနစ်နှင့် Rust ပိုင်ဆိုင်မှုမော်ဒယ်ကို အသုံးပြု၍ Rust ဘာသာစကားတွင် ကုဒ်များကို အကောင်အထည်ဖော်ရန် ညွှန်ကြားချက်များထဲသို့ တိုက်ရိုက် စုစည်းနိုင်စေမည့် cuda-oxide compiler ကို တီထွင်နေပါသည်။ virtual machine CUDA PTX (Parallel Thread Execution)။ GPU kernel များကို ပုံမှန် Rust ဖြင့် ရေးသားထားသော်လည်း no_std ပတ်ဝန်းကျင်တွင် လည်ပတ်ပြီး စံ Rust library (libstd) သို့ ဝင်ရောက်ခွင့်မရှိဘဲ libcore library နှင့် အထူးပြု Rust abstractions များမှ လုပ်ဆောင်ချက်များကိုသာ အသုံးပြုနိုင်သည်။

Rust ဖြင့်ရေးသားထားသော CUDA kernels များသည် type protection (safe)၊ unsafe blocks များအသုံးပြုခြင်းနှင့် low-level hardware instructions များကို ဝင်ရောက်ကြည့်ရှုခြင်းတို့ကို ခွင့်ပြုသည်။ ဘေးကင်းလုံခြုံမှုရှိစေရန်အတွက် thread တစ်ခုချင်းစီတွင် ၎င်းတို့၏ကိုယ်ပိုင် data များကိုသာ exclusive access ရရှိစေမည့် DisjointSlice type ကို အဆိုပြုထားသည်။ cuda-oxide code ကို Apache 2.0 license အောက်တွင် license ပေးထားသည်။

Tail မော်ဒယ်ကို အကောင်အထည်ဖော်ရန်အတွက် cutile-rs library ကို အဆိုပြုထားပါသည်။ ၎င်းသည် Rust idiomatic language ကို အသုံးပြု၍ CUDA kernels များသို့ တိုက်ရိုက် compile လုပ်သည့် code ကို ဖန်တီးနိုင်စေပါသည်။ Cutile-rs သည် GPU ပေါ်တွင် run နေသော code များအတွက် Rust ၏ တင်းကျပ်သော ownership နှင့် borrowing rules များကို အသုံးချပါသည်။ kernel ကို data block ပေါ်တွင် operating single-threaded program တစ်ခုအဖြစ် အကောင်အထည်ဖော်ပြီး compiler သည် computation ကို thread များအဖြစ် အလိုအလျောက် ပိုင်းခြားပြီး ၎င်းတို့၏ synchronization ကို သေချာစေသည်။ thread များကို immutable tensors များသို့ shared access ပေးထားပြီး mutable tensors များကို disjoint blocks များအဖြစ် ပိုင်းခြားထားသည်။ cutile-rs code ကို Apache 2.0 license အောက်တွင် ဖြန့်ဝေထားသည်။

source: opennet.ru

DDoS ကာကွယ်ရေး၊ VPS VDS ဆာဗာများပါသည့် ဆိုက်များအတွက် ယုံကြည်စိတ်ချရသော hosting ကို ဝယ်ယူပါ။ 🔥 DDoS ကာကွယ်မှု၊ VPS VDS ဆာဗာများပါရှိသော ယုံကြည်စိတ်ချရသော ဝဘ်ဆိုက် hosting ကို ဝယ်ယူပါ | ProHoster