[testing] add beit model for unit testings (#2196)

* [testing] add beit model

* [beit] fix bugs

* [beit] fix bugs

* [testing] fix bugs
This commit is contained in:
HELSON
2022-12-26 17:35:36 +08:00
committed by GitHub
parent 5682e6d346
commit a3100bd50d
5 changed files with 58 additions and 7 deletions

View File

@@ -1,11 +1,13 @@
import os
import random
import numpy as np
import torch
import torch.distributed as dist
from colossalai.core import global_context as gpc
from colossalai.context import ParallelMode
from colossalai.tensor import ShardSpec, ComputeSpec, ComputePattern
from colossalai.core import global_context as gpc
from colossalai.tensor import ComputePattern, ComputeSpec, ShardSpec
def set_seed(seed):
@@ -15,6 +17,7 @@ def set_seed(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
def check_equal(A, B):