The problem/use-case that the feature addresses

This feature will allow machine learning users to utilize Redis to manage parameters

Description of the feature

A new supported data structure for fp32 with fixed size, for example, each key maps to a size 32 array of fp32 https://en.wikipedia.org/wiki/Single-precision_floating-point_format

Alternatives you've considered

N/A

Additional information

This is to allow Redis to serve ML use cases.

Comment From: oranagra

A random idea: maybe extending BITFIELD to support them could serve you better?

Comment From: tanzhenyu

A random idea: maybe extending BITFIELD to support them could serve you better?

Thanks for the suggestion! Looks like it's treating string as bits. We could treat fp32 as 4 chars as well to make that happen. Though I wonder if there are additional optimization that can be done given the "string" size is fixed

Comment From: oranagra

It'll basically be a good idea if you wanna save many values under one key. Not sure if it fits your use case..

Comment From: tanzhenyu

It'll basically be a good idea if you wanna save many values under one key. Not sure if it fits your use case..

Yes, by "treat fp32 as 4 chars" I mean we can store for example 64 floats under one key. My question is more on memory side, i.e., how to optimize memory allocation and query efficiency given every key stores 64 floats

Comment From: oranagra

yes, storing 64 (indexed) floats in one key, would be more efficient than storing 64 keys with one float each. we'll save memory on key name and dictionary entries, etc.

but it depends if it makes sense for your use case or not. fetching or storing a single float from such an array would have similar overheads on query execution as fetching it from a key that has just one. fetching or storing several together, could be slightly faster