-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bigdl] Change all "bigdl" to "ipexllm" (#189)
* bigdl2ipexllm * bigdl2ipexllm * bigdl2ipexllm * fix original name
- Loading branch information
1 parent
3670edf
commit 69f9824
Showing
13 changed files
with
148 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM ubuntu:22.04 | ||
|
||
ENV LANG C.UTF-8 | ||
|
||
WORKDIR /root/llm-on-ray | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt apt-get update -y \ | ||
&& apt-get install -y build-essential cmake wget curl git vim htop ssh net-tools \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV CONDA_DIR /opt/conda | ||
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ | ||
/bin/bash ~/miniconda.sh -b -p /opt/conda | ||
ENV PATH $CONDA_DIR/bin:$PATH | ||
|
||
# setup env | ||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
RUN --mount=type=cache,target=/opt/conda/pkgs conda init bash && \ | ||
unset -f conda && \ | ||
export PATH=$CONDA_DIR/bin/:${PATH} && \ | ||
conda config --add channels intel && \ | ||
conda install python==3.9 | ||
|
||
COPY ./pyproject.toml . | ||
COPY ./MANIFEST.in . | ||
|
||
# create llm_on_ray package directory to bypass the following 'pip install -e' command | ||
RUN mkdir ./llm_on_ray | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip pip install -e .[ipex-llm] --extra-index-url https://download.pytorch.org/whl/cpu \ | ||
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/ | ||
|
||
# Used to invalidate docker build cache with --build-arg CACHEBUST=$(date +%s) | ||
ARG CACHEBUST=1 | ||
COPY ./dev/scripts/install-oneapi.sh /tmp | ||
RUN /tmp/install-oneapi.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Deploying and Serving LLMs with IPEX-LLM | ||
[IPEX-LLM](https://ipex-llm.readthedocs.io/en/latest/doc/LLM/index.html) is a library for running LLM (large language model) on Intel XPU (from Laptop to GPU to Cloud) using INT4 with very low latency (for any PyTorch model). | ||
|
||
The integration with IPEX-LLM currently only supports running on Intel CPU. | ||
|
||
## Setup | ||
Please follow [setup.md](setup.md) to setup the environment first. Additional, you will need to install IPEX-LLM dependencies as below. | ||
```bash | ||
pip install .[ipex-llm] --extra-index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/ | ||
``` | ||
|
||
## Configure Serving Parameters | ||
Please follow the serving [document](serve.md#configure-deploying-parameters) for configuring the parameters. In the configuration file, you need to set `ipex-llm` and `load_in_4bit` to true. Example configuration files for enalbing ipex-llm are availabe [here].(../inference/models/ipex-llm) | ||
|
||
```bash | ||
ipexllm: true | ||
config: | ||
load_in_4bit: true | ||
``` | ||
|
||
## Deploy and Test | ||
Please follow the serving [document](serve.md#deploy-the-model) for deploying and testing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
llm_on_ray/inference/models/ipex-llm/mistral-7b-v0.1-ipex-llm.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
port: 8000 | ||
name: mistral-7b-v0.1-ipex-llm | ||
route_prefix: /mistral-7b-v0.1-ipex-llm | ||
num_replicas: 1 | ||
cpus_per_worker: 24 | ||
gpus_per_worker: 0 | ||
deepspeed: false | ||
workers_per_group: 2 | ||
device: cpu | ||
ipex: | ||
enabled: false | ||
precision: bf16 | ||
model_description: | ||
model_id_or_path: mistralai/Mistral-7B-v0.1 | ||
ipexllm: true | ||
tokenizer_name_or_path: mistralai/Mistral-7B-v0.1 | ||
chat_processor: ChatModelLLama | ||
prompt: | ||
intro: '' | ||
human_id: '<s>[INST] {msg} [/INST]' | ||
bot_id: '' | ||
stop_words: [] | ||
config: | ||
trust_remote_code: true | ||
load_in_4bit: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
port: 8000 | ||
name: mpt-7b-ipex-llm | ||
route_prefix: /mpt-7b-ipex-llm | ||
num_replicas: 1 | ||
cpus_per_worker: 24 | ||
gpus_per_worker: 0 | ||
deepspeed: false | ||
workers_per_group: 2 | ||
device: cpu | ||
ipex: | ||
enabled: false | ||
precision: bf16 | ||
model_description: | ||
model_id_or_path: mosaicml/mpt-7b-chat | ||
ipexllm: true | ||
tokenizer_name_or_path: EleutherAI/gpt-neox-20b | ||
chat_processor: ChatModelGptJ | ||
prompt: | ||
intro: 'Below is an instruction that describes a task, paired with an input that | ||
provides further context. Write a response that appropriately completes the request. | ||
' | ||
human_id: ' | ||
### Instruction' | ||
bot_id: ' | ||
### Response' | ||
stop_words: [] | ||
config: | ||
trust_remote_code: true | ||
load_in_4bit: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters