mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-03 00:47:09 +08:00
Solve the error "RuntimeError: BinaryCall MUDNN failed in: Run PowTensorOut" of the flux KSampler.
This commit is contained in:
parent
d22feacb05
commit
b06b4f67cd
@ -27,7 +27,12 @@ def rope(pos: Tensor, dim: int, theta: int) -> Tensor:
|
|||||||
device = torch.device("cpu")
|
device = torch.device("cpu")
|
||||||
else:
|
else:
|
||||||
device = pos.device
|
device = pos.device
|
||||||
|
if device.type == "musa":
|
||||||
|
scale = torch.linspace(0, (dim - 2) / dim, steps=dim // 2, dtype=torch.float32, device=device)
|
||||||
|
if not isinstance(theta, torch.Tensor):
|
||||||
|
theta = torch.tensor(theta, dtype=torch.float32, device=device)
|
||||||
|
omega = torch.exp(-scale * torch.log(theta + 1e-6))
|
||||||
|
else:
|
||||||
scale = torch.linspace(0, (dim - 2) / dim, steps=dim//2, dtype=torch.float64, device=device)
|
scale = torch.linspace(0, (dim - 2) / dim, steps=dim//2, dtype=torch.float64, device=device)
|
||||||
omega = 1.0 / (theta**scale)
|
omega = 1.0 / (theta**scale)
|
||||||
out = torch.einsum("...n,d->...nd", pos.to(dtype=torch.float32, device=device), omega)
|
out = torch.einsum("...n,d->...nd", pos.to(dtype=torch.float32, device=device), omega)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user