Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/actions/python-wheel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ runs:
env:
CIBW_BUILD: ${{inputs.cibw-identifier}}
shell: bash
- uses: actions/upload-artifact@v3
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheel-${{ github.run_id }}-${{ github.job }}
path: ./dist/*.whl
12 changes: 12 additions & 0 deletions .github/workflows/push-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,28 @@ jobs:
with:
fetch-depth: 1
submodules: true

# Set up Python 3.11 on both platforms, ensuring diskannpy is installable
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Build diskannpy dependency tree
run: |
pip install diskannpy pipdeptree
echo "dependencies" > dependencies_${{ matrix.os }}.txt
pipdeptree >> dependencies_${{ matrix.os }}.txt

- name: Archive diskannpy dependencies artifact
uses: actions/upload-artifact@v4
with:
name: dependencies_${{ matrix.os }}
path: |
dependencies_${{ matrix.os }}.txt

- name: DiskANN Build CLI Applications
uses: ./.github/actions/build
9 changes: 4 additions & 5 deletions apps/test_streaming_scenario.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,13 @@ void delete_and_consolidate(diskann::AbstractIndex &index, diskann::IndexWritePa
int wait_time = 5;
if (report._status == diskann::consolidation_report::status_code::LOCK_FAIL)
{
diskann::cerr << "Unable to acquire consolidate delete lock after "
<< "deleting points " << start << " to " << end << ". Will retry in " << wait_time
<< "seconds." << std::endl;
diskann::cerr << "Unable to acquire consolidate delete lock after " << "deleting points " << start
<< " to " << end << ". Will retry in " << wait_time << "seconds." << std::endl;
}
else if (report._status == diskann::consolidation_report::status_code::INCONSISTENT_COUNT_ERROR)
{
diskann::cerr << "Inconsistent counts in data structure. "
<< "Will retry in " << wait_time << "seconds." << std::endl;
diskann::cerr << "Inconsistent counts in data structure. " << "Will retry in " << wait_time
<< "seconds." << std::endl;
}
else
{
Expand Down
9 changes: 3 additions & 6 deletions apps/utils/stats_label_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,13 @@ void stats_analysis(const std::string labels_file, std::string univeral_label, u
<< " with count=" << label_count_vec[(size_t)(p * label_count_vec.size())].second << std::endl;
}

std::cout << "Most common label "
<< "\t" << label_count_vec[label_count_vec.size() - 1].first
std::cout << "Most common label " << "\t" << label_count_vec[label_count_vec.size() - 1].first
<< " with count=" << label_count_vec[label_count_vec.size() - 1].second << std::endl;
if (label_count_vec.size() > 1)
std::cout << "Second common label "
<< "\t" << label_count_vec[label_count_vec.size() - 2].first
std::cout << "Second common label " << "\t" << label_count_vec[label_count_vec.size() - 2].first
<< " with count=" << label_count_vec[label_count_vec.size() - 2].second << std::endl;
if (label_count_vec.size() > 2)
std::cout << "Third common label "
<< "\t" << label_count_vec[label_count_vec.size() - 3].first
std::cout << "Third common label " << "\t" << label_count_vec[label_count_vec.size() - 3].first
<< " with count=" << label_count_vec[label_count_vec.size() - 3].second << std::endl;
avg_labels_per_pt = sum / (float)point_cnt;
mean_label_size = sum / (float)label_counts.size();
Expand Down
3 changes: 1 addition & 2 deletions apps/utils/vector_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ template <typename T> int analyze_norm(std::string base_file)
std::sort(norms.begin(), norms.end());
for (int p = 0; p < 100; p += 5)
std::cout << "percentile " << p << ": " << norms[(uint64_t)(std::floor((p / 100.0) * npts))] << std::endl;
std::cout << "percentile 100"
<< ": " << norms[npts - 1] << std::endl;
std::cout << "percentile 100" << ": " << norms[npts - 1] << std::endl;
delete[] data;
return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion include/ann_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdexcept>
#include <system_error>
#include "windows_customizations.h"
#include <cstdint>

#ifndef _WINDOWS
#define __FUNCSIG__ __PRETTY_FUNCTION__
Expand All @@ -29,6 +30,6 @@ class FileException : public ANNException
{
public:
DISKANN_DLLEXPORT FileException(const std::string &filename, std::system_error &e, const std::string &funcSig,
const std::string &fileName, uint32_t lineNum);
const std::string &fileName, std::uint32_t lineNum);
};
} // namespace diskann
3 changes: 1 addition & 2 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,7 @@ inline void load_range_truthset(const std::string &bin_file, std::vector<std::ve
for (uint32_t p = 0; p < 100; p += 5)
std::cout << "percentile " << p << ": " << gt_stats[static_cast<size_t>(std::floor((p / 100.0) * gt_num))]
<< std::endl;
std::cout << "percentile 100"
<< ": " << gt_stats[gt_num - 1] << std::endl;
std::cout << "percentile 100" << ": " << gt_stats[gt_num - 1] << std::endl;

for (uint32_t i = 0; i < gt_num; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion include/windows_aligned_file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WindowsAlignedFileReader : public AlignedFileReader
// virtual IOContext createContext();

public:
DISKANN_DLLEXPORT WindowsAlignedFileReader(){};
DISKANN_DLLEXPORT WindowsAlignedFileReader() {};
DISKANN_DLLEXPORT virtual ~WindowsAlignedFileReader(){};

// Open & close ops
Expand Down
8 changes: 4 additions & 4 deletions src/in_mem_data_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ template <typename data_t> location_t InMemDataStore<data_t>::load_impl(AlignedF
if (file_dim != this->_dim)
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << this->_dim << " dimension,"
<< "but file has " << file_dim << " dimension." << std::endl;
stream << "ERROR: Driver requests loading " << this->_dim << " dimension," << "but file has " << file_dim
<< " dimension." << std::endl;
diskann::cerr << stream.str() << std::endl;
aligned_free(_data);
throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
Expand Down Expand Up @@ -86,8 +86,8 @@ template <typename data_t> location_t InMemDataStore<data_t>::load_impl(const st
if (file_dim != this->_dim)
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << this->_dim << " dimension,"
<< "but file has " << file_dim << " dimension." << std::endl;
stream << "ERROR: Driver requests loading " << this->_dim << " dimension," << "but file has " << file_dim
<< " dimension." << std::endl;
diskann::cerr << stream.str() << std::endl;
aligned_free(_data);
throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
Expand Down
34 changes: 17 additions & 17 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ size_t Index<T, TagT, LabelT>::load_tags(const std::string tag_filename)
if (file_dim != 1)
{
std::stringstream stream;
stream << "ERROR: Found " << file_dim << " dimensions for tags,"
<< "but tag file must have 1 dimension." << std::endl;
stream << "ERROR: Found " << file_dim << " dimensions for tags," << "but tag file must have 1 dimension."
<< std::endl;
diskann::cerr << stream.str() << std::endl;
delete[] tag_data;
throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
Expand Down Expand Up @@ -478,8 +478,8 @@ size_t Index<T, TagT, LabelT>::load_data(std::string filename)
if (file_dim != _dim)
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << _dim << " dimension,"
<< "but file has " << file_dim << " dimension." << std::endl;
stream << "ERROR: Driver requests loading " << _dim << " dimension," << "but file has " << file_dim
<< " dimension." << std::endl;
diskann::cerr << stream.str() << std::endl;
throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
}
Expand Down Expand Up @@ -785,7 +785,7 @@ bool Index<T, TagT, LabelT>::detect_common_filters(uint32_t point_id, bool searc
}
}
// intersection empty; proceed to check the universal label logic

if (_use_universal_label)
{
if (!search_invocation)
Expand Down Expand Up @@ -1531,8 +1531,8 @@ void Index<T, TagT, LabelT>::build_with_data_populated(const std::vector<TagT> &
if (_enable_tags && tags.size() != _nd)
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << _nd << " points from file,"
<< "but tags vector is of size " << tags.size() << "." << std::endl;
stream << "ERROR: Driver requests loading " << _nd << " points from file," << "but tags vector is of size "
<< tags.size() << "." << std::endl;
diskann::cerr << stream.str() << std::endl;
throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
}
Expand Down Expand Up @@ -1645,8 +1645,8 @@ void Index<T, TagT, LabelT>::build(const char *filename, const size_t num_points
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << num_points_to_load << " points and file has " << file_num_points
<< " points, but "
<< "index can support only " << _max_points << " points as specified in constructor." << std::endl;
<< " points, but " << "index can support only " << _max_points << " points as specified in constructor."
<< std::endl;

throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
}
Expand All @@ -1663,8 +1663,8 @@ void Index<T, TagT, LabelT>::build(const char *filename, const size_t num_points
if (file_dim != _dim)
{
std::stringstream stream;
stream << "ERROR: Driver requests loading " << _dim << " dimension,"
<< "but file has " << file_dim << " dimension." << std::endl;
stream << "ERROR: Driver requests loading " << _dim << " dimension," << "but file has " << file_dim
<< " dimension." << std::endl;
diskann::cerr << stream.str() << std::endl;

throw diskann::ANNException(stream.str(), -1, __FUNCSIG__, __FILE__, __LINE__);
Expand Down Expand Up @@ -1985,8 +1985,8 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::search(const T *query, con

if (L > scratch->get_L())
{
diskann::cout << "Attempting to expand query scratch_space. Was created "
<< "with Lsize: " << scratch->get_L() << " but search L is: " << L << std::endl;
diskann::cout << "Attempting to expand query scratch_space. Was created " << "with Lsize: " << scratch->get_L()
<< " but search L is: " << L << std::endl;
scratch->resize_for_new_L(L);
diskann::cout << "Resize completed. New scratch->L is " << scratch->get_L() << std::endl;
}
Expand Down Expand Up @@ -2072,8 +2072,8 @@ std::pair<uint32_t, uint32_t> Index<T, TagT, LabelT>::search_with_filters(const

if (L > scratch->get_L())
{
diskann::cout << "Attempting to expand query scratch_space. Was created "
<< "with Lsize: " << scratch->get_L() << " but search L is: " << L << std::endl;
diskann::cout << "Attempting to expand query scratch_space. Was created " << "with Lsize: " << scratch->get_L()
<< " but search L is: " << L << std::endl;
scratch->resize_for_new_L(L);
diskann::cout << "Resize completed. New scratch->L is " << scratch->get_L() << std::endl;
}
Expand Down Expand Up @@ -2170,8 +2170,8 @@ size_t Index<T, TagT, LabelT>::search_with_tags(const T *query, const uint64_t K

if (L > scratch->get_L())
{
diskann::cout << "Attempting to expand query scratch_space. Was created "
<< "with Lsize: " << scratch->get_L() << " but search L is: " << L << std::endl;
diskann::cout << "Attempting to expand query scratch_space. Was created " << "with Lsize: " << scratch->get_L()
<< " but search L is: " << L << std::endl;
scratch->resize_for_new_L(L);
diskann::cout << "Resize completed. New scratch->L is " << scratch->get_L() << std::endl;
}
Expand Down
Loading