Posit Python Library

105 views
Skip to first unread message

Morteza Yousefloo

unread,
Jun 4, 2023, 10:07:36 AM6/4/23
to Unum Computing
Hello
Please introduce a Python library that includes various Posit formats to perform all kinds of mathematical operations, it is also necessary to convert posits to Float and vice versa.
Best regards,
Morteza Yousefloo

John Gustafson

unread,
Jun 4, 2023, 1:31:52 PM6/4/23
to Morteza Yousefloo, Unum Computing
Morteza,

Python was one of the first languages to get posit support, and from multiple independent efforts.

Theo Omtzigt's Universal (Stillwater Supercomputing Inc.) has C, C++, and Python wrappers and an amazing range of precisions and eS exponent sizes, and of course all the conversions between IEEE floats and posits. Open source (MIT license). That not only supports the quire, it also provides a robust linear algebra library that makes use of the ability of posits to provide bitwise reproducible answers and handle ill-conditioned matrices well.

SoftPosit also has a Python wrapper, and while not as general as Universal, it is probably the fastest implementation out there (about 100 MPOPS per x86 core for 8, 16, and 32-bit precision). (I believe Theo has done quite a bit to make certain precisions in Universal as fast as SoftPosit.) Also all open-source.

The SpeedGo library was one of the first to support Python with posits, written by Shin Yee Chung. Open source (MIT license). But it does not support the quire.

There's also sfpy by Bill Zorn, PySigmoid by Ken Mercado…

Oh, and maybe this is the place to start, since it's done by one of the best implementers of posit arithmetic on the planet, Raul Murillo: Deep PeNSeive is a Python posit library supporting precisions 8, 16, and 32 and full quire support. I think it's aimed at supporting Machine Learning.

Those are just the ones I know about… there are probably others!

Best,
John

--
You received this message because you are subscribed to the Google Groups "Unum Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unum-computin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/unum-computing/78494e03-6937-49ef-9723-7d9ce8121b10n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages