Skip to content

Commit

Permalink
Runbook 1-based
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha-simhadri committed Jul 12, 2023
1 parent 4c25e20 commit 14e8c88
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 71 deletions.
4 changes: 2 additions & 2 deletions benchmark/streaming/load_runbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def load_runbook(dataset_name, max_pts, runbook_file):
raise Exception('Start not speficied in runbook')
if 'end' not in entry:
raise Exception('End not specified in runbook')
if entry['start'] < 1 or entry['start'] > max_pts:
if entry['start'] < 0 or entry['start'] >= max_pts:
raise Exception('Start out of range in runbook')
if entry['end'] < 1 or entry['end'] > max_pts:
if entry['end'] < 0 or entry['end'] > max_pts:
raise Exception('End out of range in runbook')
i += 1
run_list.append(entry)
Expand Down
128 changes: 64 additions & 64 deletions neurips23/streaming/clustered-runbook.yaml
Original file line number Diff line number Diff line change
@@ -1,129 +1,129 @@
random-clustered-xs:
0:
operation: insert
start: '0'
end: '326'
start: 0
end: 326
1:
operation: insert
start: '326'
end: '596'
start: 326
end: 596
2:
operation: insert
start: '596'
end: '945'
start: 596
end: 945
3:
operation: insert
start: '945'
end: '1323'
start: 945
end: 1323
4:
operation: insert
start: '1323'
end: '1623'
start: 1323
end: 1623
5:
operation: insert
start: '1623'
end: '1986'
start: 1623
end: 1986
6:
operation: insert
start: '1986'
end: '2199'
start: 1986
end: 2199
7:
operation: insert
start: '2199'
end: '2576'
start: 2199
end: 2576
8:
operation: insert
start: '2576'
end: '2921'
start: 2576
end: 2921
9:
operation: insert
start: '2921'
end: '3252'
start: 2921
end: 3252
10:
operation: insert
start: '3252'
end: '3530'
start: 3252
end: 3530
11:
operation: insert
start: '3530'
end: '3866'
start: 3530
end: 3866
12:
operation: insert
start: '3866'
end: '4150'
start: 3866
end: 4150
13:
operation: insert
start: '4150'
end: '4434'
start: 4150
end: 4434
14:
operation: insert
start: '4434'
end: '4707'
start: 4434
end: 4707
15:
operation: insert
start: '4707'
end: '5073'
start: 4707
end: 5073
16:
operation: insert
start: '5073'
end: '5404'
start: 5073
end: 5404
17:
operation: insert
start: '5404'
end: '5718'
start: 5404
end: 5718
18:
operation: insert
start: '5718'
end: '6072'
start: 5718
end: 6072
19:
operation: insert
start: '6072'
end: '6338'
start: 6072
end: 6338
20:
operation: insert
start: '6338'
end: '6613'
start: 6338
end: 6613
21:
operation: insert
start: '6613'
end: '6908'
start: 6613
end: 6908
22:
operation: insert
start: '6908'
end: '7115'
start: 6908
end: 7115
23:
operation: insert
start: '7115'
end: '7452'
start: 7115
end: 7452
24:
operation: insert
start: '7452'
end: '7717'
start: 7452
end: 7717
25:
operation: insert
start: '7717'
end: '8065'
start: 7717
end: 8065
26:
operation: insert
start: '8065'
end: '8313'
start: 8065
end: 8313
27:
operation: insert
start: '8313'
end: '8698'
start: 8313
end: 8698
28:
operation: insert
start: '8698'
end: '9011'
start: 8698
end: 9011
29:
operation: insert
start: '9011'
end: '9307'
start: 9011
end: 9307
30:
operation: insert
start: '9307'
end: '9651'
start: 9307
end: 9651
31:
operation: insert
start: '9651'
end: '10000'
start: 9651
end: 10000
4 changes: 2 additions & 2 deletions neurips23/streaming/diskann/diskann-str.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def setup(self, dtype, max_pts, ndim):
print('Index class constructed and ready for update/search')

def insert(self, X, ids):
self.index.batch_insert(X, ids)
self.index.batch_insert(X, ids+1)

def delete(self, ids):
for id in ids:
self.index.mark_deleted(id)
self.index.mark_deleted(id+1)
self.index.consolidate_delete()

def query(self, X, k):
Expand Down
6 changes: 3 additions & 3 deletions neurips23/streaming/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def run_task(algo, ds, distance, count, run_count, search_type, private_query, r
start = time.time()
match entry['operation']:
case 'insert':
ids = np.arange(entry['start'], entry['end']+1, dtype=np.uint32)
algo.insert(data[ids-1,:], ids)
ids = np.arange(entry['start'], entry['end'], dtype=np.uint32)
algo.insert(data[ids,:], ids)
case 'delete':
ids = np.arange(entry['start'], entry['end']+1, dtype=np.uint32)
ids = np.arange(entry['start'], entry['end'], dtype=np.uint32)
algo.delete(ids)
case 'search':
if search_type == 'knn':
Expand Down

0 comments on commit 14e8c88

Please sign in to comment.