Understanding NeMo Customizer: Models, Training, and Resources

View as Markdown

Learn the fundamentals of how NeMo Customizer works to make informed decisions about your fine-tuning projects. This tutorial covers how models are organized, how adapters attach to base models, training types and GPU requirements, and how to choose the right approach for your use case.

Understanding these basics will help you navigate the fine-tuning process more effectively and avoid common issues. If you’re ready to start fine-tuning immediately, you can jump to SFT Customization Job after completing this tutorial.

The time to complete this tutorial is approximately 15 minutes.

This tutorial focuses on understanding and discovery—no actual training jobs are created.

Prerequisites

All platform resources—models, datasets, and more—must belong to a workspace. Workspaces provide organizational and authorization boundaries for your work. Within a workspace, you can optionally use projects to group related resources.

If you’re new to the platform, start with the Setup guide to learn how to deploy and evaluate models, and optimize agents using the platform end-to-end.

If you’re already familiar with workspaces and how to upload datasets to the platform, you can proceed directly with this tutorial.

For more information, see Workspaces and Projects.

Before starting, make sure you have:

  • NeMo Platform installed and deployed (see Setup)
  • The PyPI nemo-platform wrapper package installed (pip install "nemo-platform[all]"). If you are working from a source checkout, run make bootstrap from the repository root instead.
  • (Optional) Weights & Biases account and API key for enhanced visualization

Set up environment variables:

$# Set the base URL for NeMo Platform
$export NMP_BASE_URL="http://localhost:8080" # Or your deployed platform URL
$
$# Optional: Weights & Biases for experiment tracking
$export WANDB_API_KEY="<your-wandb-api-key>"

Initialize the SDK:

1import os
2from nemo_platform import NeMoPlatform
3
4client = NeMoPlatform(
5 base_url=os.environ.get("NMP_BASE_URL", "http://localhost:8080"),
6 workspace="default",
7)

Core Concepts

What is a Model Entity?

A Model Entity represents a model registered in the NeMo Platform. It contains:

  1. FileSet Reference: Points to the model checkpoint files (weights, config, tokenizer)
  2. Model Spec: Auto-populated metadata about the model architecture (layers, parameters, etc.)
  3. Adapters: LoRA or other parameter-efficient fine-tuning weights attached to this model
  4. Base Model Link: Optional reference to a parent model (for fine-tuned models)

Think of a Model Entity as a “model card” that tracks everything about a model—where its files are, what architecture it uses, and what adapters have been trained for it.

What is an Adapter?

An Adapter is a set of parameter-efficient fine-tuning weights (like LoRA) that are attached to a Model Entity. Adapters:

  • Are nested within the parent Model Entity
  • Are enabled for inference by default post training
  • Have their own FileSet for storing the adapter weights
  • Track metadata like finetuning type, rank, and alpha values

What is a FileSet?

A FileSet is a collection of files stored in the platform’s file service. For customization:

  • Model FileSet: Contains the base model checkpoint (config, weights, tokenizer)
  • Adapter FileSet: Contains the LoRA adapter weights
  • Dataset FileSet: Contains training and validation data

The Customization Workflow

Step-by-Step Breakdown

1. Create a FileSet for your base model

Upload your model checkpoint files (from HuggingFace, NGC, or local storage) to a FileSet:

1import os
2from nemo_platform import NeMoPlatform
3from nemo_platform.types.files import HuggingfaceStorageConfigParam
4
5client = NeMoPlatform(
6 base_url=os.environ.get("NMP_BASE_URL", "http://localhost:8080"),
7 workspace="default",
8)
9
10# Create a FileSet from HuggingFace
11fileset = client.files.filesets.create(
12 workspace="default",
13 name="llama-3-2-1b",
14 description="Llama 3.2 1B base model",
15 storage=HuggingfaceStorageConfigParam(
16 type="huggingface",
17 repo_id="meta-llama/Llama-3.2-1B-Instruct",
18 repo_type="model",
19 token_secret="my-hf-token", # Secret containing HuggingFace token
20 ),
21)

2. Create a Model Entity pointing to the FileSet

1model = client.models.create(
2 workspace="default",
3 name="llama-3-2-1b",
4 fileset="default/llama-3-2-1b", # Reference to the FileSet
5 description="Llama 3.2 1B base model",
6)
7
8# Wait for model spec to be auto-populated
9import time
10
11while not model.spec:
12 time.sleep(5)
13 model = client.models.retrieve(workspace="default", name="llama-3-2-1b")
14
15print(f"Model architecture: {model.spec.family}")
16print(f"Parameters: {model.spec.base_num_parameters:,}")

3. Create a Customization Job

1job = client.customization.jobs.create(
2 workspace="default",
3 name="my-email-assistant-lora",
4 spec={
5 "model": "default/llama-3-2-1b",
6 "dataset": "fileset://default/email-training-data",
7 "training": {
8 "type": "sft",
9 "peft": {"type": "lora", "rank": 8, "alpha": 32},
10 "epochs": 3,
11 "batch_size": 32,
12 },
13 "deployment_config": {"lora_enabled": True},
14 },
15)

4. Access the Result

After training completes:

1# For LoRA jobs - adapter is attached to the model
2model = client.models.retrieve(workspace="default", name="llama-3-2-1b")
3
4for adapter in model.adapters:
5 print(f"Adapter: {adapter.name}")
6 print(f" Type: {adapter.finetuning_type}")
7 print(f" Enabled: {adapter.enabled}")
8 print(f" Files: {adapter.fileset}")

Understanding Adapters and Deployment

How Adapters Work

When you run a LoRA customization job:

  1. Training produces adapter weights (small compared to base model)
  2. Adapter created and attached to the parent Model Entity
  3. FileSet created with the adapter weights
  4. Enabled by default so NIMs serving the base model automatically load the adapter

Viewing Adapters on a Model

1model = client.models.retrieve(workspace="default", name="llama-3-2-1b")
2
3print(f"Model: {model.name}")
4print(f"Adapters:")
5for adapter in model.adapters or []:
6 print(f" - {adapter.name}")
7 print(f" Type: {adapter.finetuning_type}")
8 print(f" Enabled: {adapter.enabled}")
9 print(f" Created: {adapter.created_at}")

Disabling and Re-enabling Adapters

Adapters are enabled by default, but you can disable an adapter to remove it from inference without deleting it. When you set enabled=False, the sidecar running alongside the NIM automatically removes the adapter’s files on its next reconciliation pass (every few seconds). Re-enabling the adapter causes the sidecar to re-download and serve it again.

1client.models.update_adapter(
2 model_name="llama-3-2-1b",
3 workspace="default",
4 adapter_name="my-custom-lora",
5 enabled=False,
6)

To re-enable:

1client.models.update_adapter(
2 model_name="llama-3-2-1b",
3 workspace="default",
4 adapter_name="my-custom-lora",
5 enabled=True,
6)

Creating Adapters Manually

You can also create adapters manually (e.g., from externally trained weights):

1model = client.models.create_adapter(
2 model_name="llama-3-2-1b",
3 workspace="default",
4 name="my-custom-lora",
5 fileset="default/my-lora-weights",
6 finetuning_type="lora",
7)

Training Types and Resource Requirements

Available Training Approaches

ApproachDescriptionGPU RequirementsOutput
LoRA (Low-Rank Adaptation)Trains small adapter weights while keeping base model frozen1-2 GPUs (80GB each)Adapter attached to parent Model Entity
Full SFT (Supervised Fine-Tuning)Updates all model weights for maximum performance4+ GPUs (80GB each)New Model Entity with full weights

GPU Memory Guidelines

Model SizeLoRAFull SFT
1B parameters1x 80GB GPU1x 80GB GPU
8B parameters1x 80GB GPU4x 80GB GPUs
70B parameters2x 80GB GPUs8x 80GB GPUs

Storage Requirements

Customization jobs consume disk space on the platform’s shared persistent volume for model files, finetuning checkpoints, and the final output artifact. Required space depends on the training type:

Training TypeApproximate Disk UsageNotes
LoRA~1.5× base model sizeStores base model + small adapter weights
Full SFT~3× base model sizeStores base model + full checkpoint + output model

These estimates cover model weights only and do not include training dataset size. If the platform disk fills during a job, the job fails with an I/O error and the job service may return a 500 status when you retrieve logs.

Ensure your platform’s shared persistent volume has at least 3× the base model size of free space before starting a full SFT job, or 1.5× for LoRA jobs.

For troubleshooting disk-related failures, see customizer.

Parallelism Parameters Explained

Parallelism is configured via training.parallelism. These parameters control how training workloads are distributed across GPUs:

ParameterDescriptionDefault
tensor_parallel_sizeNumber of GPUs to distribute each layer’s parameters across1
pipeline_parallel_sizeNumber of GPUs to distribute layers across sequentially1
context_parallel_sizeNumber of GPUs to distribute sequence context across1
sequence_parallelEnable sequence parallelism to distribute activation memory along the sequence dimensionfalse
expert_parallel_sizeNumber of GPUs to distribute MoE experts across (MoE models only)1

data_parallel_size is automatically derived as total_gpus / (TP × PP × CP) and is not set directly.

Recommended parallelism for Experts (MoE) Models:

The expert_parallel_size parameter is used to parallelize a Mixture of Experts (MoE) model’s experts across GPUs. For non-MoE models, this parameter is ignored. A model’s model card will indicate if it is a Mixture of Experts model and specifies its number of experts.

The number of experts in the model must be divisible by expert_parallel_size. For example, if a model has 8 experts, setting expert_parallel_size=4 results in each GPU processing 2 experts.

Also, the value of expert_parallel_size must evenly divide the derived data_parallel_size, which is automatically calculated as data_parallel_size = total GPUs / (tensor_parallel_size × pipeline_parallel_size × context_parallel_size).

For example, with 8 total GPUs, tensor_parallel_size=2, and pipeline_parallel_size=1:

  • Derived data_parallel_size = 8 / (2 × 1 × 1) = 4
  • Valid expert_parallel_size values: 1, 2, or 4 (must evenly divide 4)
  • Invalid expert_parallel_size value: 3 (does not evenly divide 4)

Resource Allocation Rules

Training configurations must satisfy mathematical constraints to work properly:

GPU Allocation Rule: The total number of GPUs (num_gpus_per_node x num_nodes) must be a multiple of: tensor_parallel_size × pipeline_parallel_size × context_parallel_size

If this constraint isn’t met, your training job will fail with a validation error.

Example Calculations:

  • 8 GPUs with tensor_parallel_size=4, pipeline_parallel_size=2 ✅ Valid (8 = 4 × 2 × 1)
  • 4 GPUs with tensor_parallel_size=4, pipeline_parallel_size=2 ❌ Invalid (4 ≠ 4 × 2 × 1)

Choosing Your Training Approach

Decision Framework

When to Use LoRA

Choose LoRA when:

  • You have limited GPU resources (1-2 GPUs)
  • You want fast training iterations
  • You need multiple specialized versions of the same base model
  • You want to auto-deploy adapters to existing NIM deployments

When to Use Full Fine-Tuning

Choose Full SFT when:

  • You need maximum model performance
  • You have sufficient GPU resources (4+ GPUs)
  • You want complete control over all model weights
  • You’re preparing a production deployment

Model Types and Capabilities

Supported Language Models

Model FamilyDescriptionExamples
Llama ModelsGeneral-purpose language models excellent for instruction following, conversation, and text generation tasksllama-3.1-8b-instruct, llama-3.2-1b-instruct
Llama Nemotron ModelsNVIDIA’s specialized variants optimized for specific use cases with enhanced reasoning capabilitiesVarious Nano and Super variants
Phi ModelsMicrosoft’s efficient models designed for strong reasoning with optimized deployment characteristicsPhi model family configurations
GPT-OSS ModelsOpen-source GPT-based models supporting Full SFT customization workflowsVarious GPT-OSS configurations

Specialized Models

Model TypeStatusDetails
Embedding Models✅ SupportedModel: Llama 3.2 NV EmbedQA 1B for question-answering and retrieval tasks Use Cases: Semantic search, document retrieval, question-answering systems, RAG pipelines Note: Typically disabled by default—contact your administrator for access
Reranking Models❌ Not SupportedAlternative: Use embedding models for retrieval tasks, or implement reranking in your application layer

Importing Custom Models

You can import any HuggingFace-compatible model:

1from nemo_platform.types.files import HuggingfaceStorageConfigParam
2
3# Create FileSet from HuggingFace
4fileset = client.files.filesets.create(
5 workspace="default",
6 name="my-custom-model",
7 storage=HuggingfaceStorageConfigParam(
8 type="huggingface",
9 repo_id="organization/model-name",
10 repo_type="model",
11 token_secret="my-hf-token",
12 ),
13)
14
15# Create Model Entity
16model = client.models.create(
17 workspace="default", name="my-custom-model", fileset="default/my-custom-model"
18)

For detailed guidance, see Import HuggingFace Model.


Next Steps

Now that you understand how Model Entities and Adapters work, you’re ready to proceed:


Key Takeaways

Model Entities contain model metadata and point to FileSet with checkpoint files ✅ Adapters (LoRA) are attached to Model Entities, not stored separately ✅ FileSet is where actual model/adapter files are stored ✅ LoRA training creates an adapter on the parent Model Entity ✅ Full SFT training creates a new Model Entity with full weights ✅ Adapters are enabled by default and automatically loaded by NIMs serving the base model ✅ GPU requirements vary significantly between LoRA and full fine-tuning ✅ Custom HuggingFace models can be imported via FileSet + Model Entity

Quick Reference Commands

1# List all Model Entities
2models = client.models.list(workspace="default")
3
4# Get a specific Model Entity with adapters
5model = client.models.retrieve(workspace="default", name="llama-3-2-1b")
6
7# Create a customization job
8job = client.customization.jobs.create(
9 workspace="default",
10 name="my-job",
11 spec={
12 "model": "default/llama-3-2-1b",
13 "dataset": "fileset://default/my-dataset",
14 "training": {"type": "sft", "peft": {"type": "lora"}},
15 },
16)
17
18# Add an adapter to a model
19client.models.create_adapter(
20 model_name="llama-3-2-1b",
21 workspace="default",
22 name="my-adapter",
23 fileset="default/adapter-weights",
24 finetuning_type="lora",
25)

You now have the foundation to make informed decisions about your fine-tuning projects!