Skip to content

fix(minimax-h3): align Ref2AV output - #1490

Open
Watebear wants to merge 15 commits into
mainfrom
fix_h3_ref
Open

fix(minimax-h3): align Ref2AV output #1490
Watebear wants to merge 15 commits into
mainfrom
fix_h3_ref

Conversation

@Watebear

@Watebear Watebear commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@Watebear Watebear changed the title feat(minimax-h3): align Ref2AV output with SGLang fix(minimax-h3): align Ref2AV output with SGLang Sep 6, 2026
@Watebear
Watebear force-pushed the fix_h3_ref branch 2 times, most recently from 670934c to dd7205b Compare September 9, 2026 14:35

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是sparse和packed之后的计算不兼容,所以临时用for循环来替代了。效率肯定低。spare先这样么?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也是for循环做的兼容

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for 循环兼容

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tp通信的fp32,不能用 sensetive layer

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

计算模式对齐



@torch.jit.script
def _snakebeta(hidden_states: torch.Tensor, alpha: torch.Tensor, beta: torch.Tensor) -> torch.Tensor:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是个优化点,对一个多次调用的激活,做了compile的优化

self.proj = nn.Linear(config["hidden_size"], config["hidden_size"], bias=True)

def shard_for_tensor_parallel(self):
if self.tp_size == 1:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配合fp32 tp通信

Comment thread lightx2v/common/ops/rope/h3_sgl_rope.py Outdated


@ROPE_REGISTER("h3_sgl_rope")
class MiniMaxH3SGLRope(RopeTemplate):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看能否通用

sigma_from_timestep = 1.0 - timestep.to(device=sample.device, dtype=sample.dtype)
ratio = sigma_next / sigma
return ratio * sample.float() + (1.0 - ratio) * denoised.float()
state = sample.float()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看输出差异

@Watebear Watebear changed the title fix(minimax-h3): align Ref2AV output with SGLang fix(minimax-h3): align Ref2AV output Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant