Skip to content

Minimalistic dynamic configs #268

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

Merged
merged 8 commits into from
May 21, 2025
Merged

Conversation

jlamypoirier
Copy link
Collaborator

✨ Description

A simplified version of #245, with only the dynamic config support and its example usage for gpt datasets, i.e. excluding the further usage in cli and transformer sub-configs. I also made it more opt-in by making registries only on request and removing the global config registry.

🔍 Type of change

Select all that apply:

  • 🐛 Bug fix (non-breaking change that addresses a specific issue)
  • 🚀 New feature (non-breaking change that adds functionality)
  • ⚠️ Breaking change (a change that could affect existing functionality)
  • 📈 Performance improvement/optimization (improves speed, memory usage, or efficiency)
  • 🛠️ Code refactor (non-functional changes that improve code readability, structure, etc.)
  • 📦 Dependency bump (updates dependencies, including Dockerfile or package changes)
  • 📝 Documentation change (updates documentation, including new content or typo fixes)
  • 🔧 Infrastructure/Build change (affects build process, CI/CD, or dependencies)

@jlamypoirier jlamypoirier marked this pull request as ready for review May 15, 2025 14:21
Comment on lines +253 to +257
for name in PeftType:
# We need this because we are using the reserved field name `type`.
# TODO: Implement proper dynamic typing.
TransformerPeftConfig.register_subclass(name.value, TransformerPeftConfig)

Copy link
Collaborator

Choose a reason for hiding this comment

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

can we use tag instead of type to avoid this workaround?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could but I don't think it's worth it. The workaround won't stay long since I already have dynamic implementations in #245. Also keeping type makes the transition easier since we're already keeping that name, eg. so config change or backward compatibility fix is needed.

Copy link
Collaborator

@tscholak tscholak left a comment

Choose a reason for hiding this comment

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

LGTM, merge when ready please

@jlamypoirier
Copy link
Collaborator Author

@tscholak It's ready but depends on #266 which is waiting on review

Base automatically changed from misc to main May 21, 2025 21:07
@jlamypoirier jlamypoirier merged commit 3e5edc3 into main May 21, 2025
2 checks passed
@jlamypoirier jlamypoirier deleted the minimalistic_dynamic_classes branch May 21, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants