From 7757ad3d8f3f26581d1b2da29e22907508ec964d Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Sat, 17 Aug 2024 15:15:14 +0900 Subject: [PATCH] add PRODUCT_VARIANT --- .github/workflows/run-qdrant-int8-linux.yml | 56 +++++++++++++++++++++ run-qdrant.ipynb | 11 ++-- 2 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/run-qdrant-int8-linux.yml diff --git a/.github/workflows/run-qdrant-int8-linux.yml b/.github/workflows/run-qdrant-int8-linux.yml new file mode 100644 index 0000000..6c0ed3e --- /dev/null +++ b/.github/workflows/run-qdrant-int8-linux.yml @@ -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 + diff --git a/run-qdrant.ipynb b/run-qdrant.ipynb index cc83ea7..6257737 100644 --- a/run-qdrant.ipynb +++ b/run-qdrant.ipynb @@ -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", @@ -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", @@ -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" ] }, { @@ -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",