NVIDIA / NVIDIA/raft

[FEA] `raft-ann-bench` should validate configurations

Open
#2,149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request improvement Vector Search
Dominant language
Cuda
Stars
1k
Forks
251
Avg merge
1d 8h
Merged PRs (30d)
31

Description

Is your feature request related to a problem? Please describe.

Currently, the data models for the configuration yaml files are not validated. Directly referencing dict by key isn't safe. For example, in the following code snippet, a typo like constraint instead of constraints in the yaml file could lead to the constraints being ignored silently.

            def add_algo_group(group_list):
                if algo["name"] not in algos_conf:
                    algos_conf[algo["name"]] = {"groups": {}}
                for group in algo["groups"].keys():
                    if group in group_list:
                        algos_conf[algo["name"]]["groups"][group] = algo[
                            "groups"
                        ][group]
                if "constraints" in algo:
                    algos_conf[algo["name"]]["constraints"] = algo[
                        "constraints"
                    ]

Describe the solution you'd like

Use Pydantic to define and validate the data model for the configuration files.

Describe alternatives you've considered

dataclasses.dataclass would work as well.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in python/raft-ann-bench/src/raft-ann-bench/run/main.py at the configuration handling around lines 485-496, then trace the YAML data consumed there. Define validation models using Pydantic for the configuration structures and replace unsafe dictionary access; done means configuration typos such as constraint are reported instead of silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.