@@ -115,16 +115,22 @@ def config_manager(cls, config_source: Optional[str] = None, use_onnx_subfunctio
115115 cls .custom_config ["modules" ][module_name ]["compilation" ]["use_onnx_subfunctions" ] = use_onnx_subfunctions
116116
117117
118- def set_module_device_ids (cls ):
118+ def set_execute_params (cls ):
119119 """
120- Set device IDs for each module based on the custom configuration.
120+ Set device IDs, qpc_paths for each module based on the custom configuration.
121121
122- Iterates through all modules in the pipeline and assigns device IDs
123- from the configuration file to each module's device_ids attribute.
122+ Iterates through all modules in the pipeline and assigns device IDs, qpc_paths
123+ from the configuration file to each module's attribute.
124124 """
125125 config_modules = cls .custom_config ["modules" ]
126126 for module_name , module_obj in cls .modules .items ():
127127 module_obj .device_ids = config_modules [module_name ]["execute" ]["device_ids" ]
128+ module_obj .qpc_path = config_modules [module_name ]["execute" ]["qpc_path" ]
129+ if module_obj .qpc_path :
130+ if not os .path .exists (module_obj .qpc_path ):
131+ raise FileNotFoundError (
132+ f"Given qpc path: { module_obj .qpc_path } does not exist. Please provide correct path or keep null"
133+ )
128134
129135
130136def compile_modules_parallel (
@@ -158,8 +164,10 @@ def _prepare_and_compile(module_name: str, module_obj: Any) -> None:
158164 specializations = [specializations ]
159165 else :
160166 specializations = [specializations ]
161- # Compile with prepared specializations
162- module_obj .compile (specializations = specializations , ** compile_kwargs )
167+
168+ if module_obj .qpc_path is None :
169+ # Compile with prepared specializations
170+ module_obj .compile (specializations = specializations , ** compile_kwargs )
163171
164172 # Execute compilations in parallel
165173 with ThreadPoolExecutor (max_workers = len (modules )) as executor :
@@ -209,8 +217,10 @@ def compile_modules_sequential(
209217 specializations = [specializations ]
210218 else :
211219 specializations = [specializations ]
212- # Compile with prepared specializations
213- module_obj .compile (specializations = specializations , ** compile_kwargs )
220+
221+ if module_obj .qpc_path is None :
222+ # Compile with prepared specializations
223+ module_obj .compile (specializations = specializations , ** compile_kwargs )
214224
215225
216226@dataclass (frozen = True )
0 commit comments