CRZbulabula commented on code in PR #19272:
URL: https://github.com/apache/iotdb/pull/19272#discussion_r4581849622


##########
iotdb-core/ainode/iotdb/ainode/core/inference/pool_controller.py:
##########
@@ -201,6 +201,15 @@ def _worker_loop(self):
                 self._task_queue.task_done()
 
     def _load_one_model_task(self, model_id: str, device_id_list: 
list[torch.device]):
+        model_info = self._model_manager.get_model_info(model_id)
+        if not model_info.download_on_start:
+            # Built-in models that are not downloaded at start are downloaded 
when loaded
+            if not self._model_manager.download_builtin_model(model_id):

Review Comment:
   The download now leaves unrelated controller operations and shutdown 
unblocked. One ordering gap remains through the public API: 
`InferenceManager.unload_model()` only forwards devices with an existing 
request pool. While Timestral is downloading, no pool exists, so `UNLOAD MODEL 
timestral FROM DEVICES 'cpu'` returns success without reaching 
`_tasks_waiting_for_download`; the model is then loaded when the download 
completes.
   
   I reproduced this using the event-controlled download and the real manager 
methods: the unload returned status 200, there were zero deferred tasks, and 
completion produced only a load event. Please make pending loads visible to 
unload handling, or otherwise forward the unload for ordering, and cover LOAD → 
UNLOAD through `InferenceManager` or the RPC handler. The current regression 
calls the controller directly and misses this path.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to