Commit 0dd7bde
authored
Fix cagra_hnsw serialization when dataset is not part of index (#591)
After calling `build()`, ideally the CAGRA index contains both the dataset and the graph. But when we do not have sufficient device memory, then only the graph is returned. In such case we need to pass the dataset explicitly to the serialization routines.
For serialization in HNSW format, in case we have flat hierarchy, the dataset was not passed. This PR fixes this problem by adding an optional `dataset` argument to `cagra::serialize_to_hnswlib`.
Furthermore, to improve execution time, we change from writing a single element to writing a single row of the graph and dataset at time.
Additionally, debug messages for tracking data saving time are added.
Authors:
- Tamas Bela Feher (https://github.com/tfeher)
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Divye Gala (https://github.com/divyegala)
URL: #5911 parent 836183e commit 0dd7bde
File tree
5 files changed
+191
-102
lines changed- cpp
- bench/ann/src/cuvs
- include/cuvs/neighbors
- src/neighbors
- detail
- cagra
5 files changed
+191
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
| 96 | + | |
94 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1599 | 1599 | | |
1600 | 1600 | | |
1601 | 1601 | | |
| 1602 | + | |
| 1603 | + | |
1602 | 1604 | | |
1603 | 1605 | | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1607 | 1612 | | |
1608 | 1613 | | |
1609 | 1614 | | |
| |||
1628 | 1633 | | |
1629 | 1634 | | |
1630 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
1631 | 1638 | | |
1632 | 1639 | | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
1636 | 1646 | | |
1637 | 1647 | | |
1638 | 1648 | | |
| |||
1656 | 1666 | | |
1657 | 1667 | | |
1658 | 1668 | | |
| 1669 | + | |
| 1670 | + | |
1659 | 1671 | | |
1660 | 1672 | | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1664 | 1679 | | |
1665 | 1680 | | |
1666 | 1681 | | |
| |||
1685 | 1700 | | |
1686 | 1701 | | |
1687 | 1702 | | |
| 1703 | + | |
| 1704 | + | |
1688 | 1705 | | |
1689 | 1706 | | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
1693 | 1713 | | |
1694 | 1714 | | |
1695 | 1715 | | |
| |||
1713 | 1733 | | |
1714 | 1734 | | |
1715 | 1735 | | |
| 1736 | + | |
| 1737 | + | |
1716 | 1738 | | |
1717 | 1739 | | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
1721 | 1746 | | |
1722 | 1747 | | |
1723 | 1748 | | |
| |||
1742 | 1767 | | |
1743 | 1768 | | |
1744 | 1769 | | |
| 1770 | + | |
| 1771 | + | |
1745 | 1772 | | |
1746 | 1773 | | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
1750 | 1780 | | |
1751 | 1781 | | |
1752 | 1782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
0 commit comments