结构体 faiss::gpu::GpuParameterSpace

struct GpuParameterSpace : public faiss::ParameterSpace

GPU 索引的参数空间和设置器

公共函数

virtual void initialize(const faiss::Index *index) override

使用索引的合理参数进行初始化

virtual void set_index_parameter(faiss::Index *index, const std::string &name, double val) const override

在索引上设置参数组合

size_t n_combinations() const

组合的数量,= 值大小的乘积

bool combination_ge(size_t c1, size_t c2) const

返回元组意义上组合 c1 >= c2 是否成立

std::string combination_name(size_t cno) const

获取组合的字符串表示形式

void display() const

在标准输出上打印描述

ParameterRange &add_range(const std::string &name)

添加新参数(如果存在则返回它)

void set_index_parameters(Index *index, size_t cno) const

在索引上设置参数组合

void set_index_parameters(Index *index, const char *param_string) const

设置由字符串描述的参数组合

void update_bounds(size_t cno, const OperatingPoint &op, double *upper_bound_perf, double *lower_bound_t) const

对于给定的操作点 op,找出配置 cno 的性能上限和 t 的下限

void explore(Index *index, size_t nq, const float *xq, const AutoTuneCriterion &crit, OperatingPoints *ops) const

探索操作点

参数:
  • index – 要在其上运行的索引

  • xq – 查询向量(大小为 nq * index.d)

  • crit – 选择标准

  • ops – 结果操作点

公共成员

std::vector<ParameterRange> parameter_ranges

所有可调参数

int verbose

探索期间的详细程度

int n_experiments

优化期间的实验次数(0 = 尝试所有组合)

size_t batchsize

一次提交的最大查询数。

bool thread_over_batches

在批次上使用多线程(有助于基准测试独立的单次搜索)

double min_test_duration

多次运行测试,直到它们至少达到这个持续时间(以避免 MT 模式下的抖动)