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

BERT Layer Built-In #2184

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

MaximilianSchreff
Copy link
Contributor

This PR introduces the full BERT layer from the BERT transformer architecture to SystemDS as a built-in operation.

This PR is part of a series of PRs to support the BERT architecture in SystemDS. The BERT layer is the component in the BERT architecture. Backward pass will follow, as well as rest of components.

Includes

  • Forward pass

Testing:

Added a comprehensive test cases comparing the forward pass results against HuggingFace Transformer Library's implementation for correctness.

  • The tests validate:
    • Forward pass against HuggingFace Transformer Library's transformers.models.bert.modeling_bert.BertLayer

@MaximilianSchreff
Copy link
Contributor Author

@phaniarnab I will add support for the GELU activation here once GELU PR is merged.

@phaniarnab
Copy link
Contributor

@phaniarnab I will add support for the GELU activation here once GELU PR is merged.

The GELU PR is merged now @MaximilianSchreff .

@MaximilianSchreff
Copy link
Contributor Author

@phaniarnab added support for GELU and also a new test case with GELU activation.

Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.87%. Comparing base (6c4bffd) to head (1eefe7c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2184   +/-   ##
=========================================
  Coverage     71.86%   71.87%           
- Complexity    44707    44715    +8     
=========================================
  Files          1450     1450           
  Lines        169272   169272           
  Branches      32996    32996           
=========================================
+ Hits         121652   121667   +15     
+ Misses        38290    38279   -11     
+ Partials       9330     9326    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@phaniarnab
Copy link
Contributor

Thanks, @MaximilianSchreff. I will merge this in.

@MaximilianSchreff
Copy link
Contributor Author

@phaniarnab Added intermediate outputs in outputs since they are required in backward pass. This should be the last patch for this PR and it can be merged :)

@phaniarnab
Copy link
Contributor

phaniarnab commented Jan 26, 2025

@phaniarnab Added intermediate outputs in outputs since they are required in backward pass. This should be the last patch for this PR and it can be merged :)

Thank you @MaximilianSchreff. I will have a look and merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants