mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-10-25 01:40:08 +00:00
[tutorial] edited hands-on practices (#1899)
* Add handson to ColossalAI. * Change names of handsons and edit sequence parallel example. * Edit wrong folder name * resolve conflict * delete readme
This commit is contained in:
40
examples/tutorial/sequence_parallel/config.py
Normal file
40
examples/tutorial/sequence_parallel/config.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from colossalai.amp import AMP_TYPE
|
||||
|
||||
DATA_PATH = ''
|
||||
VOCAB_FILE_PATH = ''
|
||||
|
||||
# hyper-parameters
|
||||
TRAIN_ITERS = 1000000
|
||||
DECAY_ITERS = 990000
|
||||
WARMUP_FRACTION = 0.01
|
||||
GLOBAL_BATCH_SIZE = 32 # dp world size * sentences per GPU
|
||||
EVAL_ITERS = 10
|
||||
EVAL_INTERVAL = 10
|
||||
LR = 0.0001
|
||||
MIN_LR = 1e-05
|
||||
WEIGHT_DECAY = 0.01
|
||||
SEQ_LENGTH = 512
|
||||
|
||||
# BERT config
|
||||
DEPTH = 12
|
||||
NUM_ATTENTION_HEADS = 12
|
||||
HIDDEN_SIZE = 768
|
||||
|
||||
# model config
|
||||
ADD_BINARY_HEAD = False
|
||||
|
||||
# random seed
|
||||
SEED = 1234
|
||||
|
||||
# pipeline config
|
||||
# only enabled when pipeline > 1
|
||||
NUM_MICRO_BATCHES = 4
|
||||
|
||||
# colossalai config
|
||||
parallel = dict(pipeline=1, tensor=dict(size=4, mode='sequence'))
|
||||
|
||||
fp16 = dict(mode=AMP_TYPE.NAIVE, verbose=True)
|
||||
|
||||
clip_grad_norm = 1.0
|
||||
|
||||
gradient_handler = [dict(type='SequenceParallelGradientHandler')]
|
||||
Reference in New Issue
Block a user