Datasets:
reembed: explicit thread count for index build; progress logging
Browse filesFiles changed (2)
250 unmodified lines251252253254255256257258259119 unmodified lines379380381382383384385250 unmodified linescodes = lambda a: np.ascontiguousarray(np.packbits(np.asarray(a) >= 0, axis=1, bitorder='little'))train = np.sort(np.random.default_rng(20261017).choice(n, size=min(n, 64 * nlist), replace=False))index = faiss.index_binary_factory(384, f'BIVF{nlist}_HNSW16'); index.cp.seed = 20261017; index.cp.niter = 10t = time.time(); index.train(codes(x[train]))for a in range(0, n, 1_000_000):index.add_with_ids(codes(x[a:a + 1_000_000]), ids[a:a + 1_000_000])name = f'index-{n}.faiss'; faiss.write_index_binary(index, str(root / 'ann' / name))return index, name, dict(type='IndexBinaryIVF_HNSW16', dimensions=384, nlist=nlist, train_size=len(train), seed=20261017, train_iterations=10,binary_derivation='quantized_int8_gte_zero_little_endian_v1', faiss_version=faiss.__version__, seconds=round(time.time() - t))119 unmodified linesSTATE.update(stage='assemble'); publish_status()fetch_parts(work, progress); root, _ = assemble(work, progress, man)STATE.update(stage='ann'); publish_status()threads = os.cpu_count(); index, name, cfg = build_ann(root, threads)STATE.update(stage='evaluate', ann=cfg); publish_status()evaluation = evaluate(work, root, index, load_model('cuda'), threads); del indexSTATE.update(stage='publish', evaluation={n: {k: v['gold@10'] for k, v in r.items()} for n, r in evaluation.items()}); publish_status()250 unmodified lines251252253254255256257258259260261262119 unmodified lines382383384385386387388250 unmodified linescodes = lambda a: np.ascontiguousarray(np.packbits(np.asarray(a) >= 0, axis=1, bitorder='little'))train = np.sort(np.random.default_rng(20261017).choice(n, size=min(n, 64 * nlist), replace=False))index = faiss.index_binary_factory(384, f'BIVF{nlist}_HNSW16'); index.cp.seed = 20261017; index.cp.niter = 10t = time.time(); print(json.dumps(dict(ann='train_start', points=len(train), nlist=nlist, threads=threads)), flush=True)index.train(codes(x[train])); print(json.dumps(dict(ann='trained', seconds=round(time.time() - t))), flush=True)for a in range(0, n, 1_000_000):index.add_with_ids(codes(x[a:a + 1_000_000]), ids[a:a + 1_000_000])if (a // 1_000_000) % 5 == 4:STATE.update(ann_added=a + 1_000_000); print(json.dumps(dict(ann='added', rows=a + 1_000_000, seconds=round(time.time() - t))), flush=True)name = f'index-{n}.faiss'; faiss.write_index_binary(index, str(root / 'ann' / name))return index, name, dict(type='IndexBinaryIVF_HNSW16', dimensions=384, nlist=nlist, train_size=len(train), seed=20261017, train_iterations=10,binary_derivation='quantized_int8_gte_zero_little_endian_v1', faiss_version=faiss.__version__, seconds=round(time.time() - t))119 unmodified linesSTATE.update(stage='assemble'); publish_status()fetch_parts(work, progress); root, _ = assemble(work, progress, man)STATE.update(stage='ann'); publish_status()threads = int(os.environ.get('THREADS') or len(os.sched_getaffinity(0))); print('threads', threads, 'cpu_count', os.cpu_count(), flush=True); index, name, cfg = build_ann(root, threads)STATE.update(stage='evaluate', ann=cfg); publish_status()evaluation = evaluate(work, root, index, load_model('cuda'), threads); del indexSTATE.update(stage='publish', evaluation={n: {k: v['gold@10'] for k, v in r.items()} for n, r in evaluation.items()}); publish_status()
123456789101112{"build_id": "reembed-20261111","state": "running","started": 1794393740.2010944,"stage": "ann","resumed_blocks": 1,"blocks_total": 51,"blocks_done": 1,"last_block": "chunks-00009-of-00009.jsonl.gz:2","passages_per_second": 1050.4,"epoch": 1794422559.6084034}1{"build_id": "reembed-20261111", "state": "pending", "stage": "relaunch for index build", "started": 1794423241.077497}
builds/reembed-20261111/reembed.py+5-2
builds/reembed-20261111/status.json+1-12