Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Using Hugging Face libraries on AMD GPUs","local":"using-hugging-face-libraries-on-amd-gpus","sections":[{"title":"Flash Attention 2","local":"flash-attention-2","sections":[],"depth":3},{"title":"GPTQ quantization","local":"gptq-quantization","sections":[],"depth":3},{"title":"Text Generation Inference library","local":"text-generation-inference-library","sections":[],"depth":3},{"title":"ONNX Runtime integration","local":"onnx-runtime-integration","sections":[],"depth":3},{"title":"Bitsandbytes quantization","local":"bitsandbytes-quantization","sections":[],"depth":3},{"title":"AWQ quantization","local":"awq-quantization","sections":[],"depth":3}],"depth":1}"> | |
| <link href="/docs/optimum.amd/pr_149/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/entry/start.554e2095.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/scheduler.7da89386.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/singletons.14434af1.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/paths.372e4583.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/entry/app.de596a17.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/index.0b7befd3.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/nodes/0.121538a6.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/nodes/2.c09a5192.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/CodeBlock.ce33a881.js"> | |
| <link rel="modulepreload" href="/docs/optimum.amd/pr_149/en/_app/immutable/chunks/Heading.8a936589.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"Using Hugging Face libraries on AMD GPUs","local":"using-hugging-face-libraries-on-amd-gpus","sections":[{"title":"Flash Attention 2","local":"flash-attention-2","sections":[],"depth":3},{"title":"GPTQ quantization","local":"gptq-quantization","sections":[],"depth":3},{"title":"Text Generation Inference library","local":"text-generation-inference-library","sections":[],"depth":3},{"title":"ONNX Runtime integration","local":"onnx-runtime-integration","sections":[],"depth":3},{"title":"Bitsandbytes quantization","local":"bitsandbytes-quantization","sections":[],"depth":3},{"title":"AWQ quantization","local":"awq-quantization","sections":[],"depth":3}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="using-hugging-face-libraries-on-amd-gpus" 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="#using-hugging-face-libraries-on-amd-gpus"><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>Using Hugging Face libraries on AMD GPUs</span></h1> <p data-svelte-h="svelte-132jk2a">Hugging Face libraries supports natively AMD Instinct MI210, MI250 and MI300 GPUs. For other <a href="https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html#supported-gpus" rel="nofollow">ROCm-powered</a> GPUs, the support has currently not been validated but most features are expected to be used smoothly.</p> <p data-svelte-h="svelte-1sg0g8a">The integration is summarized here.</p> <h3 class="relative group"><a id="flash-attention-2" 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="#flash-attention-2"><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>Flash Attention 2</span></h3> <p data-svelte-h="svelte-1pg6scu">Flash Attention 2 is available on ROCm (validated on MI210, MI250 and MI300) through <a href="https://github.com/ROCm/flash-attention" rel="nofollow">ROCm/flash-attention</a> library, and can be used in <a href="https://huggingface.co/docs/transformers/perf_infer_gpu_one#flashattention-2" rel="nofollow">Transformers</a>:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" 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> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM | |
| tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"tiiuae/falcon-7b"</span>) | |
| <span class="hljs-keyword">with</span> torch.device(<span class="hljs-string">"cuda"</span>): | |
| model = AutoModelForCausalLM.from_pretrained( | |
| <span class="hljs-string">"tiiuae/falcon-7b"</span>, | |
| torch_dtype=torch.float16, | |
| use_flash_attention_2=<span class="hljs-literal">True</span>, | |
| )<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-19055tf">We recommend using <a href="https://github.com/huggingface/optimum-amd/blob/main/docker/transformers-pytorch-amd-gpu-flash/Dockerfile" rel="nofollow">this example Dockerfile</a> to use Flash Attention on ROCm, or to follow the <a href="https://github.com/ROCm/flash-attention#amd-gpurocm-support" rel="nofollow">official installation instructions</a>.</p> <h3 class="relative group"><a id="gptq-quantization" 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="#gptq-quantization"><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>GPTQ quantization</span></h3> <p data-svelte-h="svelte-t4e3rq"><a href="https://arxiv.org/abs/2210.17323" rel="nofollow">GPTQ</a> quantized models can be loaded in Transformers, using in the backend <a href="https://github.com/PanQiWei/AutoGPTQ" rel="nofollow">AutoGPTQ library</a>:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" 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> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM | |
| tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"TheBloke/Llama-2-7B-Chat-GPTQ"</span>) | |
| <span class="hljs-keyword">with</span> torch.device(<span class="hljs-string">"cuda"</span>): | |
| model = AutoModelForCausalLM.from_pretrained( | |
| <span class="hljs-string">"TheBloke/Llama-2-7B-Chat-GPTQ"</span>, | |
| torch_dtype=torch.float16, | |
| )<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1o0et5u">Hosted wheels are available for ROCm, please check out the <a href="https://github.com/PanQiWei/AutoGPTQ#installation" rel="nofollow">installation instructions</a>.</p> <h3 class="relative group"><a id="text-generation-inference-library" 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="#text-generation-inference-library"><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>Text Generation Inference library</span></h3> <p data-svelte-h="svelte-1pvvv7a">Hugging Face’s <a href="https://huggingface.co/docs/text-generation-inference/index" rel="nofollow">Text Generation Inference</a> library (TGI) is designed for low latency LLMs serving, and natively supports AMD Instinct MI210, MI250 and MI3O0 GPUs. Please refer to the <a href="https://huggingface.co/docs/text-generation-inference/quicktour" rel="nofollow">Quick Tour section</a> for more details.</p> <p data-svelte-h="svelte-fr1yx3">Using TGI on ROCm with AMD Instinct MI210 or MI250 or MI300 GPUs is as simple as using the docker image <a href="https://huggingface.co/docs/text-generation-inference/quicktour" rel="nofollow"><code>ghcr.io/huggingface/text-generation-inference:latest-rocm</code></a>.</p> <p data-svelte-h="svelte-1emimjo">Detailed benchmarks of Text Generation Inference on MI300 GPUs will soon be published.</p> <h3 class="relative group"><a id="onnx-runtime-integration" 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="#onnx-runtime-integration"><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>ONNX Runtime integration</span></h3> <p data-svelte-h="svelte-plr0v3"><a href="https://huggingface.co/docs/optimum/onnxruntime/quickstart" rel="nofollow">🤗 Optimum</a> supports running <a href="https://github.com/huggingface/transformers" rel="nofollow">Transformers</a> and <a href="https://github.com/huggingface/diffusers" rel="nofollow">Diffusers</a> models through <a href="https://onnxruntime.ai/" rel="nofollow">ONNX Runtime</a> on ROCm-powered AMD GPUs. It is as simple as:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" 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> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer | |
| <span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTModelForSequenceClassification | |
| tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">"distilbert-base-uncased-finetuned-sst-2-english"</span>) | |
| ort_model = ORTModelForSequenceClassification.from_pretrained( | |
| <span class="hljs-string">"distilbert-base-uncased-finetuned-sst-2-english"</span>, | |
| export=<span class="hljs-literal">True</span>, | |
| provider=<span class="hljs-string">"ROCMExecutionProvider"</span>, | |
| ) | |
| inp = tokenizer(<span class="hljs-string">"Both the music and visual were astounding, not to mention the actors performance."</span>, return_tensors=<span class="hljs-string">"np"</span>) | |
| result = ort_model(**inp)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1shi8o8">Check out more details about the support in <a href="https://huggingface.co/docs/optimum/onnxruntime/usage_guides/amdgpu" rel="nofollow">this guide</a>.</p> <h3 class="relative group"><a id="bitsandbytes-quantization" 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="#bitsandbytes-quantization"><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>Bitsandbytes quantization</span></h3> <p data-svelte-h="svelte-1adal1e"><a href="https://github.com/TimDettmers/bitsandbytes" rel="nofollow">Bitsandbytes</a> (integrated in HF’s <a href="https://huggingface.co/docs/transformers/perf_infer_gpu_one#bitsandbytes" rel="nofollow">Transformers</a> and <a href="https://huggingface.co/docs/text-generation-inference/conceptual/quantization#quantization-with-bitsandbytes" rel="nofollow">Text Generation Inference</a>) currently does not officially support ROCm. We are working towards its validation on ROCm and through Hugging Face libraries.</p> <p data-svelte-h="svelte-fel4vv">Meanwhile, advanced users may want to use <a href="https://github.com/ROCm/bitsandbytes/tree/rocm_enabled" rel="nofollow">ROCm/bitsandbytes</a> fork for now. See <a href="https://github.com/TimDettmers/bitsandbytes/pull/756#issuecomment-2067761175" rel="nofollow">#issuecomment</a> for more details.</p> <h3 class="relative group"><a id="awq-quantization" 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="#awq-quantization"><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>AWQ quantization</span></h3> <p data-svelte-h="svelte-emcx42"><a href="https://arxiv.org/abs/2306.00978" rel="nofollow">AWQ</a> quantization, that is supported <a href="https://huggingface.co/docs/transformers/main_classes/quantization#awq-integration" rel="nofollow">in Transformers</a> and <a href="https://huggingface.co/docs/text-generation-inference/basic_tutorials/preparing_model#quantization" rel="nofollow">Text Generation Inference</a>, is now supported on AMD GPUs using Exllama kernels. With recent optimizations, the AWQ model is converted to Exllama/GPTQ format model at load time. This allows AMD ROCm devices to benefit from the high quality of AWQ checkpoints and the speed of ExllamaV2 kernels combined.</p> <p data-svelte-h="svelte-1qqpypl">See: <a href="https://github.com/casper-hansen/AutoAWQ/pull/313" rel="nofollow">AutoAWQ</a> for more details.</p> <p data-svelte-h="svelte-uykbt7">Note: Ensure that you have the same PyTorch version that was used to build the kernels.</p> <p></p> | |
| <script> | |
| { | |
| __sveltekit_c75107 = { | |
| assets: "/docs/optimum.amd/pr_149/en", | |
| base: "/docs/optimum.amd/pr_149/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/optimum.amd/pr_149/en/_app/immutable/entry/start.554e2095.js"), | |
| import("/docs/optimum.amd/pr_149/en/_app/immutable/entry/app.de596a17.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 2], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 22.7 kB
- Xet hash:
- d2e66250fe8bc4293adecd71e6adc2d1b794be649c99649d474438a4472ec811
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.