mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
feat: vectorize CAM retrieval with NumPy and add multi-worker support
- Replace scalar hamming distance with NumPy bitwise_count for batch retrieval - Add ThreadPoolExecutor-based multi-worker query parallelism - Improve missing dataset error message with generation command hint - Increase DEFAULT_MAX_QUERIES from 128 to 8192 for meaningful throughput tests
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import numpy as np
|
||||
|
||||
from scripts.prepare_cam_retrieval_dataset import (
|
||||
DEFAULT_MAX_QUERIES,
|
||||
dataset_config,
|
||||
pack_bits_to_words_le,
|
||||
stratified_indices,
|
||||
@@ -15,6 +16,10 @@ def test_dataset_config_resolves_cifar10_and_cifar100() -> None:
|
||||
assert dataset_config("cifar100") == ("uoft-cs/cifar100", "fine_label")
|
||||
|
||||
|
||||
def test_default_query_count_is_large_enough_for_software_throughput() -> None:
|
||||
assert DEFAULT_MAX_QUERIES == 8192
|
||||
|
||||
|
||||
def test_dataset_config_rejects_unknown_dataset() -> None:
|
||||
try:
|
||||
dataset_config("mnist")
|
||||
|
||||
Reference in New Issue
Block a user