Live data from Hacker News

KlongPy: High-Performance Array Programming in Python

github.com

1–10 of 90 posts

Re: KlongPy: High-Performance Array Programming in Python

#5
Naive array programming is not really high performance in my book, because performing a lot of trivial arithmetic on large arrays leads to poor locality and high bandwidth pressure. The better alternative is SPMD, i.e. something like CUDA or ISPC for CPUs. This is possible with some type of JIT if the numpy style of programming is to be maintained, for example tinygrad.

Re: KlongPy: High-Performance Array Programming in Python

#6

Naive array programming is not really high performance in my book, because performing a lot of trivial arithmetic on large arrays leads to poor locality and high bandwidth pressure. The better alternative is SPMD, i.e. something like CUDA or ISPC for CPUs. This is possible with some type of JIT if the numpy style of programming is to be maintained, for example tinygrad.

If you like high-performance array programming a la "numpy with JIT" I suggest looking at JAX. It's very suitable for general numeric computing (not just ML) and a very mature ecosystem.

https://github.com/jax-ml/jax

Re: KlongPy: High-Performance Array Programming in Python

#7

I gather where it says `:monad` it is referring to an operation that had an effect on the interpreter state?

No. In APL deriverd array programming languages, verbs (or functions) are monadic or dyadic : they accept only one or two arguments :

In '1 + 1', + is a dyadic operator, while in 'exp 5', exp is monadic.

In J, and in APL I guess, left arg is usually understood as 'control data', while right arg is the data upon which calculation is done. Left argument is usually left unchanged after calculations.

In this way, is it possible to create multi-arguments verbs, by placing boxed args on the left of the verb.

Re: KlongPy: High-Performance Array Programming in Python

#8

Naive array programming is not really high performance in my book, because performing a lot of trivial arithmetic on large arrays leads to poor locality and high bandwidth pressure. The better alternative is SPMD, i.e. something like CUDA or ISPC for CPUs. This is possible with some type of JIT if the numpy style of programming is to be maintained, for example tinygrad.

[deleted]

Re: KlongPy: High-Performance Array Programming in Python

#9
This is awesome. I’ve wanted to play with array languages before but they tend to be kind of a pain in the neck to start with locally. I like the idea of hacking my way around in the new language while keeping a Python escape hatch close by in case I haven’t yet learned how to do a thing the new way.

Nice.

Re: KlongPy: High-Performance Array Programming in Python

#10

Naive array programming is not really high performance in my book, because performing a lot of trivial arithmetic on large arrays leads to poor locality and high bandwidth pressure. The better alternative is SPMD, i.e. something like CUDA or ISPC for CPUs. This is possible with some type of JIT if the numpy style of programming is to be maintained, for example tinygrad.

You are absolutely right, naive array programming might be much faster than raw python but it will never be high performance because you can't use caches and memory bandwidth effectively.
Post reply on HN