From 5fa9e9f8d4d191f1f1b8e5f2d21267971c658703 Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Mon, 15 Apr 2024 11:00:25 +0800 Subject: [PATCH] fix --- src/onediff/infer_compiler/backends/nexfort.py | 2 +- src/onediff/infer_compiler/core/with_onediff_compile.py | 2 +- src/onediff/infer_compiler/nexfort/deployable_module.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/onediff/infer_compiler/backends/nexfort.py b/src/onediff/infer_compiler/backends/nexfort.py index 9d702aaf1..67cca8cbc 100644 --- a/src/onediff/infer_compiler/backends/nexfort.py +++ b/src/onediff/infer_compiler/backends/nexfort.py @@ -1,7 +1,6 @@ import dataclasses import torch from .registry import register_backend -from ..options import CompileOptions def make_inductor_options(options): @@ -19,6 +18,7 @@ def compile(torch_module: torch.nn.Module, *, options=None): from nexfort.utils.memory_format import apply_memory_format from nexfort.compilers import nexfort_compile from ..nexfort.deployable_module import NexfortDeployableModule + from ..utils import CompileOptions options = options if options is not None else CompileOptions() nexfort_options = options.nexfort diff --git a/src/onediff/infer_compiler/core/with_onediff_compile.py b/src/onediff/infer_compiler/core/with_onediff_compile.py index 6ebc080e6..c2ec0568b 100644 --- a/src/onediff/infer_compiler/core/with_onediff_compile.py +++ b/src/onediff/infer_compiler/core/with_onediff_compile.py @@ -5,7 +5,7 @@ def compile( torch_module: torch.nn.Module, *, backend="nexfort", options=None ) -> DeployableModule: - from .backends.registry import lookup_backend + from ..backends.registry import lookup_backend backend = lookup_backend(backend) model = backend(torch_module, options=options) diff --git a/src/onediff/infer_compiler/nexfort/deployable_module.py b/src/onediff/infer_compiler/nexfort/deployable_module.py index 421b2d8bc..eb8a91be2 100644 --- a/src/onediff/infer_compiler/nexfort/deployable_module.py +++ b/src/onediff/infer_compiler/nexfort/deployable_module.py @@ -1,5 +1,5 @@ import torch -from ..deployable_module import DeployableModule +from ..core.deployable_module import DeployableModule class NexfortDeployableModule(DeployableModule):