Skip to content

Commit

Permalink
update ckpt name of BitNet integration for vLLM
Browse files Browse the repository at this point in the history
  • Loading branch information
xysmlx committed Aug 9, 2024
1 parent 471a10c commit 7164521
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions integration/BitNet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ We provide two scripts to make the checkpoints for vLLM. The first script is `ge
cd /root/to/BitBLAS/integration/BitNet
# make the checkpoint
./maint/generate_bitnet_model_native_format.sh
# the output ckpy will be saved in the `./models/bitnet_b1_58-3B` directory
# the output ckpy will be saved in the `./models/ckpt_bitnet_b1_58-3B` directory
```

The second script is `generate_bitnet_model_bitblas_format.sh`, which is used to make a checkpoint with BitBLAS compressed metadata, which can avoid the online dequantize sage for the profiling of vLLM, which lead to more efficient memory utilization.

```bash
./maint/generate_bitnet_model_bitblas_format.sh ./models/bitnet_b1_58-3B ./models/bitnet_b1_58-3B_bitblas
# the output ckpy will be saved in the `./models/bitnet_b1_58-3B_bitblas` directory
./maint/generate_bitnet_model_bitblas_format.sh ./models/ckpt_bitnet_b1_58-3B ./models/ckpt_bitnet_b1_58-3B_bitblas
# the output ckpy will be saved in the `./models/ckpt_bitnet_b1_58-3B_bitblas` directory
```

Finnaly, you can use the ckpt in vLLM with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ mkdir -p models
cd models

# download the model
git clone https://huggingface.co/1bitLLM/bitnet_b1_58-3B bitnet_b1_58-3B --depth 1
git clone https://huggingface.co/1bitLLM/bitnet_b1_58-3B ckpt_bitnet_b1_58-3B --depth 1

# copy quantized config into the model directory
cp ../maint/quantize_config.json bitnet_b1_58-3B
cp ../maint/quantize_config.json ckpt_bitnet_b1_58-3B

# get the realpath of the model directory
MODEL_DIR=$(realpath bitnet_b1_58-3B)
MODEL_DIR=$(realpath ckpt_bitnet_b1_58-3B)

cd ..

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
current_file_path = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file_path)

ckpt_path = os.path.join(current_dir, "../models/bitnet_b1_58-3B_bitblas")
ckpt_path = os.path.join(current_dir, "../models/ckpt_bitnet_b1_58-3B_bitblas")
parser = argparse.ArgumentParser(description="Inference with BitNet")
parser.add_argument(
"--ckpt_path",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# get the path of the current file
current_file_path = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file_path)
ckpt_path = os.path.join(current_dir, "../models/bitnet_b1_58-3B_bitblas")
ckpt_path = os.path.join(current_dir, "../models/ckpt_bitnet_b1_58-3B_bitblas")

parser = argparse.ArgumentParser(description="Inference with BitNet")
parser.add_argument(
Expand Down

0 comments on commit 7164521

Please sign in to comment.