From 2180b23e2b9e4dff2314993f6f7e211703598b08 Mon Sep 17 00:00:00 2001 From: zjuxym Date: Wed, 3 Sep 2025 13:05:29 +0800 Subject: [PATCH 1/2] patcher_update --- model_examples/FCOS3D/mmdet3d.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model_examples/FCOS3D/mmdet3d.patch b/model_examples/FCOS3D/mmdet3d.patch index 5a4185fc..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 @@ -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 c367a878fd14b3bb47ce2fdcc4d974d25af340e7 Mon Sep 17 00:00:00 2001 From: zjuxym Date: Wed, 3 Sep 2025 14:41:23 +0800 Subject: [PATCH 2/2] patcher_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 488583a4..3d48c345 100644 --- a/model_examples/FCOS3D/mmdet3d.patch +++ b/model_examples/FCOS3D/mmdet3d.patch @@ -207,7 +207,7 @@ index 6b9c3b08..00964fcc 100644 +import torch +import torch_npu +from torch_npu.contrib import transfer_to_npu -+from mx_driving.patcher.patcher import PatcherBuilder, Patch ++from mx_driving.patcher import PatcherBuilder, Patch +from mx_driving.patcher import dc, mdc + +torch.npu.config.allow_internal_format = False @@ -259,7 +259,7 @@ index 00000000..627045a6 +import os.path as osp +import torch +import torch_npu -+from mx_driving.patcher.patcher import PatcherBuilder, Patch ++from mx_driving.patcher import PatcherBuilder, Patch +from mx_driving.patcher import dc, mdc + +from mmengine.config import Config, DictAction -- Gitee