Re: [HBRobotics] numpy drop-in

14 views
Skip to first unread message

Thomas Messerschmidt

unread,
Aug 27, 2025, 2:37:29 PM8/27/25
to hbrob...@googlegroups.com, HomeBrew Robotics Club
Interesting! Please fill us in when you know more.


Thomas



On Aug 27, 2025, at 11:01 AM, A J <aj48...@gmail.com> wrote:


Hey All,

There is a Python library called CuPyNumeric that is supposed to be a drop-in replacement
for NumPy. This could be good for Physics and Robot Simulators or possibly real-time processing of sensor data.


--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/26127a6f-7ab9-4f04-bdab-19b48b793746n%40googlegroups.com.

Marco Walther

unread,
Aug 27, 2025, 3:44:39 PM8/27/25
to hbrob...@googlegroups.com, Thomas Messerschmidt
On 8/27/25 11:37, Thomas Messerschmidt wrote:
> Interesting! Please fill us in when you know more.
>
From https://github.com/nv-legate/cupynumeric

"cuPyNumeric works best for programs that have very large arrays of data
that cannot fit in the memory of a single GPU or a single node and need
to span multiple nodes and GPUs. While our implementation of the current
NumPy API is still incomplete, programs that use unimplemented features
will still work (assuming enough memory) by falling back to the
canonical NumPy implementation."

Their example graph shows scaling over 2048 A100 GPUs;-)

So, while interesting, it's probably not really something for the
hobbyist any time soon;-)

-- Marco

>
> Thomas
>
>
>
> On Aug 27, 2025, at 11:01 AM, A J <aj48...@gmail.com> wrote:
>
> 
> Hey All,
>
> There is a Python library called CuPyNumeric that is supposed to be a
> drop-in replacement
> for NumPy. This could be good for Physics and Robot Simulators or
> possibly real-time processing of sensor data.
>
> https://developer.nvidia.com/cupynumeric
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/26127a6f-7ab9-4f04-bdab-19b48b793746n%40googlegroups.com
> <https://groups.google.com/d/msgid/hbrobotics/26127a6f-7ab9-4f04-
> bdab-19b48b793746n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> hbrobotics/DE442632-53B1-4E5E-8B74-20D3B6B996A9%40gmail.com <https://
> groups.google.com/d/msgid/hbrobotics/
> DE442632-53B1-4E5E-8B74-20D3B6B996A9%40gmail.com?
> utm_medium=email&utm_source=footer>.

Chris Albertson

unread,
Aug 27, 2025, 5:00:47 PM8/27/25
to hbrob...@googlegroups.com
Do you mean “CuPy”?   That one is more reasonable for most users.   But there are two:  CuPy and CuPyNumeric.    The later, I think is for larger projects.      But even the “stock” Numpy is very fast.    I can get 2,000 full kinematic solutions for a four-leg “dog” per second on one core of a Pi4 just using normal Numpy on 4x4 transorms.   That is a lot of linear algebra.    Numby can use CPU SIMD instructions on ARM and Intel.   And I think(?) the stock numpy will use Apple’s GPU.   Apple’s unified mamory makes it very fast for medium sized jobs.

Ecen the mini-numpy that comes with micro-pythons was very fast onthre ESP32, fast enough to allow controlled acceleration on 16 RC servoes.   The ESP is a RISC-V and RISC-V has pipelines floating point and a dual care.  

If you need speed.  Get rid of every for-loop you can and store your data as vectors, then use NumPy to do vector operations, and it is quite good at using hardware parallelization.    20x to 100x faster than "for i in 1..n”

 

On Aug 27, 2025, at 11:01 AM, A J <aj48...@gmail.com> wrote:

Hey All,

There is a Python library called CuPyNumeric that is supposed to be a drop-in replacement
for NumPy. This could be good for Physics and Robot Simulators or possibly real-time processing of sensor data.



--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hbrobotics/26127a6f-7ab9-4f04-bdab-19b48b793746n%40googlegroups.com.

Steve " 'dillo" Okay

unread,
Sep 2, 2025, 4:28:35 AM9/2/25
to HomeBrew Robotics Club
On Wednesday, August 27, 2025 at 2:00:47 PM UTC-7 Chris Albertson wrote:
Do you mean “CuPy”?   That one is more reasonable for most users.   But there are two:  CuPy and CuPyNumeric.    The later, I think is for larger projects.      But even the “stock” Numpy is very fast.    I can get 2,000 full kinematic solutions for a four-leg “dog” per second on one core of a Pi4 just using normal Numpy on 4x4 transorms.   That is a lot of linear algebra.    Numby can use CPU SIMD instructions on ARM and Intel.   And I think(?) the stock numpy will use Apple’s GPU.   Apple’s unified mamory makes it very fast for medium sized jobs.

Ecen the mini-numpy that comes with micro-pythons was very fast onthre ESP32, fast enough to allow controlled acceleration on 16 RC servoes.   The ESP is a RISC-V and RISC-V has pipelines floating point and a dual care.  

If you need speed.  Get rid of every for-loop you can and store your data as vectors, then use NumPy to do vector operations, and it is quite good at using hardware parallelization.    20x to 100x 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I'm going to underline this, boldface it and wrap blink-tags around it. This is not only the way to do NumPy, it's actually the way Python is "supposed be written" because it takes advantage of how Python internally operates. It's taken me a while to remember to do it and requires a bit of wrapping your head around it to think this way, but when you do, it's amazingly fast. 
For those who aren't aware, NumPy is really a Python front-end to a mass of (typically) custom-compiled C++ vector-math functions. 
I've had to build it from source for a couple client projects over the years and it's a bit of a beast, but when properly tuned, you get to see why it's such a darling of ML folks. 

'dillo




 
Reply all
Reply to author
Forward
0 new messages