-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the scale enum flag in Embedding layer for LLM embedding. (#…
…909) The activation component should roughly have a magnitude of 1. Since the embedding tensor is initialized with a scale of `1/sqrt(dim)`, the activation is multiplied by `sqrt(dim)` to maintain the desired scale. e.g. Gemma [1] [1] https://github.com/google-deepmind/gemma/blob/0d6ae857591248422127ca14c027909546362e6a/gemma/modules.py#L80 In addition, unsloth [2] discovered that `sqrt(dim)` needs to be computed in float32. [2] Sec 3 in https://unsloth.ai/blog/gemma-bugs TODO(axlearn-team): Use UNIT scale enum for AFM+. This will require re-sweeping hyperparameters (e.g., learning rate).
- Loading branch information
Showing
3 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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