Skip to content

Commit edcc50f

Browse files
Added gaudi example for rerank model finetuning (#794)
Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>
1 parent 2d28beb commit edcc50f

File tree

5 files changed

+46
-14
lines changed

5 files changed

+46
-14
lines changed

InstructionTuning/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ Download a training file `alpaca_data.json` and upload it to the server with bel
2020

2121
```bash
2222
# upload a training file
23-
curl http://${your_ip}:8005/v1/finetune/upload_training_files -X POST -H "Content-Type: multipart/form-data" -F "files=@./alpaca_data.json"
23+
curl http://${your_ip}:8015/v1/files -X POST -H "Content-Type: multipart/form-data" -F "file=@./alpaca_data.json" -F purpose="fine-tune"
2424
```
2525

2626
### 2. Create fine-tuning job
2727

28-
After a training file `alpaca_data.json` is uploaded, use the following command to launch a finetuning job using `meta-llama/Llama-2-7b-chat-hf` as base model:
28+
After a training file like `alpaca_data.json` is uploaded, use the following command to launch a finetuning job using `meta-llama/Llama-2-7b-chat-hf` as base model:
2929

3030
```bash
3131
# create a finetuning job
32-
curl http://${your_ip}:8005/v1/fine_tuning/jobs \
32+
curl http://${your_ip}:8015/v1/fine_tuning/jobs \
3333
-X POST \
3434
-H "Content-Type: application/json" \
3535
-d '{
@@ -44,17 +44,14 @@ Below commands show how to list finetuning jobs, retrieve a finetuning job, canc
4444

4545
```bash
4646
# list finetuning jobs
47-
curl http://${your_ip}:8005/v1/fine_tuning/jobs -X GET
47+
curl http://${your_ip}:8015/v1/fine_tuning/jobs -X GET
4848

4949
# retrieve one finetuning job
50-
curl http://localhost:8005/v1/fine_tuning/jobs/retrieve -X POST -H "Content-Type: application/json" -d '{
51-
"fine_tuning_job_id": ${fine_tuning_job_id}}'
50+
curl http://${your_ip}:8015/v1/fine_tuning/jobs/retrieve -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
5251

5352
# cancel one finetuning job
54-
55-
curl http://localhost:8005/v1/fine_tuning/jobs/cancel -X POST -H "Content-Type: application/json" -d '{
56-
"fine_tuning_job_id": ${fine_tuning_job_id}}'
53+
curl http://${your_ip}:8015/v1/fine_tuning/jobs/cancel -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
5754

5855
# list checkpoints of a finetuning job
59-
curl http://${your_ip}:8005/v1/finetune/list_checkpoints -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
56+
curl http://${your_ip}:8015/v1/finetune/list_checkpoints -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
6057
```

InstructionTuning/docker_compose/intel/cpu/xeon/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ docker build -t opea/finetuning:latest --build-arg https_proxy=$https_proxy --bu
2727
Start docker container with below command:
2828

2929
```bash
30-
docker run -d --name="finetuning-server" -p 8005:8005 --runtime=runc --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/finetuning:latest
30+
docker run -d --name="finetuning-server" -p 8015:8015 --runtime=runc --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy opea/finetuning:latest
3131
```

InstructionTuning/docker_compose/intel/hpu/gaudi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ Start docker container with below command:
2727

2828
```bash
2929
export HF_TOKEN=${your_huggingface_token}
30-
docker run --runtime=habana -e HABANA_VISIBLE_DEVICES=all -p 8005:8005 -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host -e https_proxy=$https_proxy -e http_proxy=$http_proxy -e no_proxy=$no_proxy -e HF_TOKEN=$HF_TOKEN opea/finetuning-gaudi:latest
30+
docker run --runtime=habana -e HABANA_VISIBLE_DEVICES=all -p 8015:8015 -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host -e https_proxy=$https_proxy -e http_proxy=$http_proxy -e no_proxy=$no_proxy -e HF_TOKEN=$HF_TOKEN opea/finetuning-gaudi:latest
3131
```

RerankFinetuning/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Rerank model finetuning is the process of further training rerank model on a dat
88

99
Refer to the [Xeon Guide](./docker_compose/intel/cpu/xeon/README.md) for detail.
1010

11+
### Deploy Rerank Model Finetuning Service on Gaudi
12+
13+
Refer to the [Gaudi Guide](./docker_compose/intel/hpu/gaudi/README.md) for detail.
14+
1115
## Consume Rerank Model Finetuning Service
1216

1317
### 1. Upload a training file
@@ -47,10 +51,10 @@ Below commands show how to list finetuning jobs, retrieve a finetuning job, canc
4751
curl http://${your_ip}:8015/v1/fine_tuning/jobs -X GET
4852

4953
# retrieve one finetuning job
50-
curl http://localhost:8015/v1/fine_tuning/jobs/retrieve -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
54+
curl http://${your_ip}:8015/v1/fine_tuning/jobs/retrieve -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
5155

5256
# cancel one finetuning job
53-
curl http://localhost:8015/v1/fine_tuning/jobs/cancel -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
57+
curl http://${your_ip}:8015/v1/fine_tuning/jobs/cancel -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
5458

5559
# list checkpoints of a finetuning job
5660
curl http://${your_ip}:8015/v1/finetune/list_checkpoints -X POST -H "Content-Type: application/json" -d '{"fine_tuning_job_id": ${fine_tuning_job_id}}'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Deploy Rerank Model Finetuning Service on Gaudi
2+
3+
This document outlines the deployment process for a rerank model finetuning service utilizing the [GenAIComps](https://github.com/opea-project/GenAIComps.git) microservice on Intel Xeon server. The steps include Docker image creation, container deployment. We will publish the Docker images to Docker Hub, it will simplify the deployment process for this service.
4+
5+
## 🚀 Build Docker Images
6+
7+
First of all, you need to build Docker Images locally. This step can be ignored after the Docker images published to Docker hub.
8+
9+
### 1. Source Code install GenAIComps
10+
11+
```bash
12+
git clone https://github.com/opea-project/GenAIComps.git
13+
cd GenAIComps
14+
```
15+
16+
### 2. Build Docker Image
17+
18+
Build docker image with below command:
19+
20+
```bash
21+
docker build -t opea/finetuning-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/finetuning/Dockerfile.intel_hpu .
22+
```
23+
24+
### 3. Run Docker with CLI
25+
26+
Start docker container with below command:
27+
28+
```bash
29+
export HF_TOKEN=${your_huggingface_token}
30+
docker run --runtime=habana -e HABANA_VISIBLE_DEVICES=all -p 8015:8015 -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host -e https_proxy=$https_proxy -e http_proxy=$http_proxy -e no_proxy=$no_proxy -e HF_TOKEN=$HF_TOKEN opea/finetuning-gaudi:latest
31+
```

0 commit comments

Comments
 (0)