-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update * format * readme * update README * fix * update readme * config -> configs * update sft * update * update * update * black format * format and isort * fix imports * rm usless files * format
- Loading branch information
Showing
13 changed files
with
350 additions
and
228 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,67 @@ | ||
|
||
### 推理 | ||
|
||
- cuda PASS | ||
|
||
```bash | ||
python projects/Qwen/pipeline.py --model_path=/root/models/Qwen1.5-7B-Chat --mode=huggingface | ||
``` | ||
|
||
- npu PASS | ||
|
||
```bash | ||
python projects/Qwen/pipeline.py --model_path=/data0/hf_models/qwen2/Qwen1.5-7B-Chat --mode=huggingface --device=npu | ||
``` | ||
|
||
- xpu PASS | ||
|
||
```bash | ||
python projects/Qwen/pipeline.py --model_path=/root/models/Qwen1.5-7B-Chat --mode=huggingface --device=xpu | ||
``` | ||
|
||
### 训练 | ||
|
||
- data preparation | ||
|
||
```bash | ||
python projects/Qwen/utils/data_prepare.py | ||
``` | ||
|
||
- cuda PASS | ||
|
||
```bash | ||
export NUM_GPUS=8 | ||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node ${NUM_GPUS} \ | ||
--nnodes 1 \ | ||
--node_rank 0 \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port 12345 \ | ||
tools/train_net.py --config-file=projects/Qwen/configs/qwen_sft.py \ | ||
graph.enabled=True \ | ||
train.input_placement_device="cuda" \ | ||
train.dist.device_type="cuda" \ | ||
train.dist.pipeline_parallel_size=${NUM_GPUS} | ||
``` | ||
A100-PCIE-40GB x 4 OOM | ||
|
||
- xpu OOM | ||
|
||
```bash | ||
export NUM_GPUS=1 | ||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node ${NUM_GPUS} \ | ||
--nnodes 1 \ | ||
--node_rank 0 \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port 12345 \ | ||
tools/train_net.py --config-file=projects/Qwen/configs/qwen_sft.py \ | ||
graph.enabled=False \ | ||
train.input_placement_device="xpu" \ | ||
train.dist.device_type="xpu" \ | ||
train.dist.pipeline_parallel_size=${NUM_GPUS} | ||
``` | ||
|
||
- npu 没有测,应该不行 | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import oneflow as flow | ||
from oneflow.utils.data import Dataset | ||
|
||
from libai.data.structures import DistTensorData, Instance | ||
|
||
|
||
class QwenDataset(Dataset): | ||
def __init__(self, path, tokenizer): | ||
self.data = flow.load(path) | ||
self.tokenizer = tokenizer | ||
|
||
def __len__(self): | ||
return len(self.data) | ||
|
||
def __getitem__(self, index): | ||
return Instance( | ||
input_ids=DistTensorData(self.data[index]["input_ids"]), | ||
labels=DistTensorData(self.data[index]["labels"]), | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.