fix(minimax-h3): align Ref2AV output - #1490
Open
Watebear wants to merge 15 commits into
Open
Conversation
Watebear
force-pushed
the
fix_h3_ref
branch
2 times, most recently
from
September 9, 2026 14:35
670934c to
dd7205b
Compare
Watebear
commented
Sep 9, 2026
Collaborator
Author
There was a problem hiding this comment.
这里应该是sparse和packed之后的计算不兼容,所以临时用for循环来替代了。效率肯定低。spare先这样么?
Watebear
commented
Sep 9, 2026
Watebear
commented
Sep 9, 2026
Watebear
commented
Sep 9, 2026
Collaborator
Author
There was a problem hiding this comment.
tp通信的fp32,不能用 sensetive layer
Watebear
commented
Sep 9, 2026
Watebear
commented
Sep 9, 2026
|
|
||
|
|
||
| @torch.jit.script | ||
| def _snakebeta(hidden_states: torch.Tensor, alpha: torch.Tensor, beta: torch.Tensor) -> torch.Tensor: |
Collaborator
Author
There was a problem hiding this comment.
这是个优化点,对一个多次调用的激活,做了compile的优化
Watebear
commented
Sep 9, 2026
| self.proj = nn.Linear(config["hidden_size"], config["hidden_size"], bias=True) | ||
|
|
||
| def shard_for_tensor_parallel(self): | ||
| if self.tp_size == 1: |
Watebear
commented
Sep 9, 2026
|
|
||
|
|
||
| @ROPE_REGISTER("h3_sgl_rope") | ||
| class MiniMaxH3SGLRope(RopeTemplate): |
Watebear
commented
Sep 9, 2026
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.