diff --git a/.github/actions/python-wheel/action.yml b/.github/actions/python-wheel/action.yml index 6a2880c6d..015bf5195 100644 --- a/.github/actions/python-wheel/action.yml +++ b/.github/actions/python-wheel/action.yml @@ -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 diff --git a/.github/workflows/push-test.yml b/.github/workflows/push-test.yml index d1261d5ff..f458710c6 100644 --- a/.github/workflows/push-test.yml +++ b/.github/workflows/push-test.yml @@ -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 diff --git a/apps/test_streaming_scenario.cpp b/apps/test_streaming_scenario.cpp index 5a43a69f3..5747327a1 100644 --- a/apps/test_streaming_scenario.cpp +++ b/apps/test_streaming_scenario.cpp @@ -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 { diff --git a/apps/utils/stats_label_data.cpp b/apps/utils/stats_label_data.cpp index 3342672ff..63d303538 100644 --- a/apps/utils/stats_label_data.cpp +++ b/apps/utils/stats_label_data.cpp @@ -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(); diff --git a/apps/utils/vector_analysis.cpp b/apps/utils/vector_analysis.cpp index 009df6d05..12a45a9f8 100644 --- a/apps/utils/vector_analysis.cpp +++ b/apps/utils/vector_analysis.cpp @@ -37,8 +37,7 @@ template 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; } diff --git a/include/ann_exception.h b/include/ann_exception.h index 6b81373c1..474a5266a 100644 --- a/include/ann_exception.h +++ b/include/ann_exception.h @@ -6,6 +6,7 @@ #include #include #include "windows_customizations.h" +#include #ifndef _WINDOWS #define __FUNCSIG__ __PRETTY_FUNCTION__ @@ -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 diff --git a/include/utils.h b/include/utils.h index d3af5c3a9..c04a16515 100644 --- a/include/utils.h +++ b/include/utils.h @@ -635,8 +635,7 @@ inline void load_range_truthset(const std::string &bin_file, std::vector(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++) { diff --git a/include/windows_aligned_file_reader.h b/include/windows_aligned_file_reader.h index 0d9a3173c..621891595 100644 --- a/include/windows_aligned_file_reader.h +++ b/include/windows_aligned_file_reader.h @@ -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 diff --git a/src/in_mem_data_store.cpp b/src/in_mem_data_store.cpp index cc7acf615..85dea1af5 100644 --- a/src/in_mem_data_store.cpp +++ b/src/in_mem_data_store.cpp @@ -53,8 +53,8 @@ template location_t InMemDataStore::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__); @@ -86,8 +86,8 @@ template location_t InMemDataStore::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__); diff --git a/src/index.cpp b/src/index.cpp index efc63011b..4b38027d7 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -426,8 +426,8 @@ size_t Index::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__); @@ -478,8 +478,8 @@ size_t Index::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__); } @@ -785,7 +785,7 @@ bool Index::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) @@ -1531,8 +1531,8 @@ void Index::build_with_data_populated(const std::vector & 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__); } @@ -1645,8 +1645,8 @@ void Index::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__); } @@ -1663,8 +1663,8 @@ void Index::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__); @@ -1985,8 +1985,8 @@ std::pair Index::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; } @@ -2072,8 +2072,8 @@ std::pair Index::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; } @@ -2170,8 +2170,8 @@ size_t Index::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; }