[Perf] Qwen3-Omni performance optimization (#3878)
Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
8c4a42b16c
commit
2696751003
2 files changed
+16
-4
No files matched your search
@@ -1765,7 +1765,12 @@ class OmniGPUModelRunner(GPUModelRunner):
|
||||
if key in gpu_keys:
|
||||
dest[key] = value.detach().clone()
|
||||
else:
|
||||
dest[key] = value.detach().to("cpu").contiguous()
|
||||
t = value.detach()
|
||||
if t.is_cuda:
|
||||
dest[key] = t.to("cpu").contiguous()
|
||||
else:
|
||||
# If the tensor is already on the CPU, there is no need to unload it to the CPU.
|
||||
dest[key] = t.contiguous()
|
||||
elif isinstance(value, list):
|
||||
dest[key] = [
|
||||
(item.detach().to("cpu").contiguous() if isinstance(item, torch.Tensor) else item) for item in value
|
||||
|
||||
Reference in new issue
Block a user