Commit 80a1656
Enable Faiss dynamic dispatch for OVIS and VeST fbpkgs (facebookresearch#5515)
Summary:
Pull Request resolved: facebookresearch#5515
Enable `faiss.dynamic_dispatch=true` on the three `vector_search` fbpkgs that link Faiss, and add a probe that logs which SIMD kernels each process actually dispatched to. Also adds some logs in VeST.
**fbpkgs covered**
- `ovis_cli` (`cli/BUCK`)
- `vector_search_offline_knn` (`offline_knn/BUCK`)
- `vector_search_index_trainer` (`training/BUCK`) — the VeST trainer
Without the flag, Faiss is compiled with static AVX2 SIMD selection. With it, all compiled-in SIMD variants (AVX2, AVX512, AVX512-SPR) are built and the best supported one is selected at runtime via CPUID.
**This is not a speedup, and is not intended as one.** These workloads *build* indexes rather than search them, and the AVX-512 win for SQ4 lives on the scan path, not the encode path. Measured end-to-end as perf-neutral — see the test plan. The reasons to land it are consistency across the `vector_search` fbpkgs, unlocking AVX-512 for any future search-side work in these binaries, and the observability below.
**SIMD probe.** `log_faiss_simd_level()` in `training/utils.py` logs `level`, `dispatched_level`, `has_dynamic_dispatch` and `compile_options`. It is called from `assignment_worker.py` (datasink worker) and from `datasinks/common.py::_build_merged_file_blocking` (the spawned leaf-build children are separate processes and do not inherit parent Faiss state, so each reports its own; guarded to log once per process rather than once per cluster).
This probe is load-bearing: Faiss logs nothing about its own dispatch state, so the earlier VeST DD A/B could not distinguish "DD did not help" from "DD never engaged". With the probe, that ambiguity is resolved — DD demonstrably engages, and the null result is real.
Reviewed By: bshethmeta
Differential Revision: D107286701
fbshipit-source-id: 48cada6220c2b379f9774514edd48f2f5858f39a1 parent e2f9cca commit 80a1656
1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3057 | 3057 | | |
3058 | 3058 | | |
3059 | 3059 | | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
3060 | 3090 | | |
3061 | 3091 | | |
3062 | 3092 | | |
| |||
0 commit comments