moose icon indicating copy to clipboard operation
moose copied to clipboard

Improve practical perf of bit decompose?

Open mortendahl opened this issue 3 years ago • 2 comments

The current approach creates a single bit tensor on host placements by stacking together several bit tensors. But we often call index on the stacked tensor afterwards to separate them again. Would it be better to use bit arrays all the way instead which are not backed by a single bit tensor but rather by eg a vector of bit tensors?

mortendahl avatar Nov 17 '21 20:11 mortendahl

While I agree that it would be nice to avoid indexing all the time I think sometimes it's useful to have a single bit tensor to work with to vectorize some instructions.

For eg, we have bit-decomposition which benefits of this vectorization: https://github.com/tf-encrypted/runtime/blob/main/moose/src/replicated/mod.rs#L2746 and the binary adder: https://github.com/tf-encrypted/runtime/blob/main/moose/src/replicated/mod.rs#L2546

So not sure, perhaps having a way to stack tensors into a single tensor would be something useful while changing the output of bit-decomposition to a vector of tensors.

rdragos avatar Nov 18 '21 12:11 rdragos

@rdragos @voronaam @jvmncs maybe something to discuss next week

mortendahl avatar Mar 04 '22 11:03 mortendahl