mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-04 18:40:28 +00:00
[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:
@@ -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):
|
||||
|
Reference in New Issue
Block a user