From 049dedf2f7db6fd83fdc83443afc53ec7b19b304 Mon Sep 17 00:00:00 2001 From: Masonmason Date: Wed, 16 Jul 2025 22:11:42 +0800 Subject: [PATCH] Fix firmware path initialization and upload logic in MultiDongle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Always store firmware paths (scpu_fw_path, ncpu_fw_path) when provided, not just when upload_fw=True - Restore firmware upload condition to only run when upload_fw=True - Fix 'MultiDongle' object has no attribute 'scpu_fw_path' error during pipeline initialization - Ensure firmware paths are available for both upload and non-upload scenarios This resolves the pipeline deployment error where firmware paths were missing even when provided to the constructor, causing initialization failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cluster4npu_ui/core/functions/Multidongle.py | 28 +++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cluster4npu_ui/core/functions/Multidongle.py b/cluster4npu_ui/core/functions/Multidongle.py index e165806..0928dfe 100644 --- a/cluster4npu_ui/core/functions/Multidongle.py +++ b/cluster4npu_ui/core/functions/Multidongle.py @@ -286,11 +286,9 @@ class MultiDongle: self.upload_fw = upload_fw - # Check if the firmware is needed - if self.upload_fw: - self.scpu_fw_path = scpu_fw_path - self.ncpu_fw_path = ncpu_fw_path - + # Always store firmware paths when provided + self.scpu_fw_path = scpu_fw_path + self.ncpu_fw_path = ncpu_fw_path self.model_path = model_path self.device_group = None @@ -332,16 +330,16 @@ class MultiDongle: # kp.core.set_timeout(device_group=self.device_group, milliseconds=5000) # print(' - Success') - # if self.upload_fw: - try: - print('[Upload Firmware]') - kp.core.load_firmware_from_file(device_group=self.device_group, - scpu_fw_path=self.scpu_fw_path, - ncpu_fw_path=self.ncpu_fw_path) - print(' - Success') - except kp.ApiKPException as exception: - print('Error: upload firmware failed, error = \'{}\''.format(str(exception))) - sys.exit(1) + if self.upload_fw: + try: + print('[Upload Firmware]') + kp.core.load_firmware_from_file(device_group=self.device_group, + scpu_fw_path=self.scpu_fw_path, + ncpu_fw_path=self.ncpu_fw_path) + print(' - Success') + except kp.ApiKPException as exception: + print('Error: upload firmware failed, error = \'{}\''.format(str(exception))) + sys.exit(1) # upload model to device try: