Skip to content

Commit

Permalink
add int4
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Aug 17, 2024
1 parent 355a083 commit b490b10
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/run-elasticsearch-int4-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run Elasticsearch (int4) on Linux

on:
push:
branches:
- main
paths:
- run-elasticsearch.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-elasticsearch.ipynb output-elasticsearch-linux.ipynb --log-output
env:
PRODUCT_VARIANT: "int4"
SETTING_QUANTIZATION: "int4"
- name: 'Upload Results'
uses: actions/upload-artifact@v4
with:
name: elasticsearch-int4-results
path: results.json

2 changes: 2 additions & 0 deletions run-elasticsearch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@
" knn_type = \"flat\"\n",
" if config.quantization == \"int8\":\n",
" knn_type = \"int8_hnsw\"\n",
" elif config.quantization == \"int4\":\n",
" knn_type = \"int4_hnsw\"\n",
" else:\n",
" knn_type = \"hnsw\"\n",
" print(F\"Creating {config.index_name} with {knn_type}... \", end=\"\")\n",
Expand Down

0 comments on commit b490b10

Please sign in to comment.