---
title: "Fine-tune Llama 3 with PyTorch FSDP and Q-Lora on Amazon SageMaker"
url: https://daily.dev/posts/fine-tune-llama-3-with-pytorch-fsdp-and-q-lora-on-amazon-sagemaker-v80iyqug8
source_url: https://www.philschmid.de/sagemaker-train-deploy-llama3
type: article
source: "Philipp Schmid"
published: 2026-05-31T07:41:25.678Z
updated: 2026-05-31T08:07:30.387Z
tags: ["aws", "deep-learning", "pytorch", "llama"]
reading_time: 8
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fine-tune Llama 3 with PyTorch FSDP and Q-Lora on Amazon SageMaker

**[Philipp Schmid](https://daily.dev/sources/philschmid)** · 8 min read · 0 upvotes · 0 comments

## Summary

Step-by-step guide to fine-tuning Llama 3 70B on Amazon SageMaker using PyTorch FSDP (Fully Sharded Data Parallel) and Q-LoRA with Hugging Face TRL, PEFT, and Flash Attention v2. Covers environment setup, dataset preparation using the no_robots dataset, launching a SageMaker training job on ml.p4d.24xlarge (8x A100 GPUs), and deploying the fine-tuned model to a SageMaker endpoint using the Hugging Face LLM Inference DLC with TGI. Training Llama 3 70B for 2 epochs on 10k samples takes ~84 minutes and costs ~$50.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.philschmid.de/sagemaker-train-deploy-llama3>

## Similar posts on daily.dev

- [Scale LLM fine-tuning with Hugging Face and Amazon SageMaker AI](https://daily.dev/posts/scale-llm-fine-tuning-with-hugging-face-and-amazon-sagemaker-ai-4tkqty16y) · AWS · 1 upvotes · 0 comments

---

Tags: [#aws](https://daily.dev/tags/aws), [#deep-learning](https://daily.dev/tags/deep-learning), [#pytorch](https://daily.dev/tags/pytorch), [#llama](https://daily.dev/tags/llama)

[View this post on daily.dev](https://daily.dev/posts/fine-tune-llama-3-with-pytorch-fsdp-and-q-lora-on-amazon-sagemaker-v80iyqug8)
