CUDA Programming on Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ค. 2024
  • In this tutorial, I’ll show you everything you need to know about CUDA programming so that you could make use of GPU parallelization, thru simple modifications of your already existing code, running on a boring CPU. The following tutorial was recorded on NVIDIA’s Jetson Orin supercomputer. CUDA stands for Compute Unified Device Architecture, and is a parallel computing platform and application programming interface that enables software to use certain types of graphics processing units for general purpose processing, an approach called general-purpose computing on GPUs.
    First, I will start by writing a simple function that does a vector multiplication, which is going to run on a CPU. Then we get the same job done using CUDA parallelization on a GPU. Keep in mind that GPU’s have more cores than CPU and hence when it comes to parallel computing of data, GPUs perform exceptionally better than CPUs even though GPUs have lower clock speed and lack several core management features as compared to CPUs. An example reveals that running 64 million massive multiplications on a GPU takes about 0.64 seconds, as opposed to 31.4 seconds when running on a CPU. This translates to a x50 gain in terms of speed, thanks to the parallelization on such a huge number of cores. Amazing ! This means that running a complex program on CPU taking about a month, could be executed in 14 hrs. This could be also faster given more cores.
    Then, I’ll show you the gains in filling arrays on python on a CPU vs on a GPU. Another example reveals that the amount of time it took to fill the array on a CPU is about 2.58 seconds, as opposed to 0.39 seconds on a GPU, which is a gain of about 6.6x. The last fundamental section of this video is to show the gains in rendering images (or videos) on python. We will demonstrate why you see some film producers or movie makers rendering and editing their content on a GPU. GPU rendering delivers with a graphics card rather of a CPU, which may substantially speed up the rendering process because GPUs are primarily built for fast picture rendering. GPUs were developed in response to graphically intensive applications that taxed CPUs and slowed processing speed. I will use the Mandelbrot set to perform a comparison between CPU and GPU power. This example reveals that only 1.4 seconds of execution is needed on a GPU as opposed to 110 seconds on a CPU, which is a 78x gain. This simply means that instead of rendering a 4K resolution video over a week on a CPU, you could get the same video in 8K resolution rendered in 2 hours on a GPU, if you are using 32 threads. So imagine if you doubled the threads and blocks involved in GPU optimization.
    ⏲Outline⏲
    00:00 Introduction
    00:33 Multiplication gains on GPUs vs CPUs
    08:31 Filling an array on GPUs vs CPUs
    11:55 Rendering gains on GPU vs CPU
    12:35 What is a Mandelbrot set ?
    13:39 Mandelbrot set rendering on CPU
    17:01 Mandelbrot set rendering on GPU
    20:54 Outro
    📚Related Lectures
    Jetson Orin Supercomputer - • The BEST & SMALLEST AI...
    Quick Deploy: Object Detection via NGC on Vertex AI Workbench Google Cloud - • Quick Deploy: Object D...
    Voice Swap using NVIDIA's NeMo - • Voice Swap using NVIDI...
    🔴 Subscribe for more videos on CUDA programming
    👍 Smash that like button, in case you find this tutorial useful.
    👁‍🗨 Speak up and comment, I am all ears.
    💰 Donate to help the channel
    Patreon - / ahmadbazzi
    BTC wallet - 3KnwXkMZB4v5iMWjhf1c9B9LMTKeUQ5viP
    ETH wallet - 0x44F561fE3830321833dFC93FC1B29916005bC23f
    DOGE wallet - DEvDM7Pgxg6PaStTtueuzNSfpw556vXSEW
    API3 wallet - 0xe447602C3073b77550C65D2372386809ff19515b
    DOT wallet - 15tz1fgucf8t1hAdKpUEVy8oSR8QorAkTkDhojhACD3A4ECr
    ARPA wallet - 0xf54bEe325b3653Bd5931cEc13b23D58d1dee8Dfd
    QNT wallet - 0xDbfe00E5cddb72158069DFaDE8Efe2A4d737BBAC
    AAVE wallet - 0xD9Db74ac7feFA7c83479E585d999E356487667c1
    AGLD wallet - 0xF203e39cB3EadDfaF3d11fba6dD8597B4B3972Be
    AERGO wallet - 0xd847D9a2EE4a25Ff7836eDCd77E5005cc2E76060
    AST wallet - 0x296321FB0FE1A4dE9F33c5e4734a13fe437E55Cd
    DASH wallet - XtzYFYDPCNfGzJ1z3kG3eudCwdP9fj3fyE
    #cuda #cudaprogramming #gpu

ความคิดเห็น • 765

  • @nilsu1941
    @nilsu1941 ปีที่แล้ว +104

    12:36 This guy is a God !

  • @aishahoura2619
    @aishahoura2619 ปีที่แล้ว +152

    Thank you so much for responding to my request for making a CUDA programming. I have donated 0.1 BTC to your account as a way to thank you. My professor has done so many hours trying to explain CUDA and none of my classmates really understood. I just can not believe that you do all this for free and that is why me and my classmates have decided to collect some funds to donate to you.
    Thanks for all that you do and please keep going.

    • @AhmadBazzi
      @AhmadBazzi  ปีที่แล้ว +84

      Thank you for the donation, it really means a lot !

    • @aishahoura2619
      @aishahoura2619 ปีที่แล้ว +2

      @@AhmadBazzi No thank you !

    • @mdrubelahmed6434
      @mdrubelahmed6434 ปีที่แล้ว

      Thank you so much for responding to my request for making a CUDA programming.

    • @btspower3844
      @btspower3844 ปีที่แล้ว +1

      Wow amazing

    • @btspower3844
      @btspower3844 ปีที่แล้ว

      Wow amazing

  • @leonelaguilera9059
    @leonelaguilera9059 ปีที่แล้ว +70

    this was such an excellent video

  • @sksk-lo8kc
    @sksk-lo8kc ปีที่แล้ว +90

    That was very well explained. I have only have taken one course, and you made it clearer than my professor or fellow students ever did.

  • @denizart2255
    @denizart2255 ปีที่แล้ว +46

    You just opened my eyes to parallel programming. Thanks for the quick overview.

    • @mdrubelahmed6434
      @mdrubelahmed6434 ปีที่แล้ว

      Too hard to find high -quality content like this these days. Thank you so much

  • @Drex.Yt1
    @Drex.Yt1 ปีที่แล้ว +78

    Too hard to find high-quality content like this these days. Thank you so much

  • @aoungamingyt3160
    @aoungamingyt3160 ปีที่แล้ว +69

    Thank you so much. Probably the best introdution to CUDA with Python. The example you use, while very basic, touches on usage of blocks, which is usually omitted in other introduction-level tutorials. Great stuff! Hope you return with some more videos. I have subscribed!

  • @adeeshaamabidu9616
    @adeeshaamabidu9616 ปีที่แล้ว

    Love the channel Nicholas, have recently graduated from an NLP Master's degree and seeing you explain stuff in a simpler way and your coding challenges is really helping me connect with the material I've learned! Keep it up and I'll keep watching!

  • @pantherofficial5059
    @pantherofficial5059 ปีที่แล้ว

    I have been looking into gpu programming using numba and python for a while, this seems to be the best tutorial I was able to find so far.. . thank you

  • @Kvmizo
    @Kvmizo ปีที่แล้ว

    This was by far one of the most enlightening videos you have put up on your channel. Thanks and keep up the good work!!

  • @RAVIShankar-bm4ou
    @RAVIShankar-bm4ou ปีที่แล้ว +5

    Thank you so much for this series! It's so clear and easy to follow

  • @ricardomilos5889
    @ricardomilos5889 ปีที่แล้ว +1

    This was a great video to me, I have very limited C++ experience and was looking for an explanation of CUDA. Another video like this could easily have been 70-80% over my head. This one was only about 15% whoosh. And now I actually find C++ interesting again!

  • @apogeetheboss9999
    @apogeetheboss9999 ปีที่แล้ว

    as a data scientist +2 years of experience, i ALWAYS learn something new with your content! please nich, never stop doing this things, and also, never cut your smile in your face, even if your are having bugs!!

  • @basslvers4501
    @basslvers4501 ปีที่แล้ว

    wanted to comment that the information in this presentation is very well structured and the flow is excellent.

  • @erenbasak7694
    @erenbasak7694 ปีที่แล้ว

    Hey this is super useful! I elected High Performance Computing and Microprocessors and Embedded Systems modules for my degree, and this channel has become my go-to guide.

  • @tajaochrisciamae4121
    @tajaochrisciamae4121 ปีที่แล้ว

    what a passionate tutorial! I wish you were my professor for my parallel programming course. Well done!

  • @rameshvyas5909
    @rameshvyas5909 ปีที่แล้ว

    and that's what I call a great tutorial. Thankyou sir. I wish you make more tutorials.

  • @tatldunyas2471
    @tatldunyas2471 ปีที่แล้ว +1

    Just did my research and this guy is at one of the most prestigious universities in the world ! No wonder why his lectures come up neat !

  • @cavansirmahmudov217
    @cavansirmahmudov217 ปีที่แล้ว

    You saved me, i had to read the PointNet2 implementation for my BCS thesis. this made the job much easier!

  • @difenbahya3465
    @difenbahya3465 ปีที่แล้ว

    Thanks for the video, I found the first half and the wrap up really excellent.

  • @totallycz6819
    @totallycz6819 ปีที่แล้ว

    You are a lifesaver @Spencer, will do it next time i'm on the streaming rig!

  • @TheTurksxayers
    @TheTurksxayers ปีที่แล้ว

    Thank you for this great introduction to numba and more specifically numba+cuda.

  • @denizugurbiltekin622
    @denizugurbiltekin622 ปีที่แล้ว

    Thank you so very much. This is the exact kind of material I was looking for on this very specific subject. Kudos.

  • @user-yu4sr1ni3l
    @user-yu4sr1ni3l ปีที่แล้ว

    OHHHH MANNN, I thought about doing that but I was debating whether I'd hit the 15 minute deadline already. Good suggestion @Julian!

  • @Animals-vi5wt
    @Animals-vi5wt ปีที่แล้ว

    Woah congrats @Ally 🎊 🎉 glad you’re enjoying the challenges, plenty more to come!!

  • @fatihcalidkan2254
    @fatihcalidkan2254 ปีที่แล้ว

    holy shit, i was looking into this to speed up my mandelbrot-zooms and they are what you use as an example! This is a dream come true!

  • @lixaxel6815
    @lixaxel6815 ปีที่แล้ว

    Excellent example of vector addition of using for loop and using CUDA

  • @muradhesenov5245
    @muradhesenov5245 ปีที่แล้ว

    the essence of Deep learning in a few lines of code... awesome

  • @bununsemid8739
    @bununsemid8739 ปีที่แล้ว

    Perfect Video! Saw was revealing to me to understand how it works. Thank you! I am a new subscriber of your channel. Regards from Buenos Aires, Argentina

  • @yasincaferzade8069
    @yasincaferzade8069 ปีที่แล้ว

    Great video, I like this kind of video where you code some AI task counterclock, you teach us the concepts and show us the reality of implementing it👏

  • @weds8296
    @weds8296 ปีที่แล้ว

    Thanks for making all these topics very approachable!

  • @mrfcbs1251
    @mrfcbs1251 ปีที่แล้ว

    Oh Ahmad , your tutorials are incredible and inspiring....

  • @turkceraplyrics6701
    @turkceraplyrics6701 ปีที่แล้ว

    Hey Ahmad , I love watching your videos because of the way you tell the story. Great graphics mate. Love the reference to rocket man too... lol keep up the good work.

  • @imsoumyajitbag
    @imsoumyajitbag ปีที่แล้ว

    Awesome video !! It's preety cool to see such theoretical concepts coded and explained like this. Keep going Nich !!

  • @excolabirbuyuyecek9438
    @excolabirbuyuyecek9438 ปีที่แล้ว

    LOL. Loved the graphic at 6:23! Brought tears to my eyes.

  • @prietjepruck
    @prietjepruck ปีที่แล้ว

    Thank you very much for this tutorial. I would love to have the code available because typing it in myself from the video is a bit hard especially with the atocomplete on all the time. Keep up the good work.

  • @LouieVon
    @LouieVon ปีที่แล้ว

    This is the best introduction to CUDA I've seen, thanks a lot !

  • @merthanozer2964
    @merthanozer2964 ปีที่แล้ว

    Ohh, yes, Thank you, and the documentation at nvidia site about CUDA is highly professionally written. Thank you.

  • @officialreallvoice9545
    @officialreallvoice9545 ปีที่แล้ว

    Amazing! I'm learning so much watching you code. Thank you for sharing.

  • @uniquevlogsbyadil
    @uniquevlogsbyadil ปีที่แล้ว

    This was oddly intense. Great job Nicholas! Even though you ran out of time, this video is still a win to me. 😉

  • @crystalannringor1025
    @crystalannringor1025 ปีที่แล้ว

    Thank you so much for this video. It has helped me massively to prepare for my computer science exam.

  • @mustafasamet2783
    @mustafasamet2783 ปีที่แล้ว

    Ayyyy, so glad you like it @Patrick. For the last two weeks I've just been making videos on stuff I find hard or want to get my head around I figure it's not just me staring there at some of these concepts like huh?!? Thanks for checking it out!!

  • @yapmabekanka7151
    @yapmabekanka7151 ปีที่แล้ว

    This is amazing! Thank you for taking effort to make it!

  • @kadirylmaz356
    @kadirylmaz356 ปีที่แล้ว

    This is really helpful for my computing. Thank you.

  • @peloizol8947
    @peloizol8947 ปีที่แล้ว

    I like how you did the website for documenting the video notes for reference later

  • @todotasks7645
    @todotasks7645 ปีที่แล้ว

    Too hard to find high-quality content like this these days. ⚡

  • @aspheronn
    @aspheronn ปีที่แล้ว

    Wow It is really awesome! It is much better than a tutorial from university! Thanks!

  • @coolboy_0459
    @coolboy_0459 ปีที่แล้ว

    I was needing this!!! Thanks a lot, Sir!!!!

  • @astaadxofficials7813
    @astaadxofficials7813 ปีที่แล้ว

    I have no idea what kind of videos i am watching ... but i sure will learn

  • @yusifhsnov1802
    @yusifhsnov1802 ปีที่แล้ว

    So stoked you liked it 🙏

  • @bodyprodaction9718
    @bodyprodaction9718 ปีที่แล้ว

    Well just built a new rig with a 980ti and a 4790k so I'm gonna put that to test. Thank you for your wonderful explanation :D

  • @-oof1016
    @-oof1016 ปีที่แล้ว

    Ahmad , thanks for taking time to create these videos. It is unfortunate that people view your videos and then feel inspired to complain about a free gift. Folks could just keep it moving or add helpful insights.

  • @alizz3984
    @alizz3984 ปีที่แล้ว

    I feel like Cuda has been demystified. Very glad I found your series.

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⤴️

  • @caneruc8534
    @caneruc8534 ปีที่แล้ว

    This was really good. Thanks for posting this!

  • @mehmetplgx8025
    @mehmetplgx8025 ปีที่แล้ว

    Love your videos. Please don't stop!

  • @kelechijames5577
    @kelechijames5577 ปีที่แล้ว

    This is very helpful. Most people don't realize the overheads and code refactoring necessary to take advantages of the GPUs. I am going to refactor a simple MNIST training propgram I have which currently uses only Numpy. See if I can get meaningful improvements in training time.

  • @kuzeyylmaz8726
    @kuzeyylmaz8726 ปีที่แล้ว

    Many thanks for the lucid explanation.

  • @pikutheboss576
    @pikutheboss576 ปีที่แล้ว

    Great explanation! Fascinatingly clear

  • @MTHHC
    @MTHHC ปีที่แล้ว

    Hey, thanks for explanation! Very well done 👍 I am downloading CUDA 💪

  • @rithusvlogtime3342
    @rithusvlogtime3342 ปีที่แล้ว

    Fantastic tutorials on CUDA. You deserve more followers.

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⤴️

  • @theatlantisreport1595
    @theatlantisreport1595 ปีที่แล้ว

    This reminds me a lot of the computer tutorial tapes from the 90s

  • @madkar988
    @madkar988 ปีที่แล้ว

    This is excellent material! Thank you!

  • @saint-petersburg8392
    @saint-petersburg8392 ปีที่แล้ว

    this was such an excellent video, thank you so much!

  • @berkozdeser8460
    @berkozdeser8460 ปีที่แล้ว

    this is extremely helpful. you did an amazing job explaining the foundations

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⤴️

  • @vanshd6884
    @vanshd6884 ปีที่แล้ว

    PS. I really so moved for your stock price episode. thank you so sosososo much.

  • @burakcetin317
    @burakcetin317 ปีที่แล้ว

    Excellent explanation, keep going with this content man ;)

  • @simsek9304
    @simsek9304 ปีที่แล้ว

    Excellent, many thanks for your explanations

  • @_jack_cruusc_tech_5688
    @_jack_cruusc_tech_5688 ปีที่แล้ว

    Awesome! learning never stops.

  • @mehmetunnu4126
    @mehmetunnu4126 ปีที่แล้ว

    It's very informative and a good intro to CUDA programming. Thanks very much!

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⬆️

  • @ezgisahin5839
    @ezgisahin5839 ปีที่แล้ว

    Amazing, clear, and understandable!

  • @besttwitcher4569
    @besttwitcher4569 ปีที่แล้ว

    YESSSS, right?! Glad you liked it Miguel!

  • @a.s.m.rashedchowdhury784
    @a.s.m.rashedchowdhury784 ปีที่แล้ว

    opened my eyes to parallel programming

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⬆️

  • @likky2229
    @likky2229 ปีที่แล้ว

    The video was very helpful for me. Many thanks to the author for developing his audience with interesting and useful content

  • @beratcansamur1517
    @beratcansamur1517 ปีที่แล้ว

    An insanely underrated series!!!

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⤴️

  • @rinatverdiyev5577
    @rinatverdiyev5577 ปีที่แล้ว

    really well done, very concise. thank you.

  • @emirhans7363
    @emirhans7363 ปีที่แล้ว

    Absolutely lovely visuals!!!

  • @entbmkda7809
    @entbmkda7809 ปีที่แล้ว

    Just what I needed! Thanks!

  • @bastansavma9640
    @bastansavma9640 ปีที่แล้ว

    Thank you so much sir, you are an amazing human being !

  • @pankajnayak2538
    @pankajnayak2538 ปีที่แล้ว

    Your videos are awesome , thanks a lot for this quality content :)

  • @wintergacha5370
    @wintergacha5370 ปีที่แล้ว

    Very nice tutorial. I really liked it. It's brief, to the point and very clear. Thanks. Could you please make a video for the same example but in Linux?

  • @notachannel2601
    @notachannel2601 ปีที่แล้ว

    It is effectively a very easy approach to harness the power of cuda in simple python scripts.

  • @emirliemirxan2687
    @emirliemirxan2687 ปีที่แล้ว

    Sir,make more detailed sessions on CUDA,your explanation is great

  • @_ali_muhtarif7653
    @_ali_muhtarif7653 ปีที่แล้ว

    Glad you liked it!

  • @emircoltu875
    @emircoltu875 ปีที่แล้ว

    Once you initialized lr to 0.0, I knew you were going to forget to change it lol. Love the challenges tho, keep doing them, I think it would be cool to see how you implement a neural network from scratch

  • @aliarda9719
    @aliarda9719 ปีที่แล้ว

    Thanks a million @Lakshman!! I try to keep it pretty tight so it’s a good challenge otherwise I know I’ll just talk for 22 minutes anyway😅

  • @cakmac8592
    @cakmac8592 ปีที่แล้ว

    Great tutorial man!

  • @keremkipri9436
    @keremkipri9436 ปีที่แล้ว

    Thanks for the video, subscribed! A suggestion : this small change to your code would demonstrate a real-world gradient descent solution for linear regression with noisy data. E.g. :

  • @aligok25
    @aligok25 ปีที่แล้ว

    Very clear, I loved it !

  • @deathstorm9911
    @deathstorm9911 ปีที่แล้ว

    Love your videos bro! Time to put down that redbull though lol just kidding happy holidays!

  • @dhh578
    @dhh578 ปีที่แล้ว

    Really nice video, thank you for sharing!

  • @baksanabi9817
    @baksanabi9817 ปีที่แล้ว

    such great work and thanks for your kind words! :)

  • @mipxello7749
    @mipxello7749 ปีที่แล้ว

    Very well explained. The best CUDA explaination I have come across uptil now 😊😊. Keep up the spirits sir.👍👍

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies...⤴️

  • @omidprokids319
    @omidprokids319 ปีที่แล้ว

    Extremely good quality! wow

  • @salihbeyy9864
    @salihbeyy9864 ปีที่แล้ว

    Really enjoyed this video!

  • @ramazandemir6848
    @ramazandemir6848 ปีที่แล้ว

    wold love to see a video on what are a few CUDA programming challenges

  • @ahmedihab55
    @ahmedihab55 ปีที่แล้ว

    Awesome tutorial, thanks.

  • @Eren-xf2bo
    @Eren-xf2bo ปีที่แล้ว

    Thanks a lot really got me started .

  • @teamchanel4384
    @teamchanel4384 ปีที่แล้ว

    I'm doing an internship in a research lab and I'll have to program some kernels to implement Blas primitives, this video really helps :)

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies..⤴️

  • @imperalzula7062
    @imperalzula7062 ปีที่แล้ว

    Great talk, thank you ! Well structured and clear.

    • @user-sh6jw1ce3m
      @user-sh6jw1ce3m ปีที่แล้ว

      Thanks for the comment... contact me for information and profitable investment strategies...⬆️

  • @baapu2452
    @baapu2452 ปีที่แล้ว

    thanks for the feedback!