-
Notifications
You must be signed in to change notification settings - Fork 149
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
[Forkless SparseML Transformers] [Feature Branch] Setting Up The modification
module
#2046
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bfineran
reviewed
Feb 26, 2024
:param model: The original HuggingFace transformers model | ||
:return: The potentially modified model | ||
""" | ||
model_name = model.__class__.__name__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using the classes themselves as keys instead of name
src/sparseml/transformers/sparsification/modification/modify_model.py
Outdated
Show resolved
Hide resolved
dbogunowicz
commented
Feb 26, 2024
dbogunowicz
changed the base branch from
main
to
investigation/damian/open_files
March 5, 2024 16:27
dbogunowicz
changed the base branch from
investigation/damian/open_files
to
main
March 5, 2024 16:27
…ith the forkless transformers (#2057)
* working demo * beautification * initial commit * initial commit * Fix typing mistakes * [Forkless SparseML Transformers] [Feature Branch] Modding DistilBert(#2052) * [Forkless SparseML Transformers] [Feature Branch] Modding `Bert` (#2054) * initial commit * initial commit * [Forkless SparseML Transformers] [Feature Branch] Modding MobileBert (#2056) * [Forkless SparseML Transformers] Hardening unit tests (#2088) * initial commit * bring back the original file * initial commit
working on transformers tests (fixing out of space error) 2 working on transformers tests (fixing out of space error) 3 working on transformers tests (fixing out of space error) 4 fixing tests... disable test_consecutive_runs fix mistral update integration tests
dbogunowicz
force-pushed
the
feature/damian/forkless_transformer_feature
branch
from
March 11, 2024 12:08
9d47ad0
to
fcb04a6
Compare
dbogunowicz
commented
Mar 11, 2024
dbogunowicz
commented
Mar 11, 2024
src/sparseml/transformers/sparsification/modification/modify_model.py
Outdated
Show resolved
Hide resolved
dbogunowicz
commented
Mar 11, 2024
dbogunowicz
commented
Mar 11, 2024
bfineran
reviewed
Mar 11, 2024
tests/sparseml/transformers/sparsification/modification/conftest.py
Outdated
Show resolved
Hide resolved
src/sparseml/transformers/sparsification/modification/modify_model.py
Outdated
Show resolved
Hide resolved
bfineran
approved these changes
Mar 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request addresses the removal of the dependency on
nm-transformers
in favor of the original HFtransformers.
The primary motivation for this change is to simplify maintenance by eliminating the challenges associated with keeping a fork.The scope of this PR was defined by running a
diff
betweennm-transformers
andtransformers
and identifying the elements that need to be included insparseml
to account for the differences.For more details refer to the appropriate documentation in the internal docs repository.
Changes made:
"transformers<4.37"
, removing the dependency on our forksrc/sparseml/transformers/sparsify/modification
submodule, that is responsible for modifying thetransformers
models, as the fork did in the pastsparseml.transformers.utils
tosparseml.transformers.sparsification
SiLUActivation
toSiLU
transformers
test in GHA. Refactored and optimized the tests.Manual Testing
Tested both
Mistral
andLlaMa
on our end-to-end flows:Tested a single BERT QA recipe:
Note manual testing asserts that the pathways are working. The testing did not check the correctness of the resulting models.
Relevant PRs:
Mistral
#2047LLaMa
#2050OPT
#2051DistilBert
#2052Bert
#2054MobileBert
#2056