From 6a5443aa86582800d1843d0c499f55abd40d0ab7 Mon Sep 17 00:00:00 2001 From: Tarang Jain Date: Fri, 3 Nov 2023 10:55:24 -0700 Subject: [PATCH] remove unneeded funcs --- .../raft/neighbors/detail/ivf_pq_build.cuh | 21 --- .../raft/neighbors/ivf_pq_codepacker.cuh | 141 ------------------ 2 files changed, 162 deletions(-) delete mode 100644 cpp/include/raft/neighbors/ivf_pq_codepacker.cuh diff --git a/cpp/include/raft/neighbors/detail/ivf_pq_build.cuh b/cpp/include/raft/neighbors/detail/ivf_pq_build.cuh index cb540ff665..4d818d7412 100644 --- a/cpp/include/raft/neighbors/detail/ivf_pq_build.cuh +++ b/cpp/include/raft/neighbors/detail/ivf_pq_build.cuh @@ -1467,27 +1467,6 @@ void extend_list_with_codes(raft::resources const& res, recompute_internal_state(res, *index); } -/** - * Extend one list of the index in-place, by the list label, skipping the classification and - * encoding steps. - * See the public interface for the api and usage. - */ -template -void extend_list_with_compressed_codes( - raft::resources const& res, - index* index, - device_matrix_view new_codes, - device_vector_view new_indices, - uint32_t label) -{ - // Allocate memory and write indices - auto offset = extend_list_prepare(res, index, new_indices, label); - // Pack the data - pack_list_data(res, index, new_codes, label, offset); - // Update the pointers and the sizes - recompute_internal_state(res, *index); -} - /** * Extend one list of the index in-place, by the list label, skipping the classification step. * See the public interface for the api and usage. diff --git a/cpp/include/raft/neighbors/ivf_pq_codepacker.cuh b/cpp/include/raft/neighbors/ivf_pq_codepacker.cuh deleted file mode 100644 index 25797b2b44..0000000000 --- a/cpp/include/raft/neighbors/ivf_pq_codepacker.cuh +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2023, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -namespace raft::neighbors::ivf_pq::codepacker { - -// template -// void unpack_1(const uint8_t* block, uint8_t* flat_code, uint32_t pq_dim, uint32_t offset) -// { -// ivf_pq::detail::run_on_vector(block, 0, offset, pq_dim, unpack_1_action{flat_code}); -// } - -// template -// void pack_1(const uint8_t* flat_code, uint8_t* block, uint32_t pq_dim, uint32_t offset) -// { -// ivf_pq::detail::write_vector(block, offset, 0, pq_dim, pass_1_action{flat_code}); -// } - -// /** -// * Unpack 1 record of a single list (cluster) in the index to fetch the flat (compressed) PQ -// code. -// * The offset indicates the id of the record. This function fetches one flat code from an -// * interleaved code. -// * -// * @param[in] block interleaved block. Pointer to the inverted list data in interleaved format -// * @param[out] flat_code output flat PQ code -// * @param[in] pq_dim -// * @param[in] offset fetch the flat PQ code by the given offset -// */ -// template -// void unpack_1_pq(const uint8_t* block, uint8_t* flat_code, uint32_t pq_dim, uint32_t offset) -// { -// ivf_pq::detail::run_on_vector(block, offset, 0, pq_dim, unpack_1_action{flat_code}); -// } - -// /** -// * Write one flat (compressed) PQ code into a block by the given offset. The offset indicates the -// id -// * of the record in the list. This function interleaves the code and writes the interleaved -// result -// * to the output. NB: no memory allocation happens here; the block must fit the record (offset + -// 1). -// * -// * @param[in] block interleaved block. Pointer to the inverted list data in interleaved format -// * @param[out] flat_code output flat PQ code -// * @param[in] pq_dim -// * @param[in] offset fetch the flat PQ code by the given offset -// */ -// template -// void pack_1_pq(const uint8_t* flat_code, uint8_t* block, uint32_t pq_dim, uint32_t offset) -// { -// ivf_pq::detail::write_vector(block, offset, 0, pq_dim, pass_1_action{flat_code}); -// } - -// /** -// * Unpack 1 record of a single list (cluster) in the index to fetch the flat (compressed) PQ -// code. -// * The offset indicates the id of the record. This function fetches one flat code from an -// * interleaved code. -// * -// * @param[in] block interleaved block. Pointer to the inverted list data in interleaved format -// * @param[out] flat_code output flat PQ code -// * @param[in] pq_dim -// * @param[in] offset fetch the flat PQ code by the given offset -// */ -// template -// void unpack_1_pq(const uint8_t* block, uint8_t* flat_code, uint32_t pq_dim, uint32_t offset) -// { -// ivf_pq::detail::run_on_vector(block, offset, 0, pq_dim, unpack_1_action{flat_code}); -// } - -// /** -// * Write one flat (compressed) PQ code into a block by the given offset. The offset indicates the -// id -// * of the record in the list. This function interleaves the code and writes the interleaved -// result -// * to the output. NB: no memory allocation happens here; the block must fit the record (offset + -// 1). -// * -// * @param[in] block interleaved block. Pointer to the inverted list data in interleaved format -// * @param[out] flat_code output flat PQ code -// * @param[in] pq_dim -// * @param[in] offset fetch the flat PQ code by the given offset -// */ -// template -// void pack_pq(raft::resources handle, const uint8_t* flat_codes, uint8_t* block, uint32_t pq_dim, -// uint32_t num_codes, uint32_t offset, uint32_t batch_size=0) -// { -// auto spec = list_spec(PqBits, pq_dim, false); -// auto extents = spec.make_list_extents(num_codes); -// auto list_view = make_readonly_temporary_device_buffer(handle, flat_codes, -// extents).view(); ivf_pq::detail::pack_list_data(block, offset, 0, pq_dim, -// ivf_pq::detail::pass_codes{flat_code}); -// } - -// inline void unpack( -// raft::resources const& res, uint8_t* list_data, uint32_t pq_bits, uint32_t offset, uint8_t* -// codes) -// { -// auto extents = raft::make_extents<>(); -// auto make_writeback_temporary_device_buffer( -// raft::resources const& handle, ElementType* data, raft::extents -// extents) make_writeback_temporary_device_buffer(res, codes, ) -// ivf_pq::detail::unpack_list_data( -// codes, list_data, offset, pq_bits, resource::get_cuda_stream(res)); -// } - -// inline void pack( -// raft::resources const& res, -// device_matrix_view codes, -// uint32_t pq_bits, -// uint32_t offset, -// uint32_t batch_size, -// device_mdspan::list_extents, row_major> list_data) -// { -// ivf_pq::detail::pack_list_data(list_data, codes, offset, pq_bits, -// resource::get_cuda_stream(res)); -// } -} // namespace raft::neighbors::ivf_pq::codepacker \ No newline at end of file