Skip to content

MultiHeadAttention bias=False regression #52257

@tbennun

Description

@tbennun

🐛 Bug

MultiHeadAttention does not respect bias=False in the output projection. It seems that it was changed as part of a PR: eace053#diff-61bd5e4f390b965228ead6bb0efcad5b9b5299d833bcf5c2aa11ebaebb39ba29L794

Is this the intended behavior?

@ezyang

To Reproduce

Steps to reproduce the behavior:

  1. Create a MultiHeadAttention module with torch.nn.MultiheadAttention(N, H, bias=False)
  2. The module's out_proj field as a non-None, nonzero bias

Expected behavior

The bias in out_proj should be None.

Environment

  • PyTorch Version (e.g., 1.0): 1.7.1 and latest master
  • OS (e.g., Linux): All
  • How you installed PyTorch (conda, pip, source): conda
  • Build command you used (if compiling from source): N/A
  • Python version: 3.8
  • CUDA/cuDNN version: N/A
  • GPU models and configuration: N/A
  • Any other relevant information: N/A

Additional context

N/A

cc @ezyang @gchanan @zhangguanheng66

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: bc-breakingRelated to a BC-breaking changetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions