Who is this for?
This is an advanced topic for AI developers and ML engineers who want to fine-tune large language models using PyTorch and Hugging Face on the NVIDIA DGX Spark platform.
What will you learn?
Upon completion of this Learning Path, you will be able to:
- Understand how fine-tuning teaches a model domain-specific knowledge
- Prepare a custom JSONL dataset for supervised fine-tuning
- Fine-tune Llama 3.2 3B on Raspberry Pi datasheet content using PyTorch and Hugging Face
- Compare base and fine-tuned model responses to verify factual accuracy improvements
Prerequisites
Before starting, you will need the following:
- Hugging Face account and access token
- NVIDIA DGX Spark workstation
Summary
AI-assisted
This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication.
Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
You’ll fine-tune a Llama 3.2 3B model on an Arm-based NVIDIA DGX Spark, using the Grace CPU for orchestration and the GPU for training. You’ll configure Docker, prepare a JSONL dataset from Raspberry Pi datasheet content, and run supervised fine-tuning in a prebuilt PyTorch container. You’ll then serve both base and fine-tuned models with vLLM to compare factual responses.
Frequently asked questions
AI-assisted
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication.
Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
How do I know Docker on DGX Spark is ready before pulling containers?After configuring permissions, pull and run the pre-built PyTorch container as shown in the setup step. If it runs without permission errors, Docker is configured correctly.
Which Llama model variant does the training script target?The path fine-tunes Llama 3.2 3B using Llama3_3B_full_finetuning.py. The The path uses the 8B example only to illustrate why fine-tuning improves factual responses.
What dataset format should I use for supervised fine-tuning?Use a JSONL dataset prepared for supervised fine-tuning. Ensure its fields match what the script loads; check the dataset loading section in the training script to align names and structure.
What output indicates the fine-tuning completed successfully?The process produces a fine-tuned Llama model that the testing step can load with vLLM. If you’re able to serve the model in the vLLM container without errors, the fine-tuning completed successfully.
What result should I expect when comparing base and fine-tuned models?On Raspberry Pi datasheet questions, the fine-tuned model should answer factual queries correctly. For example, it reports the RP2350 maximum clock as 150 MHz, while the base model might hallucinate a higher value.