[XPU][Bugfix] Make AR-Diffusion KV preallocation device-agnostic (#7777)
Signed-off-by: Joshna Medisetty <joshna.medisetty@intel.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fbb4e63f0a
commit
ca3ccfc9a3
2 files changed
+7
-7
No files matched your search
@@ -93,9 +93,9 @@ class ARDiffusionModelRunner(DiffusionModelRunner):
|
||||
self._warmup_ar_rollout()
|
||||
|
||||
def _available_memory_bytes(self) -> int:
|
||||
if self.device is None or torch.device(self.device).type != "cuda":
|
||||
raise RuntimeError("AR-Diffusion KV preallocation currently requires a CUDA device")
|
||||
return int(torch.cuda.mem_get_info(self.device)[0])
|
||||
if self.device is None:
|
||||
raise RuntimeError("AR-Diffusion KV preallocation requires an initialized device")
|
||||
return current_omni_platform.get_free_memory(torch.device(self.device))
|
||||
|
||||
def _preallocate_kv_cache(self, *, available_bytes: int | None = None) -> None:
|
||||
"""Build pools solely from the pipeline capability and runner config."""
|
||||
|
||||
Reference in new issue
Block a user