@@ -140,7 +140,7 @@ def __str__(self):
140140 def register_model (model_name : str , compiled_model ):
141141 SchedulerDNNModel .MODEL_MAP [model_name ] = compiled_model
142142
143- class PyTorchSimExecutionEngine :
143+ class PyTorchSimRunner :
144144 PARTITION_BUSY = 0
145145 PARTITION_IDLE = 1
146146 SELECT_NOTHING = 2
@@ -262,7 +262,7 @@ def launch_kernel(self, current_cycle, partion_idx=0):
262262 self .partition_state [partion_idx ] = self .PARTITION_BUSY
263263 return self .backend_simulator .launch (onnx_path , attribute_path , current_cycle , partion_idx )
264264
265- class FIFOExecutionEngine ( PyTorchSimExecutionEngine ):
265+ class FIFORunner ( PyTorchSimRunner ):
266266 def __init__ (self , backend_simulator : BackendSimulator , num_partion = 1 ) -> None :
267267 super ().__init__ (backend_simulator , num_partion )
268268
@@ -297,7 +297,7 @@ def select_kernel(self, partition_idx):
297297 # No proper kernel now
298298 return self .SELECT_NOTHING
299299
300- class RRExecutionEngine ( PyTorchSimExecutionEngine ):
300+ class RoundRobinRunner ( PyTorchSimRunner ):
301301 def __init__ (self , backend_simulator : BackendSimulator , num_partion = 1 ) -> None :
302302 super ().__init__ (backend_simulator , num_partion )
303303 self .next_pointer = None
@@ -360,9 +360,9 @@ def __init__(self, num_request_queue=1, max_batch=1, engine_select=FIFO_ENGINE,
360360 self .backend_simulator = BackendSimulator (backend_path , backend_config )
361361 self .backend_simulator .interactive_simulation ()
362362 if engine_select == Scheduler .FIFO_ENGINE :
363- self .execution_engine = FIFOExecutionEngine (self .backend_simulator , self .num_request_queue )
363+ self .execution_engine = FIFORunner (self .backend_simulator , self .num_request_queue )
364364 elif engine_select == Scheduler .RR_ENGINE :
365- self .execution_engine = RRExecutionEngine (self .backend_simulator , self .num_request_queue )
365+ self .execution_engine = RoundRobinRunner (self .backend_simulator , self .num_request_queue )
366366 else :
367367 print (f"Not supporetd engine type { engine_select } " )
368368 exit (1 )
@@ -480,7 +480,7 @@ def run(self, until_time):
480480 def execute_cycle ():
481481 launch_ret_info = []
482482 for i in range (self .execution_engine .num_partion ):
483- if self .execution_engine .partition_state [i ] == PyTorchSimExecutionEngine .PARTITION_IDLE :
483+ if self .execution_engine .partition_state [i ] == PyTorchSimRunner .PARTITION_IDLE :
484484 ret = self .execution_engine .launch_kernel (self .current_cycle , i )
485485 launch_ret_info .append (ret )
486486
@@ -495,7 +495,7 @@ def execute_cycle():
495495
496496 for core_idx in result_list :
497497 # Kernel is finished. So set idle state
498- self .execution_engine .partition_state [core_idx ] = PyTorchSimExecutionEngine .PARTITION_IDLE
498+ self .execution_engine .partition_state [core_idx ] = PyTorchSimRunner .PARTITION_IDLE
499499
500500 return result_list
501501
0 commit comments