Instantiate SIMD Ops, not distance implementations

未关闭
#197 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

  • #199 来自 @copilot-swe-agent —— 已关闭,未合并

评估

这个 Issue 还没有评估数据。

描述

enhancement question

For ISA dispatching, we instantiate the distance implementations (L2Impl, IPImpl, CosineSimilarityImpl). Since there are template parameters N, Ea, Eb, AVX_AVAILABILITY, corresponding to dimensionality, element type A, element type B, and AVX availability flag, respectively, many combinations of explicit template values are required. Crucially, also one for N, the fixed-/dynamic-dimensionality support.

It is not the best place to create the AVX-specific instantiations, because only the actual compute ops benefit from ISA-optimization.

The current implementations creates a lot of code

  • at the end of the distance headers (cosine.h, euclidean.h, inner_product.h) to define the symbols as extern; and
  • to produce the instantiations multi-arch/avx2.cpp and multi-arch/avx512.cpp;
    all of which makes heavy use of preprocessor macros and is therefore hard to understand and debug.

Completion of #183 should allow to lower the explicit instantiations to the various compute ops (IPFloatOp, IPVNNIOp, L2FloatOp, etc.), for which we already use fixed values of N, eliminating combinatorial complexity in the instantiations.

The task is to understand if is after completion of #183 such a simplification is possible, and, if so, implement it.


AS A maintainer of SVS
I WANT TO lower the instantiation of architecture-specific functions to the actual compute operations
SO THAT I can reduce maintenance and future development cost, as well as have a more optimal solution in general.

主要语言
C++
星标
241
派生
48
平均合并
4 天 21 小时
30 天内合并 PR
11

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

intel/ScalableVectorSearch 的其他 Issue

查看 intel/ScalableVectorSearch 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。