Skip to content

Commit 6021315

Browse files
authored
[Frontend] prevent reload device
1 parent 8b0f535 commit 6021315

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Scheduler/scheduler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def __init__(self, tog_simulator : TOGSimulator, num_partion=1) -> None:
163163

164164
@staticmethod
165165
def setup_device():
166+
if cls._npu_module is not None:
167+
return cls._npu_module
166168
source_file_path = os.path.dirname(os.path.abspath(__file__))
167169
source_file = os.path.join(
168170
source_file_path, f"{extension_config.CONFIG_TORCHSIM_DIR}/PyTorchSimFrontend/extension_device.cpp"
@@ -201,6 +203,7 @@ def setup_device():
201203
get_wrapper_codegen_for_device("npu")
202204
== ExtensionWrapperCodegen
203205
)
206+
cls._npu_module = module
204207
return module
205208

206209
def submit(self, batched_req, partition_idx) -> List[RequestReturn]:

0 commit comments

Comments
 (0)