- 如果使用fp16,把句子padding成8的倍数,测试性能会提升
pad_to_multiple_of_8 = training_args.fp16 and not data_args.pad_to_max_length
pad_to_multiple_of=8 if pad_to_multiple_of_8 else None
batch = tokenizer.pad(
input_ids, return_tensors="pt", pad_to_multiple_of=pad_to_multiple_of)
标签:multiple,训练,性能,args,pad,提升,fp16
From: https://www.cnblogs.com/carolsun/p/16955217.html