diff --git a/training/benchmarks/efficientnet/pytorch/train/trainer_adapter.py b/training/benchmarks/efficientnet/pytorch/train/trainer_adapter.py index 2b4bc8f72..5fe3fd09d 100644 --- a/training/benchmarks/efficientnet/pytorch/train/trainer_adapter.py +++ b/training/benchmarks/efficientnet/pytorch/train/trainer_adapter.py @@ -10,6 +10,9 @@ def convert_model(args, model: nn.Module) -> nn.Module: + if args.vendor == 'kunlunxin': + # not support yet + return model if utils.is_dist_avail_and_initialized() and args.sync_bn: model = torch.nn.SyncBatchNorm.convert_sync_batchnorm(model) return model @@ -62,6 +65,9 @@ def create_optimizer(args, model): def model_to_fp16(args, model): + if args.vendor == 'kunlunxin': + # not support yet + return model # To prevent OOM for model sizes that cannot fit in GPU memory in full precision if args.fp16: main_proc_print(" > use fp16...") @@ -76,6 +82,9 @@ def model_to_ddp(args, model: nn.Module) -> nn.Module: def create_grad_scaler(args): + if args.vendor == 'kunlunxin': + # not support yet + return None scaler = torch.cuda.amp.GradScaler() if args.amp else None return scaler diff --git a/training/kunlunxin/efficientnet-pytorch/extern/.gitkeep b/training/kunlunxin/efficientnet-pytorch/extern/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/training/kunlunxin/efficientnet-pytorch/extern/trainer_adapter.py b/training/kunlunxin/efficientnet-pytorch/extern/trainer_adapter.py deleted file mode 100644 index 289953195..000000000 --- a/training/kunlunxin/efficientnet-pytorch/extern/trainer_adapter.py +++ /dev/null @@ -1,13 +0,0 @@ -from torch import nn - - -def convert_model(args, model: nn.Module) -> nn.Module: - return model - - -def model_to_fp16(args, model): - return model - - -def create_grad_scaler(args): - return None