Commit e47b044
authored
Adding asynchronous fetching for DirectIO directory (#134803)
One significant cost of DirectIO is simply waiting for bytes to be read
in a path dedicate for compute.
This change adds "prefetch" capabilities to DirectIO by allowing to
prefetch particular file positions. For simplicity, I have it always
prefetch a DirectIO page. Initially I did a bunch of work to allow
prefetching multiple pages (e.g. more than 8192 bytes), but this greatly
complicated the implementation. I think this can be added as a follow
up.
Here are some benchmarks for vectors. Note, the recall difference
indicates I am doing something wrong right now. I am thinking I have a
couple off-by-one errors and I am still investigating.
Opening as a draft until I can figure out this weird bug (and of course,
remove all my extraneous changes used for testing this thing)...This is
labeled as 9.2, but I would be very surprise if it actually lands there.
This PR:
```
index_name index_type visit_percentage(%) latency(ms) net_cpu_time(ms) avg_cpu_count QPS recall visited filter_selectivity
------------------------------ ---------- ------------------- ----------- ---------------- ------------- ------ ------ -------- ------------------
cohere-wikipedia-docs-768d.vec ivf 1.00 5.57 0.00 0.00 179.53 0.92 87397.37 1.00
```
Baseline DirectIO:
```
index_name index_type visit_percentage(%) latency(ms) net_cpu_time(ms) avg_cpu_count QPS recall visited filter_selectivity
------------------------------ ---------- ------------------- ----------- ---------------- ------------- ------ ------ -------- ------------------
cohere-wikipedia-docs-768d.vec ivf 1.00 8.12 0.00 0.00 123.15 0.94 87397.37 1.00
```
Baseline MMAP (when many floating points can still just reside in
memory):
```
index_name index_type visit_percentage(%) latency(ms) net_cpu_time(ms) avg_cpu_count QPS recall visited filter_selectivity
------------------------------ ---------- ------------------- ----------- ---------------- ------------- ------ ------ -------- ------------------
cohere-wikipedia-docs-768d.vec ivf 1.00 3.58 0.00 0.00 279.33 0.94 87397.37 1.00
```1 parent 9dff96f commit e47b044
File tree
7 files changed
+977
-79
lines changed- qa/vector/src/main/java
- org/elasticsearch/test/knn
- server/src
- main/java/org/elasticsearch
- common/settings
- index/store
- test/java/org/elasticsearch/index/store
7 files changed
+977
-79
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
Lines changed: 2 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | | - | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
| |||
233 | 228 | | |
234 | 229 | | |
235 | 230 | | |
236 | | - | |
| 231 | + | |
237 | 232 | | |
238 | 233 | | |
239 | 234 | | |
| |||
375 | 370 | | |
376 | 371 | | |
377 | 372 | | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | 373 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
0 commit comments