0

I am trying to use the class multiprocessing.Array to share an array of 16-bit floats between processes. It looks however that this class only allows to use a 32-bit float or a 64-bit float (i.e. double). Do you know any ways of dealing with that?

Deeplearningmaniac
  • 285
  • 1
  • 2
  • 13
  • Having spent remarkable time on reduced binary-depth `dtypes` for large scale ML, both in monolythic and distributed ecosystems, the representation per se is not cardinal, problems come with a non-atomic operations and with imported methods, that still borrow from original FORTRAN libraries, like efficient numerical solvers are ( re-conversions and `[SPACE]`-domain collisions may appear and straight block and devastate all otherwise smart-designed shallow bit-depth python/numpy tools ). So, let me wish you all Good Luck on coping with this. – user3666197 Mar 01 '18 at 12:14

1 Answers1

-1

Numpy has 16bit-floats:

In [64]: import numpy

In [65]: a = numpy.float16(0.112312)

In [66]: a
Out[66]: 0.1123

Maybe you can convert between numpy.float16 and RawArray

https://docs.python.org/3.6/library/multiprocessing.html#multiprocessing.sharedctypes.RawArray

Shared-memory objects in multiprocessing

user3666197
  • 1
  • 6
  • 50
  • 92
scriptboy
  • 777
  • 8
  • 25