Skip to content
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

Magic number in SADelARTransformer #114

Open
Subuday opened this issue Mar 4, 2024 · 1 comment
Open

Magic number in SADelARTransformer #114

Subuday opened this issue Mar 4, 2024 · 1 comment

Comments

@Subuday
Copy link

Subuday commented Mar 4, 2024

Could you provide insists please about 8 in this line of code:
qk_scale = self.tunables.query_mult * 8 / math.sqrt(head_width)

@jpc
Copy link
Contributor

jpc commented Mar 4, 2024

Hey, good question :)

The 8 is sqrt(64) which is the default head_width (so by default, the whole expression is going to be query_mult * 1). Similar to the 3 in the base_width calculation.

The "maximum update parametrization" from the Tensor Program V paper requires us to assume some "base" widths which we can use to determine if we need to adjust the learning rate, initialization stddev, etc. The choice is completely arbitrary since only thing that matters is the ratio between this base width and the lr/init_stddev hyperparameters (which we tune in the end).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants