You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(unsloth): support Nemotron-H hybrid MoE fine-tuning on DGX Spark (#338)
* feat(unsloth): support Nemotron-H hybrid Mamba MoE fine-tuning
Enable fine-tuning of hybrid Mamba-2 + MoE models (NVIDIA Nemotron-H,
e.g. Nemotron-3-Nano-30B-A3B) on the Unsloth customization backend, plus
two supporting fixes uncovered bringing the backend up on a unified-memory
GB10 (DGX Spark, arm64/Blackwell).
- Add mamba-ssm + causal-conv1d to the nmp-unsloth-training image, installed
from the same prebuilt cu13.1.1/cp312 wheels as nmp-automodel-base via the
causal-conv1d-wheel / mamba-ssm-wheel bake contexts (versions single-sourced,
no recompile). Nemotron-H remote code imports mamba_ssm at load time.
- Add configurable model.device_map (default {"": 0}). Without an explicit
single-device map, accelerate's device_map="auto" sizes the GPU budget from
CUDA free memory, which on unified-memory parts reports a small dynamic
carve-out and spills layers to CPU -- aborting 4-bit loads.
- Fix file_io download crash: get_percentage now clamps instead of raising when
the live file count exceeds the pre-listing total (off-by-one on sources with
nested directories), so a cosmetic progress value can't fail a multi-GB
download mid-transfer.
- Register cpu/gpu + gpu/gpu docker execution profiles in the local runner
config so the customization backends run out-of-the-box on a local platform.
- Docs: document model.device_map and the 16-bit-LoRA path for hybrid MoE models
in the customizer hyperparameters reference; refresh the unsloth image README
build steps (shared wheels / USE_LOCAL_WHEELS, accurate step list).
Validated end-to-end on DGX Spark: Nemotron-3-Nano-30B-A3B loads and trains in
16-bit LoRA (load_in_4bit=false).
Signed-off-by: Albert Cui <albcui@nvidia.com>
* add docker backend to models controller
Signed-off-by: Albert Cui <albcui@nvidia.com>
---------
Signed-off-by: Albert Cui <albcui@nvidia.com>
Copy file name to clipboardExpand all lines: plugins/nemo-customizer/src/nemo_customizer/skills/nemo-customizer/references/hyperparameters.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -462,10 +462,13 @@ Full template (every section, defaults inline):
462
462
|`load_in_4bit`|`true`| bitsandbytes 4-bit. Mutex with `load_in_8bit`. Default for Unsloth's headline path; required to fit larger models on small GPUs. |
463
463
|`load_in_8bit`|`false`| bitsandbytes 8-bit. Mutex with `load_in_4bit`. |
464
464
|`dtype`|`"auto"`| One of `"auto"`, `"bfloat16"`, `"float16"`, `"float32"`. |
465
-
|`trust_remote_code`|`false`| HF `trust_remote_code` flag for custom model code. |
465
+
|`trust_remote_code`|`false`| HF `trust_remote_code` flag for custom model code (required by some hybrid Mamba/MoE models, e.g. Nemotron-H). |
466
+
|`device_map`|`null`| Placement for `FastLanguageModel.from_pretrained`. `null` pins the whole model to the single visible GPU (`{"": 0}`) — the right default for this single-GPU backend. Leave unset unless experimenting; `"auto"`/`"balanced"`/`"sequential"` can spill layers to CPU on unified-memory hosts (GB10 / DGX Spark) and abort 4-bit loads. |
466
467
467
468
**Mutex:**`load_in_4bit` xor `load_in_8bit`. Both quantization flags are also **incompatible with `training.finetuning_type: "all_weights"`** — full SFT must use a non-quantized base.
468
469
470
+
> **Hybrid Mamba/MoE models (e.g. NVIDIA Nemotron-H `*-A3B`):** load in **16-bit** (`load_in_4bit: false`, `load_in_8bit: false`) — Unsloth's supported path for these. The 4-bit (bitsandbytes) path can hit a dtype mismatch inside the model's MoE expert accumulation. Keep `device_map` unset (single-GPU default) and set `trust_remote_code: true`.
471
+
469
472
### `dataset`
470
473
471
474
See `references/dataset-formats.md` § Unsloth for row-shape rules.
0 commit comments