[C API] Register BFLOAT16 element type in the `StorageSimple` dispatcher
Maintainer antworten meist innerhalb von 5 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
Rechercherichtung
Start with the dispatcher rows in bindings/c/src/data_builder/simple.hpp, the type mapping in bindings/c/src/types_support.hpp, and the constructor handling in bindings/c/src/storage.hpp. Read the corresponding FLOAT16 tests in bindings/c/tests/ before implementing the BF16 round-trip and index-flow coverage. Done means BF16 storage creation, indexing, searching, saving, loading, and memory reporting work consistently with the stated tolerances.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
SVS_DATA_TYPE_BFLOAT16 is declared in the C API enum
(bindings/c/include/svs/c/svs_c.h), but at pin
5717f6855a73a9ab7524748e2a10a57ed865737d no StorageSimple
specialization is registered for it in the dispatch table at
bindings/c/src/data_builder/simple.hpp:93-104, and
bindings/c/src/storage.hpp:51-55 throws when constructed with
SVS_DATA_TYPE_BFLOAT16. As a result, svs_storage_create_simple(SVS_DATA_TYPE_BFLOAT16, err)
fails, and callers cannot use BF16 vectors as the SVS storage kind.
This ask adds the BFloat16 specialization to the dispatcher so the
type is fully reachable end-to-end.
Motivation
valkey-search supports TYPE FLOAT32, TYPE FLOAT16, and
TYPE BFLOAT16 for its ALGORITHM HNSW index (see valkey-search
PR #1001). Users who already ingest BFloat16 embeddings (common in
recent LLM inference stacks) can pick ALGORITHM HNSW today. For
ALGORITHM SVS_VAMANA, valkey-search rejects TYPE BFLOAT16 at
parse because the SVS C API path cannot store the vectors -- FLOAT32
and FLOAT16 are supported end-to-end but BFLOAT16 is not.
The C++ core supports BFloat16 (svs::BFloat16 exists in
include/svs/lib/bfloat16.h and is used by other paths e.g.
orchestrators/dynamic_ivf.h), so the missing piece is purely a
dispatcher registration in the C API's simple-storage builder.
Proposed change
Add one specialization row to bindings/c/src/data_builder/simple.hpp:
// bindings/c/src/data_builder/simple.hpp:93-104 (approximate)
XX(float, float_alloc)
XX(svs::Float16, float16_alloc)
XX(svs::BFloat16, bfloat16_alloc) // <-- new
Plus the corresponding entry in bindings/c/src/types_support.hpp
so to_data_type(svs_data_type_t) maps
SVS_DATA_TYPE_BFLOAT16 to DataType::bfloat16 (currently returns
DataType::undef).
Plus lift the StorageSimple ctor throw at storage.hpp:51-55 for
BFLOAT16.
Acceptance criteria
svs_storage_create_simple(SVS_DATA_TYPE_BFLOAT16, err)returns
a valid storage handle.- A
svs_index_builder_twith a BFloat16 storage builds an index
viasvs_index_build_dynamic.svs_index_dynamic_add_points
acceptsconst float*inputs and internally converts to BFloat16
for storage (mirroring the FLOAT16 path). svs_index_search_topkon a BFloat16 index returns top-k
results matching the C++ core's BFloat16 behavior.svs_storage_get_kindon the storage returns a value consistent
with the BFloat16 kind.svs_index_get_memory_usagereports
BFloat16-sized data bytes (2 bytes per element).- Unit tests in
bindings/c/tests/:- Round-trip: build with BF16 storage, add N vectors, search,
save, load, search again -- results within numerical
tolerance appropriate to BFloat16 quantization. - Cross-check against the FLOAT16 test at the same N and k --
confirm the two paths follow the same acceptance shape.
- Round-trip: build with BF16 storage, add N vectors, search,
Non-goals
- Adding BFloat16 as a
StorageSQorStorageLVQelement type.
Simple-storage (uncompressed) is sufficient; SQ/LVQ inputs are
independent design decisions. - Distance kernel optimization. Scalar fallback is acceptable for
the initial registration; an AVX / AVX-512-BF16 kernel is a
separate optimization.
- Vorherrschende Sprache
- C++
- Sterne
- 241
- Forks
- 48
- Ø Merge
- 4 T. 21 Std.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus intel/ScalableVectorSearch
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
intel/ScalableVectorSearch#356 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
intel/ScalableVectorSearch#469 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 32/100
intel/ScalableVectorSearch#460 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
intel/ScalableVectorSearch#438 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
CI: tier the test matrix into PR / main / nightly to cut Actions minutesEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 32/100
intel/ScalableVectorSearch#432 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 5 Tagen
Alle Issues in intel/ScalableVectorSearch
Ähnliche Issues
-
runtime: lf_f128_mod is documented as fmodq (truncating) but implements floor-based modulo; unusedOffeninternal correctness low priority rt_lib
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 87/100
-
PriorityNotificationQueue::wakeUpAll() loses the wake-up for a thread that is not waiting yetEvtl. vergeben @matejk hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
pocoproject/poco#5674 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug docs GUI
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
sonic-pi-net/sonic-pi#3609 ·
-
Unreachable code warningOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
SanderMertens/flecs#2395 ·
Maintainer antworten meist innerhalb von 1 Tag