Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"๐ Tutorials: How To Fine-tune & Run LLMs","local":"-tutorials-how-to-fine-tune--run-llms","sections":[{"title":"What youโll learn","local":"what-youll-learn","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/entry/start.40e9a376.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/scheduler.56725da7.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/singletons.803151f8.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/paths.316b9bfe.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/entry/app.0fb5ce66.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/preload-helper.b93cc304.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/index.18a26576.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/nodes/0.3130ff89.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/nodes/47.e62fd6f0.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/CopyLLMTxtMenu.4513c8ed.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/globals.7f7f1b26.js"> | |
| <link rel="modulepreload" href="/docs/optimum.neuron/v0.4.4/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.049405bf.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"๐ Tutorials: How To Fine-tune & Run LLMs","local":"-tutorials-how-to-fine-tune--run-llms","sections":[{"title":"What youโll learn","local":"what-youll-learn","sections":[],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 max-sm:gap-0.5 h-6 max-sm:h-5 px-2 max-sm:px-1.5 text-[11px] max-sm:text-[9px] font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0"><svg class="w-3 h-3 max-sm:w-2.5 max-sm:h-2.5" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-6 max-sm:h-5 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible w-3 h-3 max-sm:w-2.5 max-sm:h-2.5 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <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 & 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(400px, 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-12hlu8q"><a href="./finetune_llama" 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; height: 280px !important; width: 100% !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: 180px !important; width: 100% !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.1</h3> <p style="margin: 0 !important; font-size: 14px !important; color: #586069 !important; line-height: 1.4 !important;">Instruction Fine-tuning of Llama 3.1 8B with LoRA on the Dolly dataset</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; height: 280px !important; width: 100% !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: 180px !important; width: 100% !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;">Qwen3</h3> <p style="margin: 0 !important; font-size: 14px !important; color: #586069 !important; line-height: 1.4 !important;">Fine-tune Qwen3 8B with LoRA on the Simple Recipes dataset</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; height: 280px !important; width: 100% !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: 180px !important; width: 100% !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 Pretraining of 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_wi4mep = { | |
| assets: "/docs/optimum.neuron/v0.4.4/en", | |
| base: "/docs/optimum.neuron/v0.4.4/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/optimum.neuron/v0.4.4/en/_app/immutable/entry/start.40e9a376.js"), | |
| import("/docs/optimum.neuron/v0.4.4/en/_app/immutable/entry/app.0fb5ce66.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 47], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 16 kB
- Xet hash:
- 6f6234dc26c19cbb8ba85206b850af38867fc25efcd67b19d31196d69f321bbf
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.