Skip to content

Conversation

@bzgoogle
Copy link
Collaborator

@bzgoogle bzgoogle commented Aug 20, 2025

Description

fix scaling factor for DeepSeek
We should use yarn based scaling factor for attention score

Tests

tested with offline benchmarking with reasonable accuracy: https://paste.googleplex.com/4921594585284608

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

Signed-off-by: bzgoogle <beinuoz@google.com>
@github-actions
Copy link

github-actions bot commented Aug 20, 2025

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

@bzgoogle bzgoogle requested a review from jrplatin August 20, 2025 17:28
@bzgoogle bzgoogle marked this pull request as ready for review August 20, 2025 17:29
P(), # distribution: Replicated
)
out_specs = (self.attn_o_tnh.spec, P())
if self.rope_scaling["factor"] <= 1.0:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these constants? Does rope_scaling["factor"] ever change? If not, can we move this logic out to the __init__ so we don't waste compute on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Moved to post__init

Signed-off-by: bzgoogle <beinuoz@google.com>
@bzgoogle bzgoogle merged commit 88002ec into main Aug 21, 2025
2 checks passed
Lumosis pushed a commit that referenced this pull request Aug 26, 2025
Signed-off-by: bzgoogle <beinuoz@google.com>
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.

3 participants