Skip to content

Commit

Permalink
Update pq.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gopalrs authored Oct 27, 2023
1 parent 91600f4 commit e9ecab0
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions include/pq.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,6 @@ class FixedChunkPQTable
void populate_chunk_inner_products(const float *query_vec, float *dist_vec);
};

// REFACTOR
// template <typename T> struct PQScratch
//{
// float *aligned_pqtable_dist_scratch = nullptr; // MUST BE AT LEAST [256 * NCHUNKS]
// float *aligned_dist_scratch = nullptr; // MUST BE AT LEAST diskann MAX_DEGREE
// uint8_t *aligned_pq_coord_scratch = nullptr; // MUST BE AT LEAST [N_CHUNKS * MAX_DEGREE]
// float *rotated_query = nullptr;
// float *aligned_query_float = nullptr;
//
// PQScratch(size_t graph_degree, size_t aligned_dim)
// {
// diskann::alloc_aligned((void **)&aligned_pq_coord_scratch,
// (size_t)graph_degree * (size_t)MAX_PQ_CHUNKS * sizeof(uint8_t), 256);
// diskann::alloc_aligned((void **)&aligned_pqtable_dist_scratch, 256 * (size_t)MAX_PQ_CHUNKS * sizeof(float),
// 256);
// diskann::alloc_aligned((void **)&aligned_dist_scratch, (size_t)graph_degree * sizeof(float), 256);
// diskann::alloc_aligned((void **)&aligned_query_float, aligned_dim * sizeof(float), 8 * sizeof(float));
// diskann::alloc_aligned((void **)&rotated_query, aligned_dim * sizeof(float), 8 * sizeof(float));
//
// memset(aligned_query_float, 0, aligned_dim * sizeof(float));
// memset(rotated_query, 0, aligned_dim * sizeof(float));
// }
//
// void set(size_t dim, T *query, const float norm = 1.0f)
// {
// for (size_t d = 0; d < dim; ++d)
// {
// if (norm != 1.0f)
// rotated_query[d] = aligned_query_float[d] = static_cast<float>(query[d]) / norm;
// else
// rotated_query[d] = aligned_query_float[d] = static_cast<float>(query[d]);
// }
// }
// };

void aggregate_coords(const std::vector<unsigned> &ids, const uint8_t *all_coords, const uint64_t ndims, uint8_t *out);

void pq_dist_lookup(const uint8_t *pq_ids, const size_t n_pts, const size_t pq_nchunks, const float *pq_dists,
Expand Down

0 comments on commit e9ecab0

Please sign in to comment.