Pandas Dataframes on your GPU w/ CuDF

Поделиться
HTML-код
  • Опубликовано: 16 янв 2025

Комментарии • 73

  • @HarrisBallis
    @HarrisBallis Год назад +65

    Enabling cuDF using a single flag is insane! However, I just wannted to point out (especially for new pandas users) that the proper way to calculate average price per city in pandas is by using groupby. Running `df.groupby('Town/City')['price'].mean()` in plain pandas is blazing fast (a few ms), nothing compared to 19 minutes. That doesn't mean that cuDF is not useful, but don't forget that using plain pandas properly can get you a long way.

  • @bantaibaman5662
    @bantaibaman5662 Год назад +27

    Hey Sentdex, can you take this video down so my manager doesn't find out that I sped up the entire codebase by 200 fold with just one line and I end up getting appreciation bonuses??
    Jokes aside, this is absolutely wild. What a gamechanger. Thanks a lot as always, Kevin!

  • @harshvaragiya8834
    @harshvaragiya8834 Год назад +24

    Awesome video! I encountered a similar issue where I had to process ~8 GB of data using an AWS Lambda (limited RAM and time). I used polars (pandas alternative written in rust from scratch for performance) and I found it to be blazing fast . It's really really useful - especially with non nvidia devices like my raspberry pi and the AWS lambda function. You should definitely check it out!

    • @incremental_failure
      @incremental_failure Год назад +1

      I've nearly forgotten pandas after going with polars. Pandas was great for its time.

    • @xylem87
      @xylem87 Год назад

      there is also dask which also allows deployment on clusters with several workers similar to spark

    • @AyahuascaDataScientist
      @AyahuascaDataScientist Год назад

      @@incremental_failurepolars doesn’t even offer a .info() method. Simply inferior()

    • @incremental_failure
      @incremental_failure Год назад

      @@AyahuascaDataScientist df.describe()

  • @perryholman5302
    @perryholman5302 Год назад +10

    Wonderful! Thank you. It would be an interesting comparison with polars library as well.

  • @kenchang3456
    @kenchang3456 Год назад +2

    Once again thank you for sharing :-) You are appreciated.

  • @extrememike
    @extrememike Год назад

    Great find!🎉

  • @megalomaniacal
    @megalomaniacal Год назад

    Thanks bro, will give it a test run.

  • @jameslucas5590
    @jameslucas5590 Год назад

    Outstanding. Thank you for this informatoin.

  • @usamatahir7091
    @usamatahir7091 Год назад

    Thanks a lot for sharing. super useful

  • @acelaox6836
    @acelaox6836 Год назад

    the kubota warrior is back with the heat 🗣🗣🗣

  • @Brickkzz
    @Brickkzz Год назад +5

    Missing your tutorials man, trying to install this on windows...

  • @VermontStrolls
    @VermontStrolls Год назад

    Thanks a ton!

  • @damianshaw8456
    @damianshaw8456 Год назад +6

    For the read_csv operation I would be curious what is actually taking the most amount of time with the Pandas object, I suspect it's building the Python string objects, and if so I wonder if you have PyArrow installed and set pd.options.future.infer_string = True it would be much faster?
    And in general it makes sense that using strings are slow in Pandas, because it's falling back to looking up a Python object by via reference to it, it's actually a much more interesting comparison for number or datetime data types. For strings it would be much more interesting if you had use the PyArrow string data type.

  • @noormohammedshikalgar
    @noormohammedshikalgar Год назад +1

    Hello Sentdex, I am reaching out to you regarding your Neural network from scratch series ?
    any updates on that, you left on pt 9
    Please do continue its an awesome series
    and any updated on Book discounts for use for the Black friday ??
    please do help

  • @HeigthTrielli
    @HeigthTrielli 7 месяцев назад +1

    Hi! Can you share what hardware were you operating on?

  • @oguzhanyldrm962
    @oguzhanyldrm962 Год назад +1

    Please post more often videos Harrison

  • @__python__
    @__python__ Год назад +3

    Thanks for sharing... I would be curious about a comparison between accelerated version of pandas and polars.

  • @kascesar
    @kascesar Год назад

    Impresive!

  • @Mil-Keeway
    @Mil-Keeway 11 месяцев назад

    3:38 it doesn't have the prices "in quotes like a string", it's a properly exported csv that has ALL fields quoted. Your pd.read_csv is missing quoting=csv.QUOTE_ALL (or just quoting=1) and optionally quotechar='\"' . The only "magic" pandas is doing is interpreting that column as quoted. If you add those options, I'm guessing cudf will run just as well, since the ingest portion will still be using python standard lib or at least pandas C implementations.

  • @thetdg
    @thetdg Год назад +1

    Great video. Just one thing: instead of comparing cuDF with vanilla Pandas, wouldn’t a comparison with Modin be a more appropriate one?

    • @droit19
      @droit19 Год назад

      I'd like to see this as well, scale Modin on a Ray Cluster/Single Node using a GPU

  • @AlignmentLabAI
    @AlignmentLabAI Год назад

    jesus christ my life has totally changed

  • @shaftymaze
    @shaftymaze Год назад +1

    Polars in rust wrapped in tqdm.

  • @delt19
    @delt19 Год назад +1

    10 sec compared to 19 min?!?! Holy f....!!!!!

  • @Stinosko
    @Stinosko Год назад

    Cool!

  • @maurice9327
    @maurice9327 Год назад +2

    What if my RAM (128GB) is larger than my VRAM (32GB)? Is normal pandas still faster for data that's larger than the VRAM?

  • @ahmed-yassinechraa8731
    @ahmed-yassinechraa8731 Год назад +1

    Can you make a tutorial on howa to install cuDF, i saw that there is a lot of things to install before it

  • @sternsemasuka9716
    @sternsemasuka9716 Год назад +2

    How about Polar?

  • @vigneshpadmanabhan
    @vigneshpadmanabhan Год назад +1

    CuDF vs Polars may be.

  • @shashisaini7919
    @shashisaini7919 Год назад

    @sentdex sir please make videos on 3d deep learning, its really exciting to see your work on point cloud

  • @Summersault666
    @Summersault666 Год назад +1

    Will it work on apple notebook?

  • @EtienneTremblay
    @EtienneTremblay Год назад +2

    What happens if your dataset doesn't fit in GPU memory?

    • @jurajjakubik2185
      @jurajjakubik2185 Год назад +2

      I have tested that and it is slower than on CPU. Pretty much you use all GPU memory and rest going to RAM. Then it is back and forward.

  • @d_b_
    @d_b_ Год назад

    This looks like it would beat out something like Dask for non-distributed large datasets. Is that the case?

  • @MuhammadNurdinnewspecies
    @MuhammadNurdinnewspecies Год назад +1

    Next brow... how to manage your gpu memory. Loading your dataset and training your model

  • @EarlZMoade
    @EarlZMoade Год назад +1

    What's the reasoning for not using groupby in this demo? Wouldn't that be the more natural and faster pandas method to use - instead of looping over everything.
    Feels a little disingenuous to compare poorly optimised pandas code that no one would actually write.

  • @gingerjiang666
    @gingerjiang666 Год назад

    Does it still use memorry to fit the entire dataset?

  • @r.k.vignesh7832
    @r.k.vignesh7832 Год назад

    9:01 I'm running late for work, but wouldn't it be possible to vectorize this code and it be faster than both the CuDF and the CPU versions of this benchmark? Curious to see how CuDF plays with vectorized versions. If I get the time I'll try some experiments and update this comment.

    • @r.k.vignesh7832
      @r.k.vignesh7832 Год назад +1

      On a trial dataset with 10000 rows of fake data (~500kB in size), using GroupBy to find the mean of the "unique prices" was 72x faster than the one implemented in this one at 6:45 or so. I expect that it will become exponentially faster with a dataset 5GB in size. I used groupby in another part and that naively halved the time, but it's still far from optimized and I'll probably upload my findings here with a ~5GB dataset running on Colab sometime in the next couple of weeks. After that, I'll try the CuDF version.

    • @EarlZMoade
      @EarlZMoade Год назад

      Very interested to see this comparison. No one writes pandas code like this video where looping is both unnatural and terribly optimised.

    • @r.k.vignesh7832
      @r.k.vignesh7832 Год назад +1

      @@EarlZMoade thanks for your comment! I made a dataset with random data of 1.5GB for benchmarks, and for 2 operations (the first groupby at 6:45 and the upper-lower price bands) it took Sentdex's code 4 mins and 2 seconds, and 19 mins and 43 secs respectively on my computer. An optimized version (just Groupby and vectorization, nothing fancy) took 2.25 SECONDS and 13.5 seconds respectively. I'm sure CuDF would be even faster but in this case there was a lot of performance left on the table.

  • @BohonChina
    @BohonChina Год назад

    how about Mojo? Mojo can actually use GPU to accelerate calculation too, currently Mojo support numpy,pandas in cpu. It will be fun to make a comparison with CuDF. Mojo is more like a superset for python.

  • @BDog_1
    @BDog_1 11 месяцев назад

    how would you start to make an AI that deals with data using python. I'm trying to learn more about this

  • @bikkikumarsha
    @bikkikumarsha Год назад

    please make a video on custom GPTs, actions and open ai dev event

  • @theMintyRaven
    @theMintyRaven 4 месяца назад

    Can you please make a video for using cudf in python scripts? it's much trickier in the scripts

  • @youknowmyname12345
    @youknowmyname12345 Год назад

    Does this new accelerator speed up groupby() operations?

  • @JuanRamirez-di9bl
    @JuanRamirez-di9bl Год назад

    Is this faster than numpy??

  • @sillybuttons925
    @sillybuttons925 Год назад

    **does scipy work with it?

  • @kelkka7
    @kelkka7 Год назад

    Will this work with geopandas?

  • @mikahoy
    @mikahoy 8 месяцев назад

    Hi, how to do it for geopandas? is it same?

  • @ivchatov
    @ivchatov Год назад

    Is this compatible with Python 3.7 at all? Last time I tried installing CuDF I remember version incompatibility stopping me.

  • @AyahuascaDataScientist
    @AyahuascaDataScientist Год назад

    Does cudf.pandas work with apple silicon MPS GPU framework instead of just cuda?

  • @SwissPGO
    @SwissPGO Год назад

    Any alternative for Apple Silicon ?

    • @mlcat
      @mlcat Год назад +1

      Dask maybe

    • @Adaministrator
      @Adaministrator Год назад

      Dask and swifter have like 1000x processing speed for some batch jobs I have with airflow, so def try that. It’s also drop in

  • @theMintyRaven
    @theMintyRaven 5 месяцев назад

    hi thank you for showing this great way to use gpu, it seems really easy but I ran into an error that I couldn't find the solution anywhere:
    UserWarning: cudf.pandas detected an already configured memory resource, ignoring 'CUDF_PANDAS_RMM_MODE'=managed_pool
    can anyone help me?

  • @poloceccati
    @poloceccati Год назад

    what about amd gpu ?

  • @catslover4745
    @catslover4745 Год назад

    Hey does anyone know how to get this working on normal visual studio code python file instead of opening it in jupyter? Thanks

  • @ai.simplified..
    @ai.simplified.. Год назад

    3:20

  • @Andrea-du3or
    @Andrea-du3or 8 месяцев назад

    Has anyone been able to install the library with pip as he shown ? I keep getting errors like - Preparing metadata (pyproject.toml): finished with status 'error' :')

  • @citizenR1203
    @citizenR1203 Год назад

    Very interesting, thank you for sharing 😊but this seems to be not compatible with MacOS and 2,9 GHz Quad-Core Intel Core i7 processor.

    • @henryyoo3032
      @henryyoo3032 Год назад +3

      which would make perfect sense since you would need a cuda enabled nvidia gpu for cudf to work

  • @andreaqui1653
    @andreaqui1653 6 месяцев назад

    Anyone have any luck getting it installed on a local windows machine?

    • @Harmxn
      @Harmxn 4 месяца назад

      You cannot install it on Windows because CuDF is only supported on Linux. Instead, you can make a WSL instance and install Python and CuDF on there.

  • @jamoncitovideos
    @jamoncitovideos Год назад

    Ditch pandas and use spark, your local data engineer will thank you

  • @spicy.d
    @spicy.d Год назад +2

    I'm waiting on AMD to enter the DS space so I can use my 7900XTX to do things LOL

  • @Arctect
    @Arctect Год назад

    like ** 10 == 0.0s

  • @ashu-
    @ashu- Год назад

    Ngl, your video looks like Deepfaked, I also think at this point you can probably deepfake yourself with a bit editing to make an people believe its real.