-
Notifications
You must be signed in to change notification settings - Fork 788
Single grouped weight fixes #3225
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
Changes from 3 commits
019738d
ab4d7e8
b4f2be1
f21e4bc
19b6b2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -1004,7 +1004,13 @@ def fuser_forward( | |||
| "FC1 expected GroupedTensor weight with single_grouped_weight=True." | ||||
| ) | ||||
| if fc1_op.weight.quantizer is not None: | ||||
| fc1_weight_quantizer.set_usage(rowwise=True, columnwise=input_requires_grad) | ||||
| # Full-iteration CUDA graph replay does not rerun this Python metadata | ||||
| # update. Remember that a grad-enabled forward requested columnwise | ||||
| # storage so eager eval cannot drop buffers still used by captured dgrad. | ||||
| fc1_weight_quantizer.set_usage( | ||||
| rowwise=True, | ||||
| columnwise=input_requires_grad or fc1_weight_quantizer.columnwise_usage, | ||||
| ) | ||||
| fc1_op.weight.quantizer = fc1_weight_quantizer | ||||
| grouped_fc1_weight = fc1_op.weight | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The op and the param purposely have different quantizers so that you can change them independently. However, we are incorrectly reusing the same quantizer in two places, and getting unexpected interactions. The op's quantizer is set in each forward pass:
The proper fix is keep the op and param quantizers distinct. |
||||
| else: | ||||
|
|
@@ -1038,7 +1044,10 @@ def fuser_forward( | |||
| "FC2 expected GroupedTensor weight with single_grouped_weight=True." | ||||
| ) | ||||
| if fc2_op.weight.quantizer is not None: | ||||
| fc2_weight_quantizer.set_usage(rowwise=True, columnwise=input_requires_grad) | ||||
| fc2_weight_quantizer.set_usage( | ||||
| rowwise=True, | ||||
| columnwise=input_requires_grad or fc2_weight_quantizer.columnwise_usage, | ||||
| ) | ||||
| fc2_op.weight.quantizer = fc2_weight_quantizer | ||||
|
timmoon10 marked this conversation as resolved.
Outdated
|
||||
| grouped_fc2_weight = fc2_op.weight | ||||
| else: | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.