Skip to content

fix: resolve TypeError in BlockMinifloatQuantize backward pass#302

Open
Shreyas8612 wants to merge 1 commit intoDeepWok:mainfrom
Shreyas8612:fix-block-minifloat
Open

fix: resolve TypeError in BlockMinifloatQuantize backward pass#302
Shreyas8612 wants to merge 1 commit intoDeepWok:mainfrom
Shreyas8612:fix-block-minifloat

Conversation

@Shreyas8612
Copy link

Description

This PR fixes a TypeError occurring during the backward pass of BlockMinifloatQuantize. The backward method was defined with additional positional arguments (width, exponent_width, etc.) that are not provided by the PyTorch autograd engine, leading to a signature mismatch.

Changes

  • Removed unused positional arguments from BlockMinifloatQuantize.backward.
  • Updated the return statement to match the expected number of gradients (returning None for the non-tensor inputs of the forward method).

Testing

Verified that the training/inference loop no longer crashes with:
`TypeError: BlockMinifloatQuantize.backward() missing 3 required positional arguments

Removed unnecessary arguments from the backward method to match PyTorch autograd.Function requirements and fix TypeError.
Copilot AI review requested due to automatic review settings February 4, 2026 16:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TypeError in the backward pass of BlockMinifloatQuantize by correcting the method signature. The backward method incorrectly defined additional positional arguments that PyTorch's autograd engine does not provide, causing crashes during training.

Changes:

  • Removed incorrect positional arguments (width, exponent_width, exponent_bias_width, block_size, skip_first_dim) from the backward method signature
  • Maintained the correct return statement with 6 values (gradient for input tensor + 5 None values for non-tensor parameters)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant