Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions content/develop/data-types/vector-sets/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ High-dimensional vectors increase storage:
- 300 components at `FP32` = 1200 bytes/vector
- 300 components at `Q8` = 300 bytes/vector

You can reduce this using the `REDUCE` option during [`VADD`]({{< relref "/commands/vadd" >}}), which applies random projection.

```bash
VADD vset REDUCE 100 VALUES 300 ... item1
```
You can reduce this using the `REDUCE` option during [`VADD`]({{< relref "/commands/vadd" >}}), which applies [random projection](https://en.wikipedia.org/wiki/Random_projection):

{{< clients-example vecset_tutorial add_reduce >}}
>VADD setNotReduced VALUES 300 ... element
(integer) 1
> VDIM setNotReduced
(integer) 300

>VADD setReduced REDUCE 100 VALUES 300 ... element
(integer) 1
> VDIM setReduced
(integer) 100
{{< /clients-example >}}

This projects a 300-dimensional vector into 100 dimensions, reducing size and improving speed at the cost of some recall.

Expand Down
23 changes: 23 additions & 0 deletions content/develop/data-types/vector-sets/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ Quantization greatly impacts both speed and memory:
- `NOQUANT` (`FP32`): Full precision, slower performance, highest memory use

Use the quantization mode that best fits your tradeoff between precision and efficiency.
The examples below show how the different modes affect a simple vector.
Note that even with `NOQUANT` mode, the values change slightly,
due to floating point rounding.

{{< clients-example vecset_tutorial add_quant >}}
> VADD quantSetQ8 VALUES 2 1.262185 1.958231 quantElement Q8
(integer) 1
> VEMB quantSetQ8 quantElement
1) "1.2643694877624512"
2) "1.958230972290039"

> VADD quantSetNoQ VALUES 2 1.262185 1.958231 quantElement NOQUANT
(integer) 1
> VEMB quantSetNoQ quantElement
1) "1.262184977531433"
2) "1.958230972290039"

> VADD quantSetBin VALUES 2 1.262185 1.958231 quantElement BIN
(integer) 1
> VEMB quantSetBin quantElement
1) "1"
2) "1"
{{< /clients-example >}}

## Deletion performance

Expand Down