Porting Python programs to Mojo improves performance by 250 times and is faster than C

Aydyn Tairov is an open source author and a former Meta engineer. He previously ported a hot pure C language llama2.cproject on GitHub to Python—— llama2.py.

The Mojo programming language was officially made available for download last week and is claimed to be 68,000 times faster than Python.

So Aydyn Tairov started llama2.pytransplanting it to Mojo without stopping llama2.mojo, and the result was very unexpected.

He said that the Mojo SIMD primitives helped improve Python's poor performance by nearly 250 times. In addition, because he uses matmul's vectorization assistant, it has been tested llama2.pyto be 20% faster than the C version.

Details

https://github.com/tairov/llama2.mojo
https://twitter.com/tairov/status/1701194900228764023

Guess you like

Origin www.oschina.net/news/257797/llama2-mojo-faster-than-c