Skip to content

Commit d3f1c2f

Browse files
committed
ok
1 parent ddc8aff commit d3f1c2f

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

examples/cpp/402_persistent_streaming.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ main(int32_t argc, char** argv) {
8282
std::cout << "index contains vectors: " << index->GetNumElements() << std::endl;
8383

8484
/******************* Save Index to OStream *****************/
85-
vsag::Options::Instance().set_new_version(true);
85+
vsag::Options::Instance().set_new_version(false);
8686
std::ofstream out_stream("/tmp/vsag-persistent-streaming.index");
8787
auto serialize_result = index->Serialize(out_stream);
8888
out_stream.close();
@@ -127,19 +127,12 @@ main(int32_t argc, char** argv) {
127127
}
128128
129129
)";
130-
std::cout << "before search" << std::endl;
131-
std::cout << "before search" << std::endl;
132-
std::cout << "before search" << std::endl;
133-
std::cout << "before search" << std::endl;
134130
if (auto knn_search = index->KnnSearch(query, topk, search_parameters);
135131
not knn_search.has_value()) {
136-
std::cout << "aaaa" << std::endl;
137132
std::cerr << "search knn failed: " << knn_search.error().message << std::endl;
138133
abort();
139134
} else {
140-
std::cout << "bbbb" << std::endl;
141135
auto result = *knn_search;
142-
std::cout << "result.getdim: " << result->GetDim() << std::endl;
143136
for (int64_t i = 0; i < result->GetDim(); ++i) {
144137
std::cout << result->GetIds()[i] << " " << result->GetDistances()[i] << std::endl;
145138
}

extern/diskann/DiskANN/src/pq_flash_index.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,16 +1433,16 @@ int PQFlashIndex<T, LabelT>::load_from_separate_paths(std::stringstream &pivots_
14331433
<< ". Will not output it at search time." << std::endl;
14341434
}
14351435

1436-
// diskann::cout << "Disk-Index File Meta-data: ";
1437-
// diskann::cout << "# nodes per sector: " << nnodes_per_sector;
1438-
// diskann::cout << ", max node len (bytes): " << max_node_len;
1439-
// diskann::cout << ", max node degree: " << max_degree << std::endl;
1436+
diskann::cout << "Disk-Index File Meta-data: ";
1437+
diskann::cout << "# nodes per sector: " << nnodes_per_sector;
1438+
diskann::cout << ", max node len (bytes): " << max_node_len;
1439+
diskann::cout << ", max node degree: " << max_degree << std::endl;
14401440
num_medoids = 1;
14411441
medoids = new uint32_t[1];
14421442
medoids[0] = (uint32_t)(medoid_id_on_file);
14431443

14441444
use_medoids_data_as_centroids();
1445-
// diskann::cout << "done.." << std::endl;
1445+
diskann::cout << "done.." << std::endl;
14461446
return 0;
14471447
}
14481448

@@ -1859,7 +1859,12 @@ int64_t PQFlashIndex<T, LabelT>::cached_beam_search_memory(const T *query, const
18591859

18601860
// re-sort by distance
18611861
std::sort(full_retset.begin(), full_retset.end());
1862-
if (reorder) {
1862+
if (not reorder) {
1863+
1864+
std::cout << "yes yes yes reorder" << std::endl;
1865+
std::cout << "yes yes yes reorder" << std::endl;
1866+
std::cout << "yes yes yes reorder" << std::endl;
1867+
18631868
std::vector<Neighbor> reorder_retset;
18641869
std::priority_queue<float> distance_ranks;
18651870
int loc = 0;

src/index/diskann.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class LocalMemoryReader : public Reader {
121121

122122
class IStreamReader : public Reader {
123123
public:
124-
IStreamReader(std::istream& in_stream, int64_t base_offset = 0, int64_t size = 0)
124+
IStreamReader(std::istream& in_stream, int64_t base_offset, int64_t size)
125125
: in_stream_(in_stream),
126126
base_offset_(base_offset),
127127
size_(size) {
@@ -1053,7 +1053,6 @@ DiskANN::deserialize(std::istream& in_stream) {
10531053
READ_DATACELL_WITH_NAME(in_stream, DISKANN_COMPRESSED_VECTOR, disk_pq_compressed_vectors);
10541054
READ_DATACELL_WITH_NAME(in_stream, DISKANN_TAG_FILE, tag_stream);
10551055

1056-
// TODO(wxyu): wrap with `in_stream`
10571056
disk_layout_reader_ = std::make_shared<IStreamReader>(in_stream,
10581057
datacell_offsets[DISKANN_LAYOUT_FILE].get<uint64_t>(),
10591058
datacell_sizes[DISKANN_LAYOUT_FILE].get<uint64_t>());
@@ -1073,6 +1072,7 @@ DiskANN::deserialize(std::istream& in_stream) {
10731072
READ_DATACELL_WITH_NAME(in_stream, DISKANN_GRAPH, graph);
10741073
index_->load_graph(graph);
10751074
}
1075+
status_ = IndexStatus::HYBRID;
10761076

10771077
} catch (const std::runtime_error& e) {
10781078
LOG_ERROR_AND_RETURNS(ErrorType::READ_ERROR, "failed to deserialize: ", e.what());

0 commit comments

Comments
 (0)