Skip to content

Commit

Permalink
add GPT3-13B auto export (#5515)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoxiaWang authored Apr 4, 2023
1 parent 5acbba4 commit 2bb0965
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
_base_: ./pretrain_gpt_base.yaml


Engine:
mix_precision:
enable: True
dtype: "bfloat16"
level: "o2"
scale_loss: 32768.0
custom_black_list: ["reduce_sum", "c_softmax_with_cross_entropy", "elementwise_div", "where"]
custom_white_list: ["lookup_table", "lookup_table_v2"]
use_fp16_guard: False


Generation:
top_k: 1
top_p: 0.9
temperature: 1.0
min_dec_len: 1
max_dec_len: 8
use_topp_sampling: True
num_return_sequences: 1
decode_strategy: "sampling"
use_topp_sampling: True
early_finish: True


Model:
module: GPTGenerationModuleAuto
vocab_size: 50432
hidden_size: 5120
num_layers: 40
num_attention_heads: 40
ffn_hidden_size:
hidden_dropout_prob: 0.1
attention_probs_dropout_prob: 0.1
max_position_embeddings: 4096
type_vocab_size: 16
initializer_range: 0.02
use_recompute: True
recompute_granularity: 'full'
no_recompute_layers:


Distributed:
dp_degree: 1
mp_degree: 8
pp_degree: 1
sharding:
sharding_degree: 1
sharding_stage: 1
22 changes: 22 additions & 0 deletions model_zoo/gpt-3/projects/gpt/auto_export_gpt_13B_mp8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/bash

# Copyright (c) 2023 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.

log_dir=log_mp8
rm -rf $log_dir

python -m paddle.distributed.launch --log_dir $log_dir --devices "0,1,2,3,4,5,6,7" \
./tools/auto_export.py \
-c ./ppfleetx/configs/nlp/gpt/auto/generation_gpt_13B_mp8.yaml

0 comments on commit 2bb0965

Please sign in to comment.