Skip to content

Conversation

@CascadingRadium
Copy link
Member

@CascadingRadium CascadingRadium commented Nov 13, 2025

  • Adds the faiss_get_free_memory API that returns the amount of memory available in a GPU in bytes.
  • Add pagination support for residual calculation in IVF SQ indexes, which allows long term indexing workloads to stay within the memory limit, avoiding GPU memory spikes and potential GPU OOM kills.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new C API function to retrieve the amount of free GPU memory in bytes. The implementation wraps the existing C++ faiss::gpu::getFreeMemory function to expose it to C callers.

  • Adds faiss_get_free_memory function that takes a device ID and returns the free memory via an output parameter
  • Follows the established pattern for C API wrappers in the codebase
  • Uses the CATCH_AND_HANDLE macro for consistent error handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
c_api/gpu/DeviceUtils_c.h Declares the new faiss_get_free_memory function with proper documentation
c_api/gpu/DeviceUtils_c.cpp Implements the function by wrapping faiss::gpu::getFreeMemory with appropriate error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CascadingRadium CascadingRadium changed the title Add an API to retrieve the amount of free memory in a GPU MB-59670: GPU-Accelerated Vector Search Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants