-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support stripped type embedding in DPA1 of PT/DP (#3712)
This PR supports stripped type embedding in DPA1 of PT/DP: - Remove `stripped_type_embedding` params in all classes and use `tebd_input_mode` == "strip" instead. - Add stripped type embedding inplementation for DPA1 of PT/DP. - Add serialize and deserialize for stripped type embedding. Note: - Old TF inplementation has not consistent behaivior when `type_one_side`==True and `tebd_input_mode` == "strip", it always uses two_side type stripped embeddings input, which is also inconsistent with `DescrptSeAEbdV2` in TF (but the training still works and only raise `NotImplementedError` when doing serialization now) may need support from @nahso . - Old TF inplementation `init_variables` will not init `idt` weights from graph for `two_side_embeeding_net_variables` (fixed), I'm surprised that no ut failed before (maybe all tests use `resnet_dt` == False). - The TF implementation of `DescrptSeAtten` does not support serialization when `tebd_input_mode` == "strip". This limitation arises because the shape of `type_embedding` cannot be determined after init, as it is decided at runtime. While the consistent version `DescrptDPA1Compat` is compatible with this configuration. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced model flexibility with new type embedding input modes: `concat` and `strip`. - **Bug Fixes** - Improved model compression logic alignment with new type embedding modes for more efficient operations. - **Documentation** - Updated documentation to explain the impact of new type embedding input modes on model descriptors. - **Tests** - Adjusted test cases to reflect changes in type embedding input modes for robust testing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Duo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2be5f0f
commit d48f84a
Showing
21 changed files
with
462 additions
and
135 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.