-
Notifications
You must be signed in to change notification settings - Fork 51
More Rope Scaling Implementations (PI, Yarn) #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks so much for standardizing this! were you also going to add a way to turn on/off sliding-window-layer scaling? this seems more important now that it seems like some of our sliding window scaling runs actually outperform global-only scaling
""" | ||
|
||
def __post_init__(self): | ||
if self.attention_rescale_factor < 1.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to restrict attention rescaling factor to be >1?
|
||
|
||
@dataclass | ||
class PerFrequencyRoPEScalingConfig(RoPEScalingConfig): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, but the name suggests to me that you get more finegrained control than high/low...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good point, I'll switch to calling it stepwise
Denominator that determines the *high-frequency* wavelength cut-off | ||
(a smaller value keeps more of the very short wavelengths untouched). | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice if these params used the same name / interpretation as the YaRN params that control the same thing... minimally, I'd vote for calling them something other than factor because we also have factor
above that does a different thing
(I know these names are probably holdovers from the methods, though-- if this is how huggingface does the two methods then maybe it's better to be consistent with them rather than internally consistent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way you preserve backwards compatibility here is by having the base class do basic RoPE extension like the RoPE paper says, and have subclasses that do the fancier stuff?
|
Implements