Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"The Command Line","local":"the-command-line","sections":[{"title":"accelerate config","local":"accelerate-config","sections":[],"depth":2},{"title":"accelerate config default","local":"accelerate-config-default","sections":[],"depth":2},{"title":"accelerate config update","local":"accelerate-config-update","sections":[],"depth":2},{"title":"accelerate env","local":"accelerate-env","sections":[],"depth":2},{"title":"accelerate launch","local":"accelerate-launch","sections":[],"depth":2},{"title":"accelerate estimate-memory","local":"accelerate-estimate-memory","sections":[],"depth":2},{"title":"accelerate tpu-config","local":"accelerate-tpu-config","sections":[],"depth":2},{"title":"accelerate test","local":"accelerate-test","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/accelerate/pr_4021/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/entry/start.8a49e72b.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/scheduler.b9285784.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/singletons.7547c222.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/index.6d423e5c.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/paths.d42c9205.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/entry/app.1df4d18e.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/preload-helper.b0bd19d1.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/index.26bc89a1.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/nodes/0.0e7c56e8.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/nodes/24.4c6caa0c.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/Tip.e4eba3d6.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.7a0ae628.js"> | |
| <link rel="modulepreload" href="/docs/accelerate/pr_4021/en/_app/immutable/chunks/CodeBlock.844ff9c3.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"The Command Line","local":"the-command-line","sections":[{"title":"accelerate config","local":"accelerate-config","sections":[],"depth":2},{"title":"accelerate config default","local":"accelerate-config-default","sections":[],"depth":2},{"title":"accelerate config update","local":"accelerate-config-update","sections":[],"depth":2},{"title":"accelerate env","local":"accelerate-env","sections":[],"depth":2},{"title":"accelerate launch","local":"accelerate-launch","sections":[],"depth":2},{"title":"accelerate estimate-memory","local":"accelerate-estimate-memory","sections":[],"depth":2},{"title":"accelerate tpu-config","local":"accelerate-tpu-config","sections":[],"depth":2},{"title":"accelerate test","local":"accelerate-test","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 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm 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 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" 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-7 max-sm:h-7 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 sm:size-3.5 size-3 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="the-command-line" 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="#the-command-line"><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>The Command Line</span></h1> <p data-svelte-h="svelte-287hrg">Below is a list of all the available commands 🤗 Accelerate with their parameters</p> <h2 class="relative group"><a id="accelerate-config" 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="#accelerate-config"><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>accelerate config</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-11eeiwm"><code>accelerate config</code> or <code>accelerate-config</code></p> <p data-svelte-h="svelte-kgxwdm">Launches a series of prompts to create and save a <code>default_config.yml</code> configuration file for your training system. Should | |
| always be ran first on your machine.</p> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate config [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1t9k4rg"><li><code>--config_file CONFIG_FILE</code> (<code>str</code>) — The path to use to store the config file. Will default to a file named default_config.yaml in the cache location, which is the content | |
| of the environment <code>HF_HOME</code> suffixed with ‘accelerate’, or if you don’t have such an environment variable, your cache directory | |
| (<code>~/.cache</code> or the content of <code>XDG_CACHE_HOME</code>) suffixed with <code>huggingface</code>.</li> <li><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</li></ul> <h2 class="relative group"><a id="accelerate-config-default" 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="#accelerate-config-default"><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>accelerate config default</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-1ya9ime"><code>accelerate config default</code> or <code>accelerate-config default</code></p> <p data-svelte-h="svelte-1p3g1ck">Create a default config file for Accelerate with only a few flags set.</p> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate config default [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1kahcwy"><li><p><code>--config_file CONFIG_FILE</code> (<code>str</code>) — The path to use to store the config file. Will default to a file named default_config.yaml in the cache location, which is the content | |
| of the environment <code>HF_HOME</code> suffixed with ‘accelerate’, or if you don’t have such an environment variable, your cache directory | |
| (<code>~/.cache</code> or the content of <code>XDG_CACHE_HOME</code>) suffixed with <code>huggingface</code>.</p></li> <li><p><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</p></li> <li><p><code>--mixed_precision {no,fp16,bf16}</code> (<code>str</code>) — Whether or not to use mixed precision training. Choose between FP16 and BF16 (bfloat16) training. BF16 training is only supported on Nvidia Ampere GPUs and PyTorch 1.10 or later.</p></li></ul> <h2 class="relative group"><a id="accelerate-config-update" 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="#accelerate-config-update"><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>accelerate config update</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-1uu6mfo"><code>accelerate config update</code> or <code>accelerate-config update</code></p> <p data-svelte-h="svelte-gr2xwb">Update an existing config file with the latest defaults while maintaining the old configuration.</p> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate config update [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-12kmznp"><li><p><code>--config_file CONFIG_FILE</code> (<code>str</code>) — The path to the config file to update. Will default to a file named default_config.yaml in the cache location, which is the content | |
| of the environment <code>HF_HOME</code> suffixed with ‘accelerate’, or if you don’t have such an environment variable, your cache directory | |
| (<code>~/.cache</code> or the content of <code>XDG_CACHE_HOME</code>) suffixed with <code>huggingface</code>.</p></li> <li><p><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</p></li></ul> <h2 class="relative group"><a id="accelerate-env" 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="#accelerate-env"><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>accelerate env</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-1u4szci"><code>accelerate env</code> or <code>accelerate-env</code> or <code>python -m accelerate.commands.env</code></p> <p data-svelte-h="svelte-1yje0s6">Lists the contents of the passed 🤗 Accelerate configuration file. Should always be used when opening an issue on the <a href="https://github.com/huggingface/accelerate" rel="nofollow">GitHub repository</a>.</p> <p data-svelte-h="svelte-1em5vys"><strong>Usage</strong>:</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 -->accelerate <span class="hljs-built_in">env</span> [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1t9k4rg"><li><code>--config_file CONFIG_FILE</code> (<code>str</code>) — The path to use to store the config file. Will default to a file named default_config.yaml in the cache location, which is the content | |
| of the environment <code>HF_HOME</code> suffixed with ‘accelerate’, or if you don’t have such an environment variable, your cache directory | |
| (<code>~/.cache</code> or the content of <code>XDG_CACHE_HOME</code>) suffixed with <code>huggingface</code>.</li> <li><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</li></ul> <h2 class="relative group"><a id="accelerate-launch" 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="#accelerate-launch"><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>accelerate launch</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-i1hn22"><code>accelerate launch</code> or <code>accelerate-launch</code> or <code>python -m accelerate.commands.launch</code></p> <p data-svelte-h="svelte-tkin7w">Launches a specified script on a distributed system with the right parameters.</p> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate launch [arguments] {training_script} --{training_script-argument-1} --{training_script-argument-2} ...<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-13wlgsp"><strong>Positional Arguments</strong>:</p> <ul data-svelte-h="svelte-1ix43sh"><li><code>{training_script}</code> — The full path to the script to be launched in parallel</li> <li><code>--{training_script-argument-1}</code> — Arguments of the training script</li></ul> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1vwa43c"><li><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</li> <li><code>--config_file CONFIG_FILE</code> (<code>str</code>)— The config file to use for the default values in the launching script.</li> <li><code>-m</code>, <code>--module</code> (<code>bool</code>) — Change each process to interpret the launch script as a Python module, executing with the same behavior as ‘python -m’.</li> <li><code>--no_python</code> (<code>bool</code>) — Skip prepending the training script with ‘python’ - just execute it directly. Useful when the script is not a Python script.</li> <li><code>--debug</code> (<code>bool</code>) — Whether to print out the torch.distributed stack trace when something fails.</li> <li><code>-q</code>, <code>--quiet</code> (<code>bool</code>) — Silence subprocess errors from the launch stack trace to only show the relevant tracebacks. (Only applicable to DeepSpeed and single-process configurations).</li></ul> <p data-svelte-h="svelte-1uvdklx">The rest of these arguments are configured through <code>accelerate config</code> and are read in from the specified <code>--config_file</code> (or default configuration) for their | |
| values. They can also be passed in manually.</p> <p data-svelte-h="svelte-whc1mx"><strong>Hardware Selection Arguments</strong>:</p> <ul data-svelte-h="svelte-gym275"><li><code>--cpu</code> (<code>bool</code>) — Whether or not to force the training on the CPU.</li> <li><code>--multi_gpu</code> (<code>bool</code>) — Whether or not this should launch a distributed GPU training.</li> <li><code>--tpu</code> (<code>bool</code>) — Whether or not this should launch a TPU training.</li></ul> <p data-svelte-h="svelte-lq5nqd"><strong>Resource Selection Arguments</strong>:</p> <p data-svelte-h="svelte-1vwbu7z">The following arguments are useful for fine-tuning how available hardware should be used</p> <ul data-svelte-h="svelte-1sola5w"><li><code>--mixed_precision {no,fp16,bf16,fp8}</code> (<code>str</code>) — Whether or not to use mixed precision training. Choose between FP16 and BF16 (bfloat16) training. BF16 training is only supported on Nvidia Ampere GPUs and PyTorch 1.10 or later.</li> <li><code>--num_processes NUM_PROCESSES</code> (<code>int</code>) — The total number of processes to be launched in parallel.</li> <li><code>--num_machines NUM_MACHINES</code> (<code>int</code>) — The total number of machines used in this training.</li> <li><code>--num_cpu_threads_per_process NUM_CPU_THREADS_PER_PROCESS</code> (<code>int</code>) — The number of CPU threads per process. Can be tuned for optimal performance.</li> <li><code>--enable_cpu_affinity</code> (<code>bool</code>) — Whether or not CPU affinity and balancing should be enabled. Currently only supported on NVIDIA hardware.</li></ul> <p data-svelte-h="svelte-16acm8k"><strong>Training Paradigm Arguments</strong>:</p> <p data-svelte-h="svelte-1623fyb">The following arguments are useful for selecting which training paradigm to use.</p> <ul data-svelte-h="svelte-1b4ulb7"><li><code>--use_deepspeed</code> (<code>bool</code>) — Whether or not to use DeepSpeed for training.</li> <li><code>--use_fsdp</code> (<code>bool</code>) — Whether or not to use FullyShardedDataParallel for training.</li> <li><code>--use_megatron_lm</code> (<code>bool</code>) — Whether or not to use Megatron-LM for training.</li></ul> <p data-svelte-h="svelte-r49e0o"><strong>Distributed GPU Arguments</strong>:</p> <p data-svelte-h="svelte-b18b01">The following arguments are only useful when <code>multi_gpu</code> is passed or multi-gpu training is configured through <code>accelerate config</code>:</p> <ul data-svelte-h="svelte-18786ro"><li><code>--gpu_ids</code> (<code>str</code>) — What GPUs (by id) should be used for training on this machine as a comma-separated list</li> <li><code>--same_network</code> (<code>bool</code>) — Whether all machines used for multinode training exist on the same local network.</li> <li><code>--machine_rank</code> (<code>int</code>) — The rank of the machine on which this script is launched.</li> <li><code>--main_process_ip</code> (<code>str</code>) — The IP address of the machine of rank 0.</li> <li><code>--main_process_port</code> (<code>int</code>) — The port to use to communicate with the machine of rank 0.</li> <li><code>-t</code>, <code>--tee</code> (<code>str</code>) — Tee std streams into a log file and also to console.</li> <li><code>--log_dir</code> (<code>str</code>) — Base directory to use for log files when using torchrun/torch.distributed.run as launcher. Use with —tee to redirect std streams info log files.</li> <li><code>--role</code> (<code>str</code>) — User-defined role for the workers.</li> <li><code>--rdzv_backend</code> (<code>str</code>) — The rendezvous method to use, such as ‘static’ (the default) or ‘c10d’</li> <li><code>--rdzv_conf</code> (<code>str</code>) — Additional rendezvous configuration (<key1>=<value1>,<key2>=<value2>,…).</li> <li><code>--max_restarts</code> (<code>int</code>) — Maximum number of worker group restarts before failing.</li> <li><code>--monitor_interval</code> (<code>int</code>) — Interval, in seconds, to monitor the state of workers.</li></ul> <p data-svelte-h="svelte-11uca04"><strong>TPU Arguments</strong>:</p> <p data-svelte-h="svelte-1deq743">The following arguments are only useful when <code>tpu</code> is passed or TPU training is configured through <code>accelerate config</code>:</p> <ul data-svelte-h="svelte-1tn4n3x"><li><code>--tpu_cluster</code> (<code>bool</code>) — Whether to use a GCP TPU pod for training.</li> <li><code>--tpu_use_sudo</code> (<code>bool</code>) — Whether to use <code>sudo</code> when running the TPU training script in each pod.</li> <li><code>--vm</code> (<code>str</code>) — List of single Compute VM instance names. If not provided we assume usage of instance groups. For TPU pods.</li> <li><code>--env</code> (<code>str</code>) — List of environment variables to set on the Compute VM instances. For TPU pods.</li> <li><code>--main_training_function</code> (<code>str</code>) — The name of the main function to be executed in your script (only for TPU training).</li> <li><code>--downcast_bf16</code> (<code>bool</code>) — Whether when using bf16 precision on TPUs if both float and double tensors are cast to bfloat16 or if double tensors remain as float32.</li></ul> <p data-svelte-h="svelte-1in1mqm"><strong>DeepSpeed Arguments</strong>:</p> <p data-svelte-h="svelte-4pgx8a">The following arguments are only useful when <code>use_deepspeed</code> is passed or <code>deepspeed</code> is configured through <code>accelerate config</code>:</p> <ul data-svelte-h="svelte-7hdtzg"><li><code>--deepspeed_config_file</code> (<code>str</code>) — DeepSpeed config file.</li> <li><code>--zero_stage</code> (<code>int</code>) — DeepSpeed’s ZeRO optimization stage.</li> <li><code>--offload_optimizer_device</code> (<code>str</code>) — Decides where (none|cpu|nvme) to offload optimizer states.</li> <li><code>--offload_param_device</code> (<code>str</code>) — Decides where (none|cpu|nvme) to offload parameters.</li> <li><code>--offload_optimizer_nvme_path</code> (<code>str</code>) — Decides Nvme Path to offload optimizer states.</li> <li><code>--gradient_accumulation_steps</code> (<code>int</code>) — No of gradient_accumulation_steps used in your training script.</li> <li><code>--gradient_clipping</code> (<code>float</code>) — Gradient clipping value used in your training script.</li> <li><code>--zero3_init_flag</code> (<code>str</code>) — Decides Whether (true|false) to enable <code>deepspeed.zero.Init</code> for constructing massive models. Only applicable with DeepSpeed ZeRO Stage-3.</li> <li><code>--zero3_save_16bit_model</code> (<code>str</code>) — Decides Whether (true|false) to save 16-bit model weights when using ZeRO Stage-3. Only applicable with DeepSpeed ZeRO Stage-3.</li> <li><code>--deepspeed_hostfile</code> (<code>str</code>) — DeepSpeed hostfile for configuring multi-node compute resources.</li> <li><code>--deepspeed_exclusion_filter</code> (<code>str</code>) — DeepSpeed exclusion filter string when using multi-node setup.</li> <li><code>--deepspeed_inclusion_filter</code> (<code>str</code>) — DeepSpeed inclusion filter string when using multi-node setup.</li> <li><code>--deepspeed_multinode_launcher</code> (<code>str</code>) — DeepSpeed multi-node launcher to use.</li> <li><code>--deepspeed_moe_layer_cls_names</code> (<code>str</code>) — comma-separated list of transformer MoE layer class names (case-sensitive) to wrap, e.g, <code>MixtralSparseMoeBlock</code> <code>Qwen2MoeSparseMoeBlock</code>, <code>JetMoEAttention,JetMoEBlock</code></li></ul> <p data-svelte-h="svelte-1yxqy98"><strong>Fully Sharded Data Parallelism Arguments</strong>:</p> <p data-svelte-h="svelte-euk5b5">The following arguments are only useful when <code>use_fsdp</code> is passed or Fully Sharded Data Parallelism is configured through <code>accelerate config</code>:</p> <ul data-svelte-h="svelte-1xzwjg3"><li><code>--fsdp_offload_params</code> (<code>str</code>) — Decides Whether (true|false) to offload parameters and gradients to CPU.</li> <li><code>--fsdp_min_num_params</code> (<code>int</code>) — FSDP’s minimum number of parameters for Default Auto Wrapping.</li> <li><code>--fsdp_sharding_strategy</code> (<code>int</code>) — FSDP’s Sharding Strategy.</li> <li><code>--fsdp_auto_wrap_policy</code> (<code>str</code>) — FSDP’s auto wrap policy.</li> <li><code>--fsdp_transformer_layer_cls_to_wrap</code> (<code>str</code>) — Transformer layer class name (case-sensitive) to wrap, e.g, <code>BertLayer</code>, <code>GPTJBlock</code>, <code>T5Block</code> …</li> <li><code>--fsdp_backward_prefetch_policy</code> (<code>str</code>) — FSDP’s backward prefetch policy.</li> <li><code>--fsdp_state_dict_type</code> (<code>str</code>) — FSDP’s state dict type.</li> <li><code>--fsdp_forward_prefetch</code> (<code>str</code>) — FSDP forward prefetch.</li> <li><code>--fsdp_use_orig_params</code> (<code>str</code>) — If True, allows non-uniform <code>requires_grad</code> mixed in a FSDP unit.</li> <li><code>--fsdp_cpu_ram_efficient_loading</code> (<code>str</code>) — If true, only the first process loads the pretrained model checkoint while all other processes have empty weights. When using this, <code>--fsdp_sync_module_states</code> needs to True.</li> <li><code>--fsdp_sync_module_states</code> (<code>str</code>) — If true, each individually wrapped FSDP unit will broadcast module parameters from rank 0.</li> <li><code>--fsdp_activation_checkpointing</code> (<code>bool</code>) — Decides Whether intermediate activations are freed during the forward pass, and a checkpoint is left as a placeholder</li></ul> <p data-svelte-h="svelte-1cugvo"><strong>Megatron-LM Arguments</strong>:</p> <p data-svelte-h="svelte-1j7p5ox">The following arguments are only useful when <code>use_megatron_lm</code> is passed or Megatron-LM is configured through <code>accelerate config</code>:</p> <ul data-svelte-h="svelte-hnwi8d"><li><code>--megatron_lm_tp_degree</code> (“) — Megatron-LM’s Tensor Parallelism (TP) degree.</li> <li><code>--megatron_lm_pp_degree</code> (“) — Megatron-LM’s Pipeline Parallelism (PP) degree.</li> <li><code>--megatron_lm_num_micro_batches</code> (“) — Megatron-LM’s number of micro batches when PP degree > 1.</li> <li><code>--megatron_lm_sequence_parallelism</code> (“) — Decides Whether (true|false) to enable Sequence Parallelism when TP degree > 1.</li> <li><code>--megatron_lm_recompute_activations</code> (“) — Decides Whether (true|false) to enable Selective Activation Recomputation.</li> <li><code>--megatron_lm_use_distributed_optimizer</code> (“) — Decides Whether (true|false) to use distributed optimizer which shards optimizer state and gradients across Data Parallel (DP) ranks.</li> <li><code>--megatron_lm_gradient_clipping</code> (“) — Megatron-LM’s gradient clipping value based on global L2 Norm (0 to disable).</li></ul> <p data-svelte-h="svelte-1nansw9"><strong>FP8 Arguments</strong>:</p> <ul data-svelte-h="svelte-2r9a51"><li><code>--fp8_backend</code> (<code>str</code>) — Choose a backend to train with FP8 (<code>te</code> or <code>msamp</code>)</li> <li><code>--fp8_use_autocast_during_eval</code> (<code>bool</code>) — Whether to use FP8 autocast during eval mode (useful only when <code>--fp8_backend=te</code> is passed). Generally better metrics are found when this is not passed.</li> <li><code>--fp8_margin</code> (<code>int</code>) — The margin to use for the gradient scaling (useful only when <code>--fp8_backend=te</code> is passed).</li> <li><code>--fp8_interval</code> (<code>int</code>) — The interval to use for how often the scaling factor is recomputed (useful only when <code>--fp8_backend=te</code> is passed).</li> <li><code>--fp8_format</code> (<code>str</code>) — The format to use for the FP8 recipe (useful only when <code>--fp8_backend=te</code> is passed).</li> <li><code>--fp8_amax_history_len</code> (<code>int</code>) — The length of the history to use for the scaling factor computation (useful only when <code>--fp8_backend=te</code> is passed).</li> <li><code>--fp8_amax_compute_algo</code> (<code>str</code>) — The algorithm to use for the scaling factor computation. (useful only when <code>--fp8_backend=te</code> is passed).</li> <li><code>--fp8_override_linear_precision</code> (<code>Tuple[bool, bool, bool]</code>) — Whether or not to execute <code>fprop</code>, <code>dgrad</code>, and <code>wgrad</code> GEMMS in higher precision.</li> <li><code>--fp8_opt_level</code> (<code>str</code>) — What level of 8-bit collective communication should be used with MS-AMP (useful only when <code>--fp8_backend=msamp</code> is passed)</li></ul> <p data-svelte-h="svelte-of8onu"><strong>AWS SageMaker Arguments</strong>:</p> <p data-svelte-h="svelte-yjat11">The following arguments are only useful when training in SageMaker</p> <ul data-svelte-h="svelte-2veuw9"><li><code>--aws_access_key_id AWS_ACCESS_KEY_ID</code> (<code>str</code>) — The AWS_ACCESS_KEY_ID used to launch the Amazon SageMaker training job</li> <li><code>--aws_secret_access_key AWS_SECRET_ACCESS_KEY</code> (<code>str</code>) — The AWS_SECRET_ACCESS_KEY used to launch the Amazon SageMaker training job</li></ul> <h2 class="relative group"><a id="accelerate-estimate-memory" 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="#accelerate-estimate-memory"><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>accelerate estimate-memory</span></h2> <p data-svelte-h="svelte-hesuq"><strong>Command</strong>:</p> <p data-svelte-h="svelte-27b9q9"><code>accelerate estimate-memory</code> or <code>accelerate-estimate-memory</code> or <code>python -m accelerate.commands.estimate</code></p> <p data-svelte-h="svelte-nvttdh">Estimates the total vRAM a particular model hosted on the Hub needs to be loaded in with an estimate for training. Requires that <code>huggingface_hub</code> be installed.</p> <blockquote class="tip"><p data-svelte-h="svelte-1be8h31">When performing inference, typically add ≤20% to the result as overall allocation <a href="https://blog.eleuther.ai/transformer-math/" rel="nofollow">as referenced here</a>. We will have more extensive estimations in the future that will automatically be included in the calculation.</p></blockquote> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate estimate-memory {MODEL_NAME} --library_name {LIBRARY_NAME} --dtypes {dtype_1} {dtype_2} ...<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-bqr020"><strong>Required Arguments</strong>:</p> <ul data-svelte-h="svelte-w83fsu"><li><code>MODEL_NAME</code> (<code>str</code>)— The model name on the Hugging Face Hub</li></ul> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-v3tot3"><li><code>--library_name {timm,transformers}</code> (<code>str</code>) — The library the model has an integration with, such as <code>transformers</code>, needed only if this information is not stored on the Hub</li> <li><code>--dtypes {float32,float16,int8,int4}</code> (<code>[{float32,float16,int8,int4} ...]</code>) — The dtypes to use for the model, must be one (or many) of <code>float32</code>, <code>float16</code>, <code>int8</code>, and <code>int4</code></li> <li><code>--trust_remote_code</code> (<code>bool</code>) — Whether or not to allow for custom models defined on the Hub in their own modeling files. This option should only be passed for repositories you trust and in which you have read the code, as it will execute code present on the Hub on your local machine.</li></ul> <h2 class="relative group"><a id="accelerate-tpu-config" 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="#accelerate-tpu-config"><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>accelerate tpu-config</span></h2> <p data-svelte-h="svelte-u0yd3a"><code>accelerate tpu-config</code></p> <p data-svelte-h="svelte-1em5vys"><strong>Usage</strong>:</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 -->accelerate tpu-config [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1lh8v6o"><li><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</li></ul> <p data-svelte-h="svelte-tmmfqh"><strong>Config Arguments</strong>:</p> <p data-svelte-h="svelte-1tcbuud">Arguments that can be configured through <code>accelerate config</code>.</p> <ul data-svelte-h="svelte-p32m48"><li><code>--config_file</code> (<code>str</code>) — Path to the config file to use for accelerate.</li> <li><code>--tpu_name</code> (<code>str</code>) — The name of the TPU to use. If not specified, will use the TPU specified in the config file.</li> <li><code>--tpu_zone</code> (<code>str</code>) — The zone of the TPU to use. If not specified, will use the zone specified in the config file.</li></ul> <p data-svelte-h="svelte-11uca04"><strong>TPU Arguments</strong>:</p> <p data-svelte-h="svelte-922q0y">Arguments for options ran inside the TPU.</p> <ul data-svelte-h="svelte-19ykwnn"><li><code>--command_file</code> (<code>str</code>) — The path to the file containing the commands to run on the pod on startup.</li> <li><code>--command</code> (<code>str</code>) — A command to run on the pod. Can be passed multiple times.</li> <li><code>--install_accelerate</code> (<code>bool</code>) — Whether to install accelerate on the pod. Defaults to False.</li> <li><code>--accelerate_version</code> (<code>str</code>) — The version of accelerate to install on the pod. If not specified, will use the latest pypi version. Specify ‘dev’ to install from GitHub.</li> <li><code>--debug</code> (<code>bool</code>) — If set, will print the command that would be run instead of running it.</li></ul> <h2 class="relative group"><a id="accelerate-test" 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="#accelerate-test"><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>accelerate test</span></h2> <p data-svelte-h="svelte-1xskt0e"><code>accelerate test</code> or <code>accelerate-test</code></p> <p data-svelte-h="svelte-4elx13">Runs <code>accelerate/test_utils/test_script.py</code> to verify that 🤗 Accelerate has been properly configured on your system and runs.</p> <p data-svelte-h="svelte-1kdd4yo"><strong>Usage</strong>:</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 -->accelerate <span class="hljs-built_in">test</span> [arguments]<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1bynztn"><strong>Optional Arguments</strong>:</p> <ul data-svelte-h="svelte-1t9k4rg"><li><code>--config_file CONFIG_FILE</code> (<code>str</code>) — The path to use to store the config file. Will default to a file named default_config.yaml in the cache location, which is the content | |
| of the environment <code>HF_HOME</code> suffixed with ‘accelerate’, or if you don’t have such an environment variable, your cache directory | |
| (<code>~/.cache</code> or the content of <code>XDG_CACHE_HOME</code>) suffixed with <code>huggingface</code>.</li> <li><code>-h</code>, <code>--help</code> (<code>bool</code>) — Show a help message and exit</li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/accelerate/blob/main/docs/source/package_reference/cli.md" target="_blank"><svg class="mr-1" 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="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_1q7nz6m = { | |
| assets: "/docs/accelerate/pr_4021/en", | |
| base: "/docs/accelerate/pr_4021/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/accelerate/pr_4021/en/_app/immutable/entry/start.8a49e72b.js"), | |
| import("/docs/accelerate/pr_4021/en/_app/immutable/entry/app.1df4d18e.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 24], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 52.6 kB
- Xet hash:
- 240c84a1c56b0f1269916be409e07b2b583a685634b9874c3c4a5ec1143b2a1a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.