Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions fastvideo/pipelines/stages/matrixgame2_denoising.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,8 @@ def _initialize_kv_cache(self, batch_size: int, dtype: torch.dtype, device: torc
torch.zeros([batch_size, kv_cache_size, num_attention_heads, attention_head_dim],
dtype=dtype,
device=device),
"global_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"local_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"global_end_index": 0,
"local_end_index": 0,
})

return kv_cache
Expand All @@ -302,10 +300,8 @@ def _initialize_action_kv_cache(self, batch_size: int, dtype: torch.dtype, devic
torch.zeros([batch_size, kv_cache_size, action_heads, keyboard_head_dim], dtype=dtype, device=device),
"v":
torch.zeros([batch_size, kv_cache_size, action_heads, keyboard_head_dim], dtype=dtype, device=device),
"global_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"local_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"global_end_index": 0,
"local_end_index": 0,
})
kv_cache_mouse.append({
"k":
Expand All @@ -316,10 +312,8 @@ def _initialize_action_kv_cache(self, batch_size: int, dtype: torch.dtype, devic
torch.zeros([batch_size * self.frame_seq_length, kv_cache_size, action_heads, mouse_head_dim],
dtype=dtype,
device=device),
"global_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"local_end_index":
torch.tensor([0], dtype=torch.long, device=device),
"global_end_index": 0,
"local_end_index": 0,
})

return kv_cache_mouse, kv_cache_keyboard
Expand Down
Loading