-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add N2C16 * fix * update N2C16_gbs to 16 * fix env * fix * fix * update * fix env set * fix * fix bug * update
- Loading branch information
1 parent
e8d6233
commit 28b9eb8
Showing
13 changed files
with
428 additions
and
34 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
85 changes: 85 additions & 0 deletions
85
tests/test_tipc/auto_tuner/autoconfig/llama7b_lora_N2C16.json
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,85 @@ | ||
{ | ||
"dp_degree": "auto", | ||
"invalid_strategy": [ | ||
"stage3_mp*" | ||
], | ||
"max_search_time": 900, | ||
"max_time_per_task": 300, | ||
"metric_cfg": { | ||
"OptimizationDirection": "Maximize", | ||
"name": "interval_samples_per_second" | ||
}, | ||
"micro_batch_size": "auto", | ||
"mode": "LoRA", | ||
"model_cfg": { | ||
"global_batch_size": 16, | ||
"hidden_size": 4096, | ||
"num_attention_heads": 32, | ||
"num_layers": 28, | ||
"vocab_size": 65024 | ||
}, | ||
"mp_degree": [ | ||
1 | ||
], | ||
"need_baseline": true, | ||
"pp_degree": [ | ||
1 | ||
], | ||
"run_cmd": { | ||
"gradient_accumulation_steps": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"gradient_accumulation_steps" | ||
], | ||
"micro_batch_size": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"per_device_train_batch_size" | ||
], | ||
"mp_degree": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"tensor_parallel_degree" | ||
], | ||
"pp_degree": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"pipeline_parallel_degree" | ||
], | ||
"run_best_stage": { | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"autotuner_benchmark", | ||
0 | ||
] | ||
}, | ||
"search_stage": { | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"autotuner_benchmark", | ||
1 | ||
] | ||
}, | ||
"sharding_degree": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"sharding_parallel_degree" | ||
], | ||
"sharding_stage": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"sharding", | ||
"stage" | ||
], | ||
"use_recompute": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"recompute" | ||
], | ||
"recompute_granularity": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"recompute_granularity" | ||
] | ||
}, | ||
"schedule_prior": [ | ||
"mp4" | ||
], | ||
"sharding_degree": "auto", | ||
"sharding_stage": "auto", | ||
"task_limit": 2000, | ||
"use_recompute": "auto", | ||
"recompute_granularity":"auto" | ||
} |
87 changes: 87 additions & 0 deletions
87
tests/test_tipc/auto_tuner/autoconfig/llama7b_pretrain_N2C16.json
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,87 @@ | ||
{ | ||
"dp_degree": "auto", | ||
"max_search_time": 900, | ||
"max_time_per_task": 400, | ||
"metric_cfg": { | ||
"OptimizationDirection": "Maximize", | ||
"name": "interval_samples_per_second" | ||
}, | ||
"micro_batch_size": "auto", | ||
"model_cfg": { | ||
"global_batch_size": 16, | ||
"hidden_size": 5120, | ||
"num_attention_heads": 40, | ||
"num_layers": 40, | ||
"vocab_size": 32000 | ||
}, | ||
"mp_degree": "auto", | ||
"pp_degree": "auto", | ||
"run_cmd": { | ||
"gradient_accumulation_steps": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"gradient_accumulation_steps" | ||
], | ||
"micro_batch_size": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"per_device_train_batch_size" | ||
], | ||
"mp_degree": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"tensor_parallel_degree" | ||
], | ||
"pp_degree": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"pipeline_parallel_degree" | ||
], | ||
"run_best_stage": { | ||
"continue_training": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"continue_training", | ||
0 | ||
], | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"autotuner_benchmark", | ||
0 | ||
] | ||
}, | ||
"search_stage": { | ||
"continue_training": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"continue_training", | ||
0 | ||
], | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"autotuner_benchmark", | ||
1 | ||
] | ||
}, | ||
"sharding_degree": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"sharding_parallel_degree" | ||
], | ||
"sharding_stage": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"sharding", | ||
"stage" | ||
], | ||
"use_recompute": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"recompute" | ||
], | ||
"recompute_granularity": [ | ||
"./autoconfig/llama7b_pretrain_params.json", | ||
"recompute_granularity" | ||
] | ||
}, | ||
"sharding_degree": "auto", | ||
"sharding_stage": "auto", | ||
"task_limit": 2000, | ||
"use_recompute": "auto", | ||
"recompute_granularity": "auto", | ||
"invalid_strategy": ["stage3_mp*"], | ||
"schedule_prior": ["mp4"], | ||
"need_baseline": true, | ||
"mode": "Pretrain" | ||
} |
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
83 changes: 83 additions & 0 deletions
83
tests/test_tipc/auto_tuner/autoconfig/llama7b_sft_N2C16.json
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,83 @@ | ||
{ | ||
"dp_degree": "auto", | ||
"invalid_strategy": [ | ||
"stage3_mp*" | ||
], | ||
"max_search_time": 900, | ||
"max_time_per_task": 300, | ||
"metric_cfg": { | ||
"OptimizationDirection": "Maximize", | ||
"name": "interval_samples_per_second" | ||
}, | ||
"micro_batch_size": "auto", | ||
"mode": "SFT", | ||
"model_cfg": { | ||
"global_batch_size": 16, | ||
"hidden_size": 4096, | ||
"num_attention_heads": 32, | ||
"num_layers": 28, | ||
"vocab_size": 65024 | ||
}, | ||
"mp_degree": "auto", | ||
"need_baseline": true, | ||
"pp_degree": [ | ||
1 | ||
], | ||
"run_cmd": { | ||
"gradient_accumulation_steps": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"gradient_accumulation_steps" | ||
], | ||
"micro_batch_size": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"per_device_train_batch_size" | ||
], | ||
"mp_degree": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"tensor_parallel_degree" | ||
], | ||
"pp_degree": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"pipeline_parallel_degree" | ||
], | ||
"run_best_stage": { | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"autotuner_benchmark", | ||
0 | ||
] | ||
}, | ||
"search_stage": { | ||
"autotuner_benchmark": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"autotuner_benchmark", | ||
1 | ||
] | ||
}, | ||
"sharding_degree": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"sharding_parallel_degree" | ||
], | ||
"sharding_stage": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"sharding", | ||
"stage" | ||
], | ||
"use_recompute": [ | ||
"./autoconfig/llama7b_sft_params.json", | ||
"recompute" | ||
], | ||
"recompute_granularity": [ | ||
"./autoconfig/llama7b_lora_params.json", | ||
"recompute_granularity" | ||
] | ||
}, | ||
"schedule_prior": [ | ||
"mp4" | ||
], | ||
"sharding_degree": "auto", | ||
"sharding_stage": "auto", | ||
"task_limit": 2000, | ||
"use_recompute": "auto", | ||
"recompute_granularity":"auto" | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/test_tipc/auto_tuner/llama_finetune/N2C16/CE_autotuner_llama7b_bs16_bf16_lora.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
param="model_item=CE_autotuner_llama7b " | ||
param+="run_mode=lora " | ||
param+="device_num=N2C16 " | ||
param+="global_batch_size=16 " | ||
param+="nnodes=2 " | ||
param+="autoconfig_json_file=autoconfig/llama7b_lora_N2C16.json " | ||
param+="modle_json_file=autoconfig/llama7b_lora_params.json " | ||
|
||
cd ./tests | ||
bash ./test_tipc/auto_tuner/llama_finetune/benchmark_common/prepare.sh multi | ||
|
||
bash -c "${param} bash ./test_tipc/auto_tuner/llama_finetune/benchmark_common/run_benchmark.sh" |
26 changes: 26 additions & 0 deletions
26
tests/test_tipc/auto_tuner/llama_finetune/N2C16/CE_autotuner_llama7b_bs16_bf16_sft.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
param="model_item=CE_autotuner_llama7b " | ||
param+="run_mode=sft " | ||
param+="device_num=N2C16 " | ||
param+="global_batch_size=16 " | ||
param+="nnodes=2 " | ||
param+="autoconfig_json_file=autoconfig/llama7b_sft_N2C16.json " | ||
param+="modle_json_file=autoconfig/llama7b_sft_params.json " | ||
|
||
cd ./tests | ||
bash ./test_tipc/auto_tuner/llama_finetune/benchmark_common/prepare.sh multi | ||
|
||
bash -c "${param} bash ./test_tipc/auto_tuner/llama_finetune/benchmark_common/run_benchmark.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
Oops, something went wrong.