feat(customizer): expose all hyperparams supported in backend lib#371
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (17)
💤 Files with no reviewable changes (3)
🚧 Files skipped from review as they are similar to previous changes (10)
📝 WalkthroughWalkthroughAdds optional training, LoRA, packing, attention, and optimizer fields across automodel and unsloth schemas, wires them through compilation and backend config paths, and updates tests plus hyperparameter reference templates to match. ChangesPass-2 hyperparameter expansion
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/automodel/src/nmp/automodel/tasks/training/backends/config.py`:
- Around line 257-261: The optimizer_targets.get() call with a default fallback
to Adam silently masks configuration errors when an unknown optimizer_name is
provided. Instead of using the get method with a default, explicitly check if
customizer_config.optimizer.optimizer_name exists in the optimizer_targets
dictionary and raise a clear error if it does not, ensuring invalid optimizer
configurations fail immediately rather than silently defaulting to Adam.
In `@services/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.py`:
- Around line 85-96: The issue is that the `build_peft_kwargs` function relies
on a runtime assertion to check that `lora` is not None, but the schema allows
`finetuning_type="lora"` with `lora=None`, which will cause a crash at runtime.
Instead of relying on runtime assertions, enforce this invariant at the schema
level in `TrainingSpec` by either making `lora` required when
`finetuning_type="lora"` or providing an appropriate default value. This ensures
backend helper functions like `build_peft_kwargs` never receive invalid input
shapes without needing runtime assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: af7a496d-dc75-454e-8083-359c419f6870
📒 Files selected for processing (12)
plugins/nemo-automodel/src/nemo_automodel_plugin/schema.pyplugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.mdservices/automodel/src/nmp/automodel/adapter.pyservices/automodel/src/nmp/automodel/api/v2/jobs/schemas.pyservices/automodel/src/nmp/automodel/app/jobs/training/compiler.pyservices/automodel/src/nmp/automodel/app/jobs/training/schemas.pyservices/automodel/src/nmp/automodel/tasks/training/backends/config.pyservices/automodel/tests/test_adapter.pyservices/automodel/tests/test_compiler.pyservices/unsloth/src/nmp/unsloth/schemas.pyservices/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.pyservices/unsloth/tests/test_model_load_kwargs.py
|
3544f77 to
42cbfa4
Compare
Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
42cbfa4 to
caa26ce
Compare
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests