[Refactor][Diffusion] Make NPUWorker inherit GPUWorker (#483)

Signed-off-by: gcanlin <canlinguosdu@gmail.com>
This commit is contained in:
Canlin Guo authored and GitHub committed 2025-12-26 12:54:03 +08:00
1 parent a500ca1f28
commit 4f1c34099a
2 files changed
+56 -164

No files matched your search

+7 -4
View File
@@ -168,14 +168,17 @@ class WorkerProc:
logger.info(f"Worker {gpu_id} created result MessageQueue")
assert od_config.master_port is not None
worker = GPUWorker(
self.worker = self._create_worker(gpu_id, od_config)
self.gpu_id = gpu_id
self._running = True
def _create_worker(self, gpu_id: int, od_config: OmniDiffusionConfig) -> GPUWorker:
"""Create a worker instance. Override in subclasses for different worker types."""
return GPUWorker(
local_rank=gpu_id,
rank=gpu_id,
od_config=od_config,
)
self.worker = worker
self.gpu_id = gpu_id
self._running = True
def return_result(self, output: DiffusionOutput):
"""