Skip to content

Commit

Permalink
debug for laion100m
Browse files Browse the repository at this point in the history
  • Loading branch information
usamoi committed Nov 8, 2024
1 parent d17f040 commit 59e5fa9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/algorithm/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ pub fn insert(relation: Relation, payload: Pointer, vector: Vec<f32>, distance_k
&h2_tuple.factor_err,
&h2_tuple.t,
),
1.9,
);
for j in 0..32 {
if h2_tuple.mask[j] {
Expand Down Expand Up @@ -191,6 +192,7 @@ pub fn insert(relation: Relation, payload: Pointer, vector: Vec<f32>, distance_k
&h1_tuple.factor_err,
&h1_tuple.t,
),
1.9,
);
for j in 0..32 {
if h1_tuple.mask[j] {
Expand Down
4 changes: 2 additions & 2 deletions src/index/am_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ pub fn convert_opfamily_to_vd(
fn convert_name_to_vd(name: &str) -> Option<(VectorKind, PgDistanceKind)> {
match name.strip_suffix("_ops") {
Some("vector_l2") => Some((VectorKind::Vecf32, PgDistanceKind::L2)),
Some("vector_ip") => Some((VectorKind::Vecf32, PgDistanceKind::Dot)),
Some("vector_cosine") => Some((VectorKind::Vecf32, PgDistanceKind::Cos)),
Some("vector_ip" | "vector_dot") => Some((VectorKind::Vecf32, PgDistanceKind::Dot)),
Some("vector_cosine" | "vector_cos") => Some((VectorKind::Vecf32, PgDistanceKind::Cos)),
_ => None,
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pgrx::extension_sql_file!("./sql/finalize.sql", finalize);

#[pgrx::pg_guard]
unsafe extern "C" fn _PG_init() {
unsafe {
std::env::set_var("RUST_BACKTRACE", "1");
}
if unsafe { pgrx::pg_sys::IsUnderPostmaster } {
pgrx::error!("rabbithole must be loaded via shared_preload_libraries.");
}
Expand Down

0 comments on commit 59e5fa9

Please sign in to comment.