Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor the DLSA pipeline and add TPP support. #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions docs/fine-tuning/finetune_ipex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# How to Run DLSA Fine-Tuning with IPEX(FP32, BF16)

## Support Matrix

| Categoty | Script |
| ------------------- | --------------- |
| IPEX Single Instance | ft_ipex.sh |
| IPEX Multi Instances | ft_ipex_ccl.sh |

## Single Instance Fine-Tuning

```
./fine-tuning/ft_ipex.sh
```

By default, it will launch 1 instance to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

Below is the help message by using the command `./fine-tuning/ft_ipex.sh -h`:

```markdown
Usage: ./fine-tuning/ft_ipex.sh [OPTIONS]
OPTION includes:
-l | --log_name - the log name of this round
-d | --dataset - [imdb|sst2] whether to use imdb or sst2 DATASET
-b | --batch_size - batch size per instance
-s | --sequence_len - max sequence length
--dtype_ft - data type used for fine-tuning
--train_epoch - train epoch
-h | --help - displays this message
```
## Multi Instances Fine-Tuning


### Running single instance

```
bash fine-tuning/run_dist.sh -np 1 -ppn 1 bash fine-tuning/ft_ipex_ccl.sh
```

By default, it will launch 1 instance to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

### Running multi instances

```
bash fine-tuning/run_dist.sh -np 2 -ppn 2 bash fine-tuning/ft_ipex_ccl.sh
```

By default, it will launch 2 instances on single node to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

> Note:
>
> np: num process, means how many processes you will run on a cluster
>
> ppn: process per node, means how many processes you will run on 1 worker node.
>
> For example, if I want to run on 2 nodes, each node runs with 1 process, use the config `-np 2 -ppn 1`
>
> if I want to run on 4 nodes, each node runs with 2 processes, use the config `-np 8 -ppn 2`
>
> You can also use `-l $log_name` after `run_dist.sh` to set the log name.
60 changes: 60 additions & 0 deletions docs/fine-tuning/finetune_tpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# How to Run DLSA Fine-Tuning with IPEX(FP32, BF16)

## Support Matrix

| Categoty | Script |
| ------------------- | -------------- |
| TPP Single Instance | ft_tpp.sh |
| TPP Multi Instances | ft_tpp_ccl.sh |

## Single Instance Fine-Tuning

```
./fine-tuning/ft_ipex.sh
```

By default, it will launch 1 instance to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

Below is the help message by using the command `./fine-tuning/ft_ipex.sh -h`:

```markdown
Usage: ./fine-tuning/ft_ipex.sh [OPTIONS]
OPTION includes:
-l | --log_name - the log name of this round
-d | --dataset - [imdb|sst2] whether to use imdb or sst2 DATASET
-b | --batch_size - batch size per instance
-s | --sequence_len - max sequence length
--dtype_ft - data type used for fine-tuning
--train_epoch - train epoch
-h | --help - displays this message
```
## Multi Instances Fine-Tuning


### Running single instance

```
bash fine-tuning/run_dist.sh -np 1 -ppn 1 bash fine-tuning/ft_tpp_ccl.sh
```

By default, it will launch 1 instance to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

### Running multi instances

```
bash fine-tuning/run_dist.sh -np 2 -ppn 2 bash fine-tuning/ft_tpp_ccl.sh
```

By default, it will launch 2 instances on single node to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

> Note:
>
> np: num process, means how many processes you will run on a cluster
>
> ppn: process per node, means how many processes you will run on 1 worker node.
>
> For example, if I want to run on 2 nodes, each node runs with 1 process, use the config `-np 2 -ppn 1`
>
> if I want to run on 4 nodes, each node runs with 2 processes, use the config `-np 8 -ppn 2`
>
> You can also use `-l $log_name` after `run_dist.sh` to set the log name.
22 changes: 22 additions & 0 deletions docs/fine-tuning/finetune_trainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# How to Run DLSA Single Node Fine-Tuning with HF Trainer(FP32, BF16)

## Single instance Fine-Tuning

```
./fine-tuning/ft_trainer.sh
```

By default, it will launch 1 instance to run fine-tuning with SST-2 dataset and FP32 precision. You can change the configurations in the file or pass parameters when running the script.

Below is the help message by using the command `./fine-tuning/ft_trainer.sh -h`:

```markdown
Usage: ./fine-tuning/ft_trainer.sh [OPTIONS]
OPTION includes:
-l | --log_name - the log name of this round
-d | --dataset - [imdb|sst2] whether to use imdb or sst2 DATASET
-b | --batch_size - batch size per instance
-s | --sequence_len - max sequence length
--dtype_ft - data type used for fine-tuning
-h | --help - displays this message
```
50 changes: 0 additions & 50 deletions docs/fine-tuning/multi-nodes-ipex.md

This file was deleted.

44 changes: 0 additions & 44 deletions docs/fine-tuning/multi-nodes-stock-pytorch.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/fine-tuning/single-node-ipex.md

This file was deleted.

26 changes: 0 additions & 26 deletions docs/fine-tuning/single-node-stock-pytorch.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/fine-tuning/single-node-trainer.md

This file was deleted.

Loading