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

Fix LLM tests #1088

Merged
merged 8 commits into from
Nov 28, 2024
Merged

Fix LLM tests #1088

merged 8 commits into from
Nov 28, 2024

Conversation

pablomlago
Copy link
Collaborator

@pablomlago pablomlago commented Nov 5, 2024

Reason for this PR

See #1076.

Changes Made in this PR

Since transformers 4.46.0 (https://github.com/huggingface/transformers/releases/tag/v4.46.0), OPT attention mechanism relies, by default, on OPTSdpaAttention, thus resulting in the method replace_mha_with_quantizable_layers (https://github.com/pablomlago/brevitas/blob/master/src/brevitas_examples/llm/llm_quant/prepare_for_quantize.py#L11) not injecting the Brevitas layers.

Additionally, the signature of the forward function in OPTAttention was updated in transformers 4.46.0, thus requiring to update the signature of QuantMultiHeadAttention analogously, even if this attribute is not actually used.

Testing Summary

TODO

Risk Highlight

  • This PR includes code from another work (please detail).
  • This PR contains API-breaking changes.
  • This PR depends on work in another PR (please provide links/details).
  • This PR introduces new dependencies (please detail).
  • There are coverage gaps not covered by tests.
  • Documentation updates required in subsequent PR.

Checklist

  • Code comments added to any hard-to-understand areas, if applicable.
  • Changes generate no new warnings.
  • Updated any relevant tests, if applicable.
  • No conflicts with destination dev branch.
  • I reviewed my own code changes.
  • Initial CI/CD passing.
  • 1+ reviews given, and any review issues addressed and approved.
  • Post-review full CI/CD passing.

Copy link
Collaborator

@nickfraser nickfraser left a comment

Choose a reason for hiding this comment

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

Open question about new pattern for layer replacement.

requirements/requirements-llm.txt Outdated Show resolved Hide resolved
tests/brevitas_examples/test_llm.py Outdated Show resolved Hide resolved
src/brevitas/nn/quant_mha.py Outdated Show resolved Hide resolved
@nickfraser nickfraser self-requested a review November 5, 2024 16:09
@Giuseppe5 Giuseppe5 added the next release PRs which should be merged for the next release label Nov 7, 2024
@nickfraser
Copy link
Collaborator

I think only @Giuseppe5's comment needs to be addressed, otherwise this can be merged IMO.

@Giuseppe5
Copy link
Collaborator

There's a bunch of test failing on the extended test suite @pablomlago

@Giuseppe5 Giuseppe5 requested review from Giuseppe5 and removed request for Giuseppe5 November 27, 2024 17:34
@Giuseppe5 Giuseppe5 merged commit d51087c into Xilinx:dev Nov 28, 2024
381 of 396 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release PRs which should be merged for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants