From 42de11e5659e87c7042f1944e0dc84166dad4de3 Mon Sep 17 00:00:00 2001 From: zjuxym Date: Wed, 3 Sep 2025 12:41:27 +0800 Subject: [PATCH 1/2] patch --- model_examples/FCOS3D/mmdet3d.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model_examples/FCOS3D/mmdet3d.patch b/model_examples/FCOS3D/mmdet3d.patch index 5a4185fc..2d724038 100644 --- a/model_examples/FCOS3D/mmdet3d.patch +++ b/model_examples/FCOS3D/mmdet3d.patch @@ -260,7 +260,7 @@ index 00000000..627045a6 +import torch +import torch_npu +from mx_driving.patcher.patcher import PatcherBuilder, Patch -+from mx_driving.patcher.mmcv import dc, mdc ++from mx_driving.patcher import dc, mdc + +from mmengine.config import Config, DictAction +from mmengine.logging import print_log @@ -403,6 +403,6 @@ index 00000000..627045a6 + + +if __name__ == '__main__': -+ pb = PatcherBuilder().add_module_patch("mmcv.ops", Patch(dc), Patch(mdc)).brake_at(1000) ++ pb = PatcherBuilder().add_module_patch("mmcv", Patch(dc), Patch(mdc)).brake_at(1000) + with pb.build(): + main() -- Gitee From 4b65c878cf8a94ba799c8d8dd6eb126046295c12 Mon Sep 17 00:00:00 2001 From: zjuxym Date: Wed, 3 Sep 2025 12:58:14 +0800 Subject: [PATCH 2/2] train_update --- model_examples/FCOS3D/mmdet3d.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model_examples/FCOS3D/mmdet3d.patch b/model_examples/FCOS3D/mmdet3d.patch index 2d724038..488583a4 100644 --- a/model_examples/FCOS3D/mmdet3d.patch +++ b/model_examples/FCOS3D/mmdet3d.patch @@ -208,7 +208,7 @@ index 6b9c3b08..00964fcc 100644 +import torch_npu +from torch_npu.contrib import transfer_to_npu +from mx_driving.patcher.patcher import PatcherBuilder, Patch -+from mx_driving.patcher.mmcv import dc, mdc ++from mx_driving.patcher import dc, mdc + +torch.npu.config.allow_internal_format = False +torch_npu.npu.set_compile_mode(jit_compile=False) @@ -243,7 +243,7 @@ index 6b9c3b08..00964fcc 100644 if __name__ == '__main__': - main() + seed_all(1024, is_gpu=False) # npu -+ pb = PatcherBuilder().add_module_patch("mmcv.ops", Patch(dc), Patch(mdc)) ++ pb = PatcherBuilder().add_module_patch("mmcv", Patch(dc), Patch(mdc)) + with pb.build(): + main() diff --git a/tools/train_performance.py b/tools/train_performance.py -- Gitee