# Fine-tune PyTorch models on DGX Spark

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/)
- [Set up your NVIDIA DGX Spark](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/1-setup/)
- [Understand fine-tuning](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/2-finetuning/)
- [Fine-tune a model with PyTorch and Hugging Face](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/3-pytorch/)
- [Test your fine-tuned model with vLLM](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/4-testing/)
- [Next Steps](https://learn.arm.com/learning-paths/laptops-and-desktops/pytorch-finetuning-on-spark/_next-steps/)

## About this Learning Path

|  |  |
| --- | --- |
| Skill level: | Advanced |
| Reading time: | 1 hr |
| Last updated: | 12 Nov 2026 |

|  |  |
| --- | --- |
| Author: | Michael Hall , Arm |
| Arm IP: | [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors) [Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors) |
| Tags: | [AI/ML](https://learn.arm.com/tag/ai-ml/) [Linux](https://learn.arm.com/tag/linux) [Python](https://learn.arm.com/tag/python) [PyTorch](https://learn.arm.com/tag/pytorch) [Docker](https://learn.arm.com/tag/docker) [Hugging Face](https://learn.arm.com/tag/hugging-face) |

### 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?
After completing this Learning Path, you'll be able to perform the following tasks:
- 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'll need the following prerequisites:
- Hugging Face account and access token
- NVIDIA DGX Spark workstation

### Summary
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.
