[Bugfix][ROCm] Alias SparseAttnIndexerKpool.forward_cuda to forward_native (GLM-5.3-Flash boot crash) (#57425)
Signed-off-by: Mustafa YILDIRIM <mustafa@character.ai> Co-authored-by: Hermes Agent <hermes@nousresearch.com> Co-authored-by: Tyler Michael Smith <tlrmchlsmth@gmail.com>
This commit is contained in:
co-authored by
Hermes Agent
Tyler Michael Smith
parent
bf13ecc2f7
commit
d12c276853
@@ -665,7 +665,7 @@ class SparseAttnIndexerKpool(CustomOp):
|
|||||||
self.skip_k_cache_insert = skip_k_cache_insert
|
self.skip_k_cache_insert = skip_k_cache_insert
|
||||||
self.use_fp4_cache = use_fp4_cache
|
self.use_fp4_cache = use_fp4_cache
|
||||||
|
|
||||||
def forward_native(
|
def forward_hip(
|
||||||
self,
|
self,
|
||||||
hidden_states: torch.Tensor,
|
hidden_states: torch.Tensor,
|
||||||
q_quant: torch.Tensor | tuple[torch.Tensor, torch.Tensor],
|
q_quant: torch.Tensor | tuple[torch.Tensor, torch.Tensor],
|
||||||
@@ -727,3 +727,26 @@ class SparseAttnIndexerKpool(CustomOp):
|
|||||||
self.tail_cache.kv_cache if self.tail_cache is not None else None,
|
self.tail_cache.kv_cache if self.tail_cache is not None else None,
|
||||||
self.tail_cache.prefix if self.tail_cache is not None else None,
|
self.tail_cache.prefix if self.tail_cache is not None else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def forward_native(
|
||||||
|
self,
|
||||||
|
hidden_states: torch.Tensor,
|
||||||
|
q_quant: torch.Tensor | tuple[torch.Tensor, torch.Tensor],
|
||||||
|
k: torch.Tensor,
|
||||||
|
weights: torch.Tensor,
|
||||||
|
*,
|
||||||
|
gate_score: torch.Tensor | None = None,
|
||||||
|
compress_ape: torch.Tensor | None = None,
|
||||||
|
index_kpool: int = 1,
|
||||||
|
positions: torch.Tensor | None = None,
|
||||||
|
) -> torch.Tensor:
|
||||||
|
return self.forward_hip(
|
||||||
|
hidden_states,
|
||||||
|
q_quant,
|
||||||
|
k,
|
||||||
|
weights,
|
||||||
|
gate_score=gate_score,
|
||||||
|
compress_ape=compress_ape,
|
||||||
|
index_kpool=index_kpool,
|
||||||
|
positions=positions,
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user