AI Cloud Architect

Scale LLM fine-tuning with Hugging Face and Amazon SageMaker AI

AWSHow-to by Florent Gbelidji, Bruno Pistone, Louise Ping and Safir AlviAWS Artificial Intelligence Blog

In this post, we show how this integrated approach transforms enterprise LLM fine-tuning from a complex, resource-intensive challenge into a streamlined, scalable solution for achieving better model performance in domain-specific applications.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Shows a supervised fine-tuning run of Llama 3.1 8B with QLoRA and FSDP on SageMaker Training Jobs, using Hugging Face Transformers, then deploys the result to a vLLM endpoint.

Who it is for

Teams fine-tuning open models on SageMaker AI that need a working template for distributed LoRA training and deployment.

Key points

  • Example uses ml.p4d.24xlarge training with a 10,000-row slice of the MedReason dataset, about 18 minutes per epoch per the post.
  • Post says the training job takes about 18 minutes for one epoch on 10,000 samples with Flash Attention 2.
  • Requires a Service Quotas increase for P4D training instances before running the notebook.

The same at other vendors

Timeline

  1. Customer storyHow Omada Health scaled patient care by fine-tuning Llama models on Amazon SageMaker AI · AWS · Customer story
  2. This postScale LLM fine-tuning with Hugging Face and Amazon SageMaker AI
  3. Customer storyTraining Azerbaijani language models on Amazon SageMaker AI · AWS · Customer story

Go deeper