Open eware-godaddy opened 5 months ago
@eware-godaddy As an user of older CPUs, what have you seen are the best ways libraries have made available compatible binaries for these users? We'd prefer a way that didn't hurt functionality for the majority of users with CPUs from the most recent 10 years.
@eware-godaddy we built lance with minimal cpu target haswell
, that has avx2
and fma
, which we used for vectorization in vector search.
One quick way to use lance on old CPU is build from source by removing this line https://github.com/lancedb/lance/blob/main/.cargo/config.toml#L31
We also found that building for newer instruction set (esp after skylake / icelake) can bring significant speed up. Similarity, Redhat, ubuntu are testing x86-x64-v3 / v4
in the next LTSs as well. We dont have a conclusion about how do we want to achieve that yet.
@eware-godaddy we built lance with minimal cpu target
haswell
, that hasavx2
andfma
, which we used for vectorization in vector search.One quick way to use lance on old CPU is build from source by removing this line https://github.com/lancedb/lance/blob/main/.cargo/config.toml#L31
We also found that building for newer instruction set (esp after skylake / icelake) can bring significant speed up. Similarity, Redhat, ubuntu are testing
x86-x64-v3 / v4
in the next LTSs as well. We dont have a conclusion about how do we want to achieve that yet.
I tried the approach you suggested; I commented out the line with optimizations, but when I try to build the project I get a bunch of errors such as:
error[E0599]: no method named `optimize_indices` found for struct `DatasetWriteGuard<'_>` in the current scope
--> /Users/dzan/.cargo/git/checkouts/lancedb-daf1dd3257b225ca/c0ea44d/rust/lancedb/src/table.rs:1063:14
|
1060 | / self.dataset
1061 | | .get_mut()
1062 | | .await?
1063 | | .optimize_indices(options)
| | -^^^^^^^^^^^^^^^^ method not found in `DatasetWriteGuard<'_>`
| |_____________|
|
|
::: /Users/dzan/.cargo/git/checkouts/lancedb-daf1dd3257b225ca/c0ea44d/rust/lancedb/src/table/dataset.rs:254:1
|
254 | pub struct DatasetWriteGuard<'a> {
| -------------------------------- method `optimize_indices` not found for this struct
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
17 + use lance_index::traits::DatasetIndexExt;
|
error[E0599]: no method named `load_indices` found for struct `DatasetReadGuard<'_>` in the current scope
--> /Users/dzan/.cargo/git/checkouts/lancedb-daf1dd3257b225ca/c0ea44d/rust/lancedb/src/table.rs:1177:56
|
1177 | let (indices, mf) = futures::try_join!(dataset.load_indices(), dataset.latest_manifest())?;
| ^^^^^^^^^^^^ method not found in `DatasetReadGuard<'_>`
|
::: /Users/dzan/.cargo/git/checkouts/lancedb-daf1dd3257b225ca/c0ea44d/rust/lancedb/src/table/dataset.rs:239:1
|
239 | pub struct DatasetReadGuard<'a> {
| ------------------------------- method `load_indices` not found for this struct
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
17 + use lance_index::traits::DatasetIndexExt;
...
I am quite new to Rust so I am not sure if I am doing something wrong, or those optimizations are somehow necessary.
@eware-godaddy How did you finally solve this problem?
When doing a pip install on python 3.9, 3.10, 3.11 on my older Intel CPU when I do
import lancedb
python dumps core with anillegal instruction
error.This is on ubuntu 20.04.
Details from
/proc/cpuinfo
below:the core dump:
after some gdb:
Looks like a lack of AVX2