mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-10 13:30:19 +00:00
[unittest] supported condititonal testing based on env var (#1701)
polish code
This commit is contained in:
@@ -193,11 +193,12 @@ def skip_if_not_enough_gpus(min_gpus: int):
|
||||
"""
|
||||
|
||||
def _wrap_func(f):
|
||||
|
||||
def _execute_by_gpu_num(*args, **kwargs):
|
||||
num_avail_gpu = torch.cuda.device_count()
|
||||
if num_avail_gpu >= min_gpus:
|
||||
f(*args, **kwargs)
|
||||
|
||||
return _execute_by_gpu_num
|
||||
|
||||
return _wrap_func
|
||||
|
||||
|
Reference in New Issue
Block a user