feat: support generic freeze-config selectors - #3681
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
🌿 Preview your docs: https://nvidia-preview-preview-dcea089731f8.docs.buildwithfern.com/nemo/automodel |
2acd4b0 to
deb0d61
Compare
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
…binding Address review feedback on the generic freeze-config API: - Represent freeze_config as a typed FreezeConfig with typed ModuleSelector variants (path: exact canonical module path, glob: case-sensitive fnmatch on the full path). Reject bare strings, unknown options, invalid selector combinations, and selectors that match no parameters. - Rebind the trainability policy after parallelization/checkpoint surgery by re-resolving selectors on the post-surgery module hierarchy (PEFT baseline, then freeze/unfreeze selectors, then framework-required freezes) instead of restoring pre-shard parameter FQN snapshots, which broke when transformations renamed or recreated parameters. - Freeze configuration now only controls requires_grad; it no longer casts explicitly unfrozen trainable parameters to the compute dtype. - Keep the legacy modality booleans supported without deprecation; the previously documented migration was not behaviorally equivalent. Signed-off-by: Peter St. John <pstjohn@nvidia.com>
00c2ce7 to
ace236f
Compare
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
jgerh
left a comment
There was a problem hiding this comment.
Completed tech pubs review of docs/guides/llm/sequence-classification.mdx and provided a few copyedits.
|
Thanks @pstjohn For the ci failure, I think If a user genuinely wants to freeze token embeddings, they can use an explicit model-specific selector such as: freeze_modules:
- path: model.language_model.embed_tokensThere are a few other items:
|
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
Co-authored-by: jgerh <163925524+jgerh@users.noreply.github.com> Signed-off-by: Peter St. John <pstjohn@nvidia.com>
Signed-off-by: Peter St. John <pstjohn@nvidia.com>
|
Thanks, addressed!
|
|
/ok to test dcea089 |
Adds support for custom
freeze_modules/unfreeze_modulesinfreeze_config. This version still supports the legacyfreeze_vision_towerargumentsthis now also supports the same glob-style pattern of peft's
target_modules:porting all these existing
freeze_vision_towerargs over tofreeze_moduleswould be a pretty big refactor; for the time i've just emitted a deprecation warning letting people know about thefreeze_modulesoption.Alternative to #3661 to enable freezing / unfreezing modules in between model construction and optimizer creation.