Buckets:

hf-doc-build/doc / optimum-neuron /main /en /training_tutorials /fine_tune_llms_overview.html
rtrm's picture
download
raw
13.5 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;🚀 Tutorials: How To Fine-tune &amp; Run LLMs&quot;,&quot;local&quot;:&quot;-tutorials-how-to-fine-tune--run-llms&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;What you’ll learn&quot;,&quot;local&quot;:&quot;what-youll-learn&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/optimum.neuron/main/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/entry/start.d7b07195.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/scheduler.85c25b89.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/singletons.495d2583.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/paths.5293a5dd.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/entry/app.1aea30a4.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/index.c9bcf812.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/nodes/0.b8057440.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/nodes/46.b1d36e14.js">
<link rel="modulepreload" href="/docs/optimum.neuron/main/en/_app/immutable/chunks/getInferenceSnippets.0fb0b8ca.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;🚀 Tutorials: How To Fine-tune &amp; Run LLMs&quot;,&quot;local&quot;:&quot;-tutorials-how-to-fine-tune--run-llms&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;What you’ll learn&quot;,&quot;local&quot;:&quot;what-youll-learn&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="-tutorials-how-to-fine-tune--run-llms" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#-tutorials-how-to-fine-tune--run-llms"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>🚀 Tutorials: How To Fine-tune &amp; Run LLMs</span></h1> <p data-svelte-h="svelte-1qf0ci3">Learn how to run and fine-tune models for optimal performance with AWS Trainium.</p> <div style="display: grid !important; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important; gap: 24px !important; margin: 32px -32px !important; padding: 0 32px !important; max-width: none !important; width: calc(100% + 64px) !important;" data-svelte-h="svelte-h1scl"><a href="./sft_lora_finetune_llm" style="text-decoration: none !important; color: inherit !important; display: block !important;"><div style="border-radius: 8px !important; background-color: white !important; box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; transition: all 0.3s ease-in-out !important; cursor: pointer !important; display: flex !important; flex-direction: column !important; min-height: 200px !important; border: none !important;" onmouseover="this.style.transform='translateY(-4px)'; this.style.boxShadow='0 8px 24px rgba(0,0,0,0.15)'; this.querySelector('.card-content').style.backgroundPosition='0% 0'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 2px 8px rgba(0,0,0,0.1)'; this.querySelector('.card-content').style.backgroundPosition='100% 0'"><div style="height: 140px !important; min-height: 140px !important; background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%) !important; display: flex !important; align-items: center !important; justify-content: center !important; position: relative !important; border: none !important; margin: 0 !important; padding: 0 !important; border-radius: 8px 8px 0 0 !important; overflow: hidden !important;"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/optimum/neuron/training_tutorials/llama-logo.png" alt="Llama 3" style="width: 100% !important; height: 100% !important; object-fit: cover !important; border: none !important; border-radius: 8px 8px 0 0 !important;" onerror="this.outerHTML='<div style=\'color: white; font-size: 48px; font-weight: bold; z-index: 10;
position: relative;\'>🦙</div>'"></div> <div class="card-content" style="padding: 20px !important; background: white !important; background-image: linear-gradient(90deg, transparent 0%, #f8f9fa 50%, #e9ecef 100%) !important; background-size: 200% 100% !important; background-position: 100% 0 !important; transition: background-position 0.4s ease-out !important; width: 100% !important; box-sizing: border-box !important; flex: 1 !important; border: none !important; margin: 0 !important; border-radius: 0 0 8px 8px !important;"><h3 style="margin: 0 0 8px 0 !important; font-size: 18px !important; font-weight: 600 !important; color: #24292e !important;">Llama 3</h3> <p style="margin: 0 !important; font-size: 14px !important; color: #586069 !important; line-height: 1.4 !important;">Fine-tune Llama 3 8B with LoRA</p></div></div></a> <a href="./finetune_qwen3" style="text-decoration: none !important; color: inherit !important; display: block !important;"><div style="border-radius: 8px !important; background-color: white !important; box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; transition: all 0.3s ease-in-out !important; cursor: pointer !important; display: flex !important; flex-direction: column !important; min-height: 200px !important; border: none !important;" onmouseover="this.style.transform='translateY(-4px)'; this.style.boxShadow='0 8px 24px rgba(0,0,0,0.15)'; this.querySelector('.card-content').style.backgroundPosition='0% 0'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 2px 8px rgba(0,0,0,0.1)';
this.querySelector('.card-content').style.backgroundPosition='100% 0'"><div style="height: 140px !important; min-height: 140px !important; background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%) !important; display: flex !important; align-items: center !important; justify-content: center !important; position: relative !important; border: none !important; margin: 0 !important; padding: 0 !important; border-radius: 8px 8px 0 0 !important; overflow: hidden !important;"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/optimum/neuron/training_tutorials/qwen3-logo.png" alt="Qwen3" style="width: 100% !important; height: 100% !important; object-fit: cover !important; border: none !important; border-radius: 8px 8px 0 0 !important;" onerror="this.outerHTML='<div style=\'color: white; font-size: 48px;
font-weight: bold; z-index: 10; position: relative;\'>🔷</div>'"></div> <div class="card-content" style="padding: 20px !important; background: white !important; background-image: linear-gradient(90deg, transparent 0%, #f8f9fa 50%, #e9ecef 100%) !important; background-size: 200% 100% !important; background-position: 100% 0 !important; transition: background-position 0.4s ease-out !important; width: 100% !important; box-sizing: border-box !important; flex: 1 !important; border: none !important; margin: 0 !important; border-radius: 0 0 8px 8px !important;"><h3 style="margin: 0 0 8px 0 !important; font-size: 18px !important; font-weight: 600 !important; color: #24292e !important;">Qwen 3</h3> <p style="margin: 0 !important; font-size: 14px !important; color: #586069 !important; line-height: 1.4 !important;">Fine-tune Qwen3 8B with LoRA</p></div></div></a> <a href="./pretraining_hyperpod_llm" style="text-decoration: none !important; color: inherit !important; display: block !important;"><div style="border-radius: 8px !important; background-color: white !important; box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important; transition: all 0.3s ease-in-out !important; cursor: pointer !important; display: flex !important; flex-direction: column !important; min-height: 200px !important; border: none !important;" onmouseover="this.style.transform='translateY(-4px)'; this.style.boxShadow='0 8px 24px rgba(0,0,0,0.15)'; this.querySelector('.card-content').style.backgroundPosition='0% 0'" onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 2px 8px rgba(0,0,0,0.1)';
this.querySelector('.card-content').style.backgroundPosition='100% 0'"><div style="height: 140px !important; min-height: 140px !important; background: linear-gradient(135deg, #059669 0%, #0891b2 100%) !important; display: flex !important; align-items: center !important; justify-content: center !important; position: relative !important; border: none !important; margin: 0 !important; padding: 0 !important; border-radius: 8px 8px 0 0 !important; overflow: hidden !important;"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/optimum/neuron/training_tutorials/sagemaker-logo.png" alt="SageMaker Hyperpod" style="width: 100% !important; height: 100% !important; object-fit: cover !important; border: none !important; border-radius: 8px 8px 0 0 !important;" onerror="this.outerHTML='<div style=\'color: white; font-size: 28px;
font-weight: bold; text-align: center; z-index: 10; position: relative;\'>☁️<br/>SageMaker</div>'"></div> <div class="card-content" style="padding: 20px !important; background: white !important; background-image: linear-gradient(90deg, transparent 0%, #f8f9fa 50%, #e9ecef 100%) !important; background-size: 200% 100% !important; background-position: 100% 0 !important; transition: background-position 0.4s ease-out !important; width: 100% !important; box-sizing: border-box !important; flex: 1 !important; border: none !important; margin: 0 !important; border-radius: 0 0 8px 8px !important;"><h3 style="margin: 0 0 8px 0 !important; font-size: 18px !important; font-weight: 600 !important; color: #24292e !important;">Llama 3.2 on SageMaker</h3> <p style="margin: 0 !important; font-size: 14px !important; color: #586069 !important; line-height: 1.4 !important;">Continuous Pretrain Llama 3.2 1B on SageMaker Hyperpod</p></div></div></a></div> <h2 class="relative group"><a id="what-youll-learn" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#what-youll-learn"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>What you’ll learn</span></h2> <p data-svelte-h="svelte-1wtbpo2">These tutorials will guide you through the complete process of fine-tuning large language models on AWS Trainium:</p> <ul data-svelte-h="svelte-1zufjx"><li><strong>📊 Data Preparation</strong>: Load and preprocess datasets for supervised fine-tuning</li> <li><strong>🔧 Model Configuration</strong>: Set up LoRA adapters and distributed training parameters</li> <li><strong>⚡ Training Optimization</strong>: Leverage tensor parallelism, gradient checkpointing, and mixed precision</li> <li><strong>💾 Checkpoint Management</strong>: Consolidate and merge model checkpoints for deployment</li> <li><strong>🚀 Model Deployment</strong>: Export and test your fine-tuned models for inference</li></ul> <p data-svelte-h="svelte-11li9sy">Choose the tutorial that best fits your use case and start fine-tuning your LLMs on AWS Trainium today!</p> <p></p>
<script>
{
__sveltekit_l6d1zz = {
assets: "/docs/optimum.neuron/main/en",
base: "/docs/optimum.neuron/main/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/optimum.neuron/main/en/_app/immutable/entry/start.d7b07195.js"),
import("/docs/optimum.neuron/main/en/_app/immutable/entry/app.1aea30a4.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 46],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
13.5 kB
·
Xet hash:
8ac28ccf2bcb0bf7295b4dc4be75371a11f57de71506bf416fcd4463f8611630

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.