[Diffusion][Bug-Fix]: Fix Ulysses SP Accurary Error (#377)
Signed-off-by: Didan Deng <33117903+wtomin@users.noreply.github.com> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: Jiangyun Zhu <riverclouds.zhu@qq.com>
This commit is contained in:
1 parent
b06a5148f6
commit
ee2b78e826
12 files changed
+747
-199
No files matched your search
@@ -48,6 +48,14 @@ class AttentionBackend(ABC):
|
||||
@dataclass
|
||||
class AttentionMetadata:
|
||||
attn_mask: torch.Tensor | None = None
|
||||
joint_query: torch.Tensor | None = None
|
||||
# a replicated tensor among processes appended to the front or rear of query, depends the joint_strategy
|
||||
joint_key: torch.Tensor | None = None
|
||||
# a replicated tensor among processes appended to the front or rear of key, depends the joint_strategy
|
||||
joint_value: torch.Tensor | None = None
|
||||
# a replicated tensor among processes appended to the front or rear of value, depends the joint_strategy
|
||||
joint_strategy: str = "front"
|
||||
# the strategy to joint the query, key, and value, can be "front" or "rear"
|
||||
|
||||
|
||||
T = TypeVar("T", bound=AttentionMetadata)
|
||||
|
||||
Reference in new issue
Block a user