Skip to content

Commit

Permalink
add PRODUCT_VARIANT
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Aug 17, 2024
1 parent 3de6a29 commit 7757ad3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/run-qdrant-int8-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run Qdrant (int8) on Linux

on:
push:
branches:
- main
paths:
- run-qdrant.ipynb
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check Hardware Spec
run: /bin/bash ./scripts/get_hardware_info.sh
- name: Cache dataset
uses: actions/cache@v4
with:
path: |
dataset
key: ${{ runner.os }}-dataset
- name: Download data
run: /bin/bash ./scripts/setup.sh gha
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache pip modules
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run ANN search
run: papermill run-qdrant.ipynb output-qdrant-linux.ipynb --log-output
env:
PRODUCT_VARIANT: "int8"
SETTING_QUANTIZATION: "int8"
- name: 'Upload Results'
uses: actions/upload-artifact@v4
with:
name: qdrant-int8-results
path: results.json

11 changes: 7 additions & 4 deletions run-qdrant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
" \"hnsw_ef_construction\": 200,\n",
" \"hnsw_ef\": 100,\n",
" \"update_docs_per_sec\": 0,\n",
" \"quantization\": \"int8\",\n",
" \"quantization\": \"none\",\n",
" },\n",
" \"1m-768-m48-efc200-ef100-ip\": {\n",
" \"content_path\": Path(\"dataset/passages-c400-jawiki-20230403\"),\n",
Expand All @@ -86,7 +86,7 @@
" \"hnsw_ef_construction\": 200,\n",
" \"hnsw_ef\": 100,\n",
" \"update_docs_per_sec\": 0,\n",
" \"quantization\": \"int8\",\n",
" \"quantization\": \"none\",\n",
" },\n",
" \"5m-768-m48-efc200-ef100-ip\": {\n",
" \"content_path\": Path(\"dataset/passages-c400-jawiki-20230403\"),\n",
Expand All @@ -102,10 +102,12 @@
" \"hnsw_ef_construction\": 200,\n",
" \"hnsw_ef\": 100,\n",
" \"update_docs_per_sec\": 0,\n",
" \"quantization\": \"int8\",\n",
" \"quantization\": \"none\",\n",
" },\n",
" }\n",
" return DataSetConfig(**setting.get(target_name))\n"
" target_setting = setting.get(target_name)\n",
" target_setting[\"quantization\"] = os.getenv(\"SETTING_QUANTIZATION\", target_setting[\"quantization\"])\n",
" return DataSetConfig(**target_setting)\n"
]
},
{
Expand Down Expand Up @@ -717,6 +719,7 @@
"def save_results(target_config, config, results):\n",
" with open(\"results.json\", \"wt\", encoding=\"utf-8\") as f:\n",
" json.dump({\n",
" \"variant\": os.getenv(\"PRODUCT_VARIANT\", \"\"),\n",
" \"target\": target_config,\n",
" \"version\": config.qdrant_version,\n",
" \"settings\": asdict(config),\n",
Expand Down

0 comments on commit 7757ad3

Please sign in to comment.