-
Notifications
You must be signed in to change notification settings - Fork 633
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
[hotfix] doubled bias in FusedMLP #317
Conversation
a188d5c
to
e21c7ab
Compare
Perf numbers without the doubled bias: --- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
--- Type: torch.float16 ---
--- Type: torch.float32 ---
If/when I get the time to revisit the fused linear this could probably be improved |
@@ -46,16 +46,26 @@ def __init__( | |||
dim_mlp = hidden_layer_multiplier * dim_model | |||
|
|||
self.mlp = nn.Sequential( | |||
nn.Linear(in_features=dim_model, out_features=dim_mlp, bias=bias), | |||
nn.Linear( | |||
in_features=dim_model, out_features=dim_mlp, bias=False |
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 gist of it, this was a typo, the bias is handled in the next layer already
insta-land @danthe3rd / @fmassa / @dianaml0 , I hope that's ok, semi-obvious typo |
@@ -88,7 +88,7 @@ def mlp_fused(): | |||
), | |||
]: | |||
time = triton.testing.do_bench(testcase.function)[0] | |||
key = f"B={B}, M={M}, K={K}, HLM={hlm}" |
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.
minor presentation changes
@@ -19,8 +19,8 @@ | |||
(8, 512, 1024), | |||
(4, 1024, 1024), | |||
(2, 2048, 2048), | |||
(1, 2048, 12288), | |||
(2, 4096, 4096), | |||
(1, 2048, 4096), |
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.
trying to make this fit on a smaller GPU
What does this PR do?
Fixes the FusedMLP block having twice the bias layers, found randomly when working on the weight inits (#312)
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.