Skip to content

feat(customizer): expose all hyperparams supported in backend lib#371

Merged
anubhutivyas merged 1 commit into
mainfrom
aalgo-279-hyperparams-support/anubhutiv
Jun 29, 2026
Merged

feat(customizer): expose all hyperparams supported in backend lib#371
anubhutivyas merged 1 commit into
mainfrom
aalgo-279-hyperparams-support/anubhutiv

Conversation

@anubhutivyas

@anubhutivyas anubhutivyas commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

New Features

  • Expanded training customization for Automodel: optimizer selection (Adam/AdamW), configurable epsilon, learning-rate decay styles, attention backend choice, and sequence packing limits.
  • Enhanced LoRA/PEFT controls: module exclusion patterns and improved Triton LoRA support.
  • Expanded Unsloth options: optional RoPE scaling plus advanced LoRA/PEFT targeting (DoRA/LoftQ, layer/module selection) and additional optimizer/training hyperparameters.

Documentation

  • Updated hyperparameter references and copy-paste JSON templates for the new Automodel and Unsloth fields.

Tests

  • Added/extended tests to verify pass-through behavior and defaulting/validation rules.

@anubhutivyas anubhutivyas requested review from a team as code owners June 17, 2026 07:08
@github-actions github-actions Bot added the feat label Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1258e672-c131-42b0-b8a4-7cd1c3fa57d9

📥 Commits

Reviewing files that changed from the base of the PR and between 42cbfa4 and caa26ce.

📒 Files selected for processing (17)
  • plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py
  • plugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.md
  • plugins/nemo-unsloth/src/nemo_unsloth_plugin/schema.py
  • services/automodel/src/nmp/automodel/adapter.py
  • services/automodel/src/nmp/automodel/api/v2/jobs/schemas.py
  • services/automodel/src/nmp/automodel/app/jobs/training/compiler.py
  • services/automodel/src/nmp/automodel/app/jobs/training/schemas.py
  • services/automodel/src/nmp/automodel/tasks/training/backends/config.py
  • services/automodel/tests/contract/output_configs/gpt_oss_lora_packing.yaml
  • services/automodel/tests/contract/output_configs/llama_3_2_1b_lora_packing.yaml
  • services/automodel/tests/contract/output_configs/nemotron_nano_lora_packing.yaml
  • services/automodel/tests/test_adapter.py
  • services/automodel/tests/test_compiler.py
  • services/unsloth/src/nmp/unsloth/schemas.py
  • services/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.py
  • services/unsloth/tests/test_model_load_kwargs.py
  • services/unsloth/tests/test_schemas.py
💤 Files with no reviewable changes (3)
  • services/automodel/tests/contract/output_configs/gpt_oss_lora_packing.yaml
  • services/automodel/tests/contract/output_configs/llama_3_2_1b_lora_packing.yaml
  • services/automodel/tests/contract/output_configs/nemotron_nano_lora_packing.yaml
🚧 Files skipped from review as they are similar to previous changes (10)
  • services/automodel/src/nmp/automodel/app/jobs/training/schemas.py
  • services/automodel/src/nmp/automodel/adapter.py
  • services/automodel/src/nmp/automodel/tasks/training/backends/config.py
  • plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py
  • services/automodel/tests/test_adapter.py
  • services/automodel/tests/test_compiler.py
  • services/unsloth/tests/test_model_load_kwargs.py
  • services/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.py
  • services/automodel/src/nmp/automodel/app/jobs/training/compiler.py
  • plugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.md

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Pass-2 hyperparameter expansion

Layer / File(s) Summary
Automodel schema contracts
plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py, services/automodel/src/nmp/automodel/api/v2/jobs/schemas.py, services/automodel/src/nmp/automodel/app/jobs/training/schemas.py
Plugin, API v2, and internal automodel schemas gain LoRA exclusion/Triton, attention backend, packing, and optimizer/LR-decay fields.
Automodel adapter, compiler, and backend wiring
services/automodel/src/nmp/automodel/adapter.py, services/automodel/src/nmp/automodel/app/jobs/training/compiler.py, services/automodel/src/nmp/automodel/tasks/training/backends/config.py
The new automodel fields are threaded through adapter output, compiled step config, optimizer selection, packed-sequence handling, and PEFT config.
Automodel adapter and compiler tests
services/automodel/tests/test_adapter.py, services/automodel/tests/test_compiler.py, services/automodel/tests/contract/output_configs/*packing.yaml
Tests cover pass-2 field propagation and default behavior through adapter and compiler paths, and contract outputs drop the removed packed-sequence key.
Unsloth schema contracts
services/unsloth/src/nmp/unsloth/schemas.py
Unsloth schemas gain RoPE scaling, expanded LoRA controls, scheduler kwargs, and added optimizer/regularization fields.
Unsloth kwargs and SFT wiring
services/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.py
RoPE scaling, PEFT kwargs, optimizer fields, and optional scheduler/NEFTune values are wired into model loading and SFTConfig.
Unsloth kwargs builder tests
services/unsloth/tests/test_model_load_kwargs.py, services/unsloth/tests/test_schemas.py
Tests cover RoPE scaling, PEFT kwarg construction, and the LoRA validation/default behavior.
Hyperparameter reference updates
plugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.md
Automodel and unsloth JSON templates and field glossaries are updated to reflect the new schema fields.

Possibly related PRs

Suggested reviewers

  • albcui
  • soluwalana
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: exposing additional backend-supported hyperparameters through the customizer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aalgo-279-hyperparams-support/anubhutiv

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between d36974f and 3544f77.

📒 Files selected for processing (12)
  • plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py
  • plugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.md
  • services/automodel/src/nmp/automodel/adapter.py
  • services/automodel/src/nmp/automodel/api/v2/jobs/schemas.py
  • services/automodel/src/nmp/automodel/app/jobs/training/compiler.py
  • services/automodel/src/nmp/automodel/app/jobs/training/schemas.py
  • services/automodel/src/nmp/automodel/tasks/training/backends/config.py
  • services/automodel/tests/test_adapter.py
  • services/automodel/tests/test_compiler.py
  • services/unsloth/src/nmp/unsloth/schemas.py
  • services/unsloth/src/nmp/unsloth/tasks/training/backends/unsloth_sft.py
  • services/unsloth/tests/test_model_load_kwargs.py

Comment thread services/automodel/src/nmp/automodel/tasks/training/backends/config.py Outdated
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 21929/28733 76.3% 61.0%
Integration Tests 12583/27413 45.9% 19.2%

@albcui albcui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Comment thread plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py Outdated
Comment thread plugins/nemo-automodel/src/nemo_automodel_plugin/schema.py Outdated
@anubhutivyas anubhutivyas force-pushed the aalgo-279-hyperparams-support/anubhutiv branch from 3544f77 to 42cbfa4 Compare June 29, 2026 19:50
Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
@anubhutivyas anubhutivyas force-pushed the aalgo-279-hyperparams-support/anubhutiv branch from 42cbfa4 to caa26ce Compare June 29, 2026 20:00
@anubhutivyas anubhutivyas added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit 68e7b29 Jun 29, 2026
54 checks passed
@anubhutivyas anubhutivyas deleted the aalgo-279-hyperparams-support/anubhutiv branch June 29, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants