vprokopev
vprokopev OP t1_j0zzfpg wrote
Reply to comment by Zealousideal_Low1287 in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Just seek to replace a python part with something that is slower (obviously) but not like way slower then Pytorch vectorized ops.
And to have freedom to use more native structures and a bit less thinking about how to vectorize every algorithm possible
vprokopev OP t1_j0zy68v wrote
Reply to comment by Zealousideal_Low1287 in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Mostly use vectorized pytorch operations.
Sometimes use just native loops and indexing.
Yes, unfortunately there are specific data preprocessing cases where I have to do stuff outside of pytorch, it's just more convenient.
And even when mostly using pytorch I still want the freedom to just use native functionality of a language without a huge hit to a performance.
But I know pytorch vectorized ops will still be faster and are suitable for majority of tasks
vprokopev OP t1_j0zu1ke wrote
Reply to comment by Zealousideal_Low1287 in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
But I do want to use pytorch, I like it very much.
I just usually have a lot of specific modifications to data and find myself avoiding native python and loops/indexing, because it makes things way slower.
It would still be slower if I implemented it in C++ then in pytorch, but at least not like way slower and would not create a bottleneck
vprokopev OP t1_j0ztfxi wrote
Reply to comment by Zealousideal_Low1287 in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Flexible = more freedom as I understand ot. GIL = less freedom. Maybe you have different definition.
I do understand it's needed for python to be what it is now and to become so popular.
vprokopev OP t1_j0zt2rb wrote
Reply to comment by Ricenaros in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Agree, what I am trying to say is C++ gives you more freedom here. In python it's just no way you can use native features in anything you want to run fast.
Vectorized operations are goated, I agree. But I don't want to be constrained to always use them. Especially when I have to write a lot of very specific modifications to data before I feed it to a NN.
vprokopev OP t1_j0zrven wrote
Reply to comment by Exarctus in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
I understand this. This is not answering my question.
Using python front end I must implement any algorithm I have in mind in terms of vectorized pytorch operations. I can't use loops and indexing and other python libraries, or my code will be slow and only executed with 1 core.
How that supposed to make my job easier?
vprokopev OP t1_j0zqzxm wrote
Reply to comment by suflaj in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Again, in C++ I am not so much constrained to only use Pytorch functions. I can use other libraries and native features.
In python I basically must express any algorithm I have in my head in terms of vectorized pytorch operations with broadcasting. Not the case in C++. Am I wrong here?
I am not taking about researchers, I am talking more about businesses. No problem with researchers using python.
vprokopev OP t1_j0zppi0 wrote
Reply to comment by fastglow in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Every time I need to manipulate tensors I have to describe my algorithm in terms of vectorized pytorch functions and broadcasting, instead of more straightforward loops and indexing.
How is that supposed to make my job easier?
vprokopev OP t1_j0zoeub wrote
Reply to comment by dumbmachines in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Nothing but the fact that everywhere I go to work they have most of ML code base in python so I have to use it.
vprokopev OP t1_j0zo91k wrote
Reply to comment by fastglow in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
- But you have to use vectorized operations instead of loops, pytorch functions for everything you want to be fast etc... This is different from just using a library. It's ONLY using the library
- There are better languages that are also flexible and popular. And python is not so flexible anyway (GIL).
vprokopev OP t1_j1j0xs5 wrote
Reply to comment by Dependent_Change_831 in [D] Why are we stuck with Python for something that require so much speed and parallelism (neural networks)? by vprokopev
Thank you for sharing experience!.
My intuition is that C++ python extensions make it easier to to easy things (then in C++) but make it harder to do hard things.
People always go for convenience first and then move to something more fundamental and flexible.
Data Science was mostly in R and MATLAB about 12-15 years ago. Then people moved to more general python. Next step is a compiled language with static types imo.