Skip to content

Commit

Permalink
[doc] Editorial updates (#340)
Browse files Browse the repository at this point in the history
* Editorial updates

* minor

* Removed indent

* Removed indenting
  • Loading branch information
writinwaters authored Dec 21, 2023
1 parent e06c816 commit ef4ba95
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 103 deletions.
45 changes: 16 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</p>

<h4 align="center">
<a href="https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=github&utm_medium=meilisearch&utm_content=nav">Roadmap 2024</a> |
<a href="https://github.com/infiniflow/infinity/issues/338">Roadmap 2024</a> |
<a href="https://twitter.com/infiniflowai">Twitter</a> |
<a href="https://discord.gg/6Zex37FE">Discord</a> |
<a href="https://www.youtube.com/@InfiniFlow-AI">YouTube</a> |
Expand All @@ -26,7 +26,7 @@ Infinity comes with high performance, flexibility, ease-of-use, and many feature
- Achieves 0.1 milliseconds query latency on million-scale vector datasets.
- Up to 10K QPS on million-scale vector datasets.

> See the [Benchmark](https://www.example.com).
> See the [Benchmark](docs/benchmark.md).

### 🔮 Fused search
Expand All @@ -39,24 +39,20 @@ Supports a wide range of data types including strings, numerics, vectors, and mo

### 🎁 Ease-of-use

- Intuitive Python API. See the [Python client]()
- Intuitive Python API. See the [Python API](docs/pysdk_api_reference.md)
- A single-binary architecture with no dependencies, making deployment a breeze.

## 🎮 Get Started

### Prerequisites

- Operating system: Ubuntu 22.04 or higher
- Clang-17 or higher to support C++20 and modules
- CMake 3.28 or higher


### Install Infinity's Python client

```bash
pip install infinity_sdk
```



### Import necessary modules

```python
Expand All @@ -74,57 +70,48 @@ infinity_obj = infinity.connect(REMOTE_HOST)
```



### Get a database

```python
db = infinity_obj.get_database("default")
```



### Create a table

```python
# Drop my_table if it already exists
db.drop_table("my_table", if_exists=True)
# Create a table named "my_table"
db.create_table(
"my_table", {"num": "integer", "body": "varchar", "vec": "vector,4,float"}, None)
# Drop my_table if it already exists
db.drop_table("my_table", if_exists=True)
# Create a table named "my_table"
table=db.create_table("my_table", {"num": "integer", "body": "varchar", "vec": "vector, 4, float"}, None)
```



### Insert two records

```python
table.insert(
[{"num": 1, "body": "undesirable, unnecessary, and harmful", "vec": [1.0, 1.2, 0.8, 0.9]}])
table.insert(
[{"num": 2, "body": "publisher=US National Office for Harmful Algal Blooms", "vec": [4.0, 4.2, 4.3, 4.5]}])
table.insert([{"num": 1, "body": "unnecessary and harmful", "vec": [1.0, 1.2, 0.8, 0.9]}])
table.insert([{"num": 2, "body": "Office for Harmful Blooms", "vec": [4.0, 4.2, 4.3, 4.5]}])
```



### Execute a vector search

```python
res = table.query_builder().output(["*"]).knn("vec", [3.0, 2.8, 2.7, 3.1], "float", "ip", 2).to_pl()
print(res)
res = table.output(["*"]).knn("vec", [3.0, 2.8, 2.7, 3.1], "float", "ip", 2).to_pl()
print(res)
```



> 💡 For more information about the Python API, see the [Python API Reference]().
> 💡 For more information about the Python API, see the [Python API Reference](docs/pysdk_api_reference.md).

## 🛠️ Build from Source

See [Build from Source](build_from_source.md).
See [Build from Source](docs/build_from_source.md).

## 📜 Roadmap

- [Infinity Roadmap 2024]()
See the [Infinity Roadmap 2024](https://github.com/infiniflow/infinity/issues/338)

## 🙌 Community

Expand Down
62 changes: 0 additions & 62 deletions build_from_source.md

This file was deleted.

23 changes: 11 additions & 12 deletions docs/benchmark.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Benchmark

**infinity** supply python script for sift1m and gist1m dataset benchmark.
**Infinity** provides Python script for sift1m and gist1m dataset benchmark.

## Get infinity binary file
## Get the Infinity binary file

```sh
git clone https://github.com/infiniflow/infinity.git
cd infinity
```

## download benchmark file
## Download the benchmark file

download via wget
Download via wget.

```sh
#download sift benchmark
Expand All @@ -21,8 +21,7 @@ wget ftp://ftp.irisa.fr/local/texmex/corpus/gist.tar.gz

```

or
visit [http://corpus-texmex.irisa.fr/](http://corpus-texmex.irisa.fr/) to download manually.
or visit [http://corpus-texmex.irisa.fr/](http://corpus-texmex.irisa.fr/) to download manually.

```sh
#uncompress and move benchmark file
Expand All @@ -39,7 +38,7 @@ mv gist/gist_groundtruth.ivecs test/data/benchmark/gist_1m/gist_groundtruth.ivec

```

## Benchmark dependency
## Benchmark dependencies

```sh
cd python
Expand All @@ -49,9 +48,9 @@ python setup.py bdist_wheel
pip install dist/infinity_sdk-0.1.0.dev1-py3-none-any.whl
```

## Start infinity
## Start Infinity

Read [README.md](https://github.com/infiniflow/infinity/blob/main/README.md) to start infinity.
See the [README.md](https://github.com/infiniflow/infinity/blob/main/README.md) to start Infinity.

## Import data

Expand All @@ -66,7 +65,7 @@ python remote_benchmark_import.py -d sift_1m
python remote_benchmark_import.py -d gist_1m
```

## run benchmark
## Run benchmark

```sh
options:
Expand All @@ -75,9 +74,9 @@ options:
-r ROUNDS, --rounds ROUNDS
-d DATA_SET, --data DATA_SET

# ROUNDS means how many times python runs the benchmark. The result is the average for each time.
# ROUNDS refers to the number of times that Python runs the benchmark. The result is the average time for all runs.

# following command means run benchmark with 1 thread, for 1 time using sift dataset
# The following command means run benchmark with one thread, for one time using the sift dataset.
python remote_benchmark.py -t 1 -r 1 -d sift_1m

python remote_benchmark.py -t 1 -r 1 -d gist_1m
Expand Down
103 changes: 103 additions & 0 deletions docs/build_from_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@


- [Build from source on Ubuntu 22.04](#build-from-source-on-ubuntu-2204)
- [Build from source on Ubuntu 23.10](#build-from-source-on-ubuntu-2310)

## Build from source on Ubuntu 22.04

This section provides instructions on building Infinity from source on Ubuntu 22.04.

### Step1 Download source code

```shell
$ git clone https://github.com/infiniflow/infinity.git
```

### Step2 Install necessary dependencies

#### Step [1/9]: sudo apt update && sudo apt install -y git wget unzip software-properties-common

```bash
sudo apt update && sudo apt install -y git wget unzip software-properties-common
```

#### Step [2/9]: Download cmake-3.28.1

```bash
wget https://cmake.org/files/v3.28/cmake-3.28.1-linux-x86_64.tar.gz
```

### Step [3/9]: Install cmake-3.28.1

```bash
tar zxvf cmake-3.28.1-linux-x86_64.tar.gz
cp -rf cmake-3.28.1-linux-x86_64/bin/* /usr/local/bin && cp -rf cmake-3.28.1-linux-x86_64/share/* /usr/local/share && rm -rf cmake-3.28.1-linux-x86_64
```

###


## Step3 Build source code

```shell
$ git config --global --add safe.directory infinity
$ cd infinity && mkdir build && cd build
$ export CC=/usr/bin/clang-18
$ export CXX=/usr/bin/clang++-18
$ cmake -G Ninja ..
$ ninja -j 12
```

### Step4 Start up Infinity server

```shell
$ ./src/infinity_main
```



## Build from source on Ubuntu 23.10

```shell
$ git clone https://github.com/infiniflow/infinity.git
```


## Step1 Download Source Code

```shell
$ git clone https://github.com/infiniflow/infinity.git
```

## Step2 Install dependencies






## Step3 Build source code

```shell
$ git config --global --add safe.directory infinity
$ cd infinity && mkdir build && cd build
$ export CC=/usr/bin/clang-18
$ export CXX=/usr/bin/clang++-18
$ cmake -G Ninja ..
$ ninja -j 12
```

### Step4 Start up Infinity server

```shell
$ ./src/infinity_main
```

## SDK develop

### Generate thrift rpc code

```shell
$ apt install thrift-compiler
$ cd tools && python generate_rpc_code.py
```
File renamed without changes.

0 comments on commit ef4ba95

Please sign in to comment.