Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
flash-attention
Commits
85b8e3d3
Commit
85b8e3d3
authored
Dec 29, 2022
by
Tri Dao
Browse files
[Docs] Mention that XPos's scale_base is recommended to be 512
parent
984d5204
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
flash_attn/layers/rotary.py
flash_attn/layers/rotary.py
+3
-2
No files found.
flash_attn/layers/rotary.py
View file @
85b8e3d3
...
@@ -135,12 +135,13 @@ class RotaryEmbedding(torch.nn.Module):
...
@@ -135,12 +135,13 @@ class RotaryEmbedding(torch.nn.Module):
.. _repo: https://github.com/ZhuiyiTechnology/roformer
.. _repo: https://github.com/ZhuiyiTechnology/roformer
.. _GPT-NeoX: https://github.com/EleutherAI/gpt-neox
.. _GPT-NeoX: https://github.com/EleutherAI/gpt-neox
If scale_base > 0, this implements XPos (Sun et al., https://arxiv.org/abs/2212.10554).
A recommended value for scale_base is 512: https://github.com/HazyResearch/flash-attention/issues/96
Reference: https://github.com/sunyt32/torchscale/blob/main/torchscale/component/xpos_relative_position.py
"""
"""
def
__init__
(
self
,
dim
:
int
,
base
=
10000
,
scale_base
=
0
,
device
=
None
):
def
__init__
(
self
,
dim
:
int
,
base
=
10000
,
scale_base
=
0
,
device
=
None
):
"""
"""
If scale_base > 0, this implements XPos (Sun et al., https://arxiv.org/abs/2212.10554).
Reference: https://github.com/sunyt32/torchscale/blob/main/torchscale/component/xpos_relative_position.py
"""
"""
super
().
__init__
()
super
().
__init__
()
# Generate and save the inverse frequency buffer (non trainable)
# Generate and save the inverse frequency buffer (non trainable)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment