Buckets:

rtrm's picture
download
raw
23.4 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Adding support for new architectures&quot;,&quot;local&quot;:&quot;adding-support-for-new-architectures&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Implement a custom Neuron configuration&quot;,&quot;local&quot;:&quot;implement-a-custom-neuron-configuration&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Example: Adding support for ESM models&quot;,&quot;local&quot;:&quot;example-adding-support-for-esm-models&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Export and validate the model&quot;,&quot;local&quot;:&quot;export-and-validate-the-model&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Contribute to the GitHub repo&quot;,&quot;local&quot;:&quot;contribute-to-the-github-repo&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/entry/start.c3692dcd.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/scheduler.85c25b89.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/singletons.bf318e21.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/paths.4f2bc42b.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/entry/app.40ef12d9.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/index.c9bcf812.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/nodes/0.8386078c.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/nodes/4.7f05caa9.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/Tip.d8f753fa.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/CodeBlock.c004bd26.js">
<link rel="modulepreload" href="/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/chunks/index.9790a2b6.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Adding support for new architectures&quot;,&quot;local&quot;:&quot;adding-support-for-new-architectures&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Implement a custom Neuron configuration&quot;,&quot;local&quot;:&quot;implement-a-custom-neuron-configuration&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Example: Adding support for ESM models&quot;,&quot;local&quot;:&quot;example-adding-support-for-esm-models&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Export and validate the model&quot;,&quot;local&quot;:&quot;export-and-validate-the-model&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Contribute to the GitHub repo&quot;,&quot;local&quot;:&quot;contribute-to-the-github-repo&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="adding-support-for-new-architectures" 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="#adding-support-for-new-architectures"><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>Adding support for new architectures</span></h1> <blockquote data-svelte-h="svelte-1iqy6mr"><p><strong><em>NOTE:</em></strong> ❗This section does not apply to the decoder model’s inference with autoregressive sampling integrated through <code>transformers-neuronx</code>. If you want to add support for these models, please open an issue on the Optimum Neuron GitHub repo, and ping maintainers for help.</p></blockquote> <p data-svelte-h="svelte-uchuu9">You want to export and run a new model on AWS Inferentia or Trainium? Check the guideline, and submit a pull request to <a href="https://github.com/huggingface/optimum-neuron/" rel="nofollow">🤗 Optimum Neuron’s GitHub repo</a>!</p> <p data-svelte-h="svelte-1awdjch">To support a new model architecture in the Optimum Neuron library here are some steps to follow:</p> <ol data-svelte-h="svelte-1q8yhf2"><li>Implement a custom Neuron configuration.</li> <li>Export and validate the model.</li> <li>Contribute to the GitHub repo.</li></ol> <h2 class="relative group"><a id="implement-a-custom-neuron-configuration" 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="#implement-a-custom-neuron-configuration"><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>Implement a custom Neuron configuration</span></h2> <p data-svelte-h="svelte-12rzy01">To support the export of a new model to a Neuron compatible format, the first thing to do is to define a Neuron configuration, describing how to export the PyTorch model by specifying:</p> <ol data-svelte-h="svelte-1bbfvek"><li>The input names.</li> <li>The output names.</li> <li>The dummy inputs used to trace the model: the Neuron Compiler records the computational graph via tracing and works on the resulting <code>TorchScript</code> module.</li> <li>The compilation arguments used to control the trade-off between hardware efficiency (latency, throughput) and accuracy.</li></ol> <p data-svelte-h="svelte-1ez6yaq">Depending on the choice of model and task, we represent the data above with configuration classes. Each configuration class is associated with
a specific model architecture, and follows the naming convention <code>ArchitectureNameNeuronConfig</code>. For instance, the configuration that specifies the Neuron
export of BERT models is <code>BertNeuronConfig</code>.</p> <p data-svelte-h="svelte-tqmfwt">Since many architectures share similar properties for their Neuron configuration, 🤗 Optimum adopts a 3-level class hierarchy:</p> <ol data-svelte-h="svelte-wqsfdl"><li>Abstract and generic base classes. These handle all the fundamental features, while being agnostic to the modality (text, image, audio, etc).</li> <li>Middle-end classes. These are aware of the modality. Multiple config classes could exist for the same modality, depending on the inputs they support. They specify which input generators should be used for generating the dummy inputs, but remain model-agnostic.</li> <li>Model-specific classes like the <code>BertNeuronConfig</code> mentioned above. These are the ones actually used to export models.</li></ol> <h3 class="relative group"><a id="example-adding-support-for-esm-models" 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="#example-adding-support-for-esm-models"><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>Example: Adding support for ESM models</span></h3> <p data-svelte-h="svelte-krly5h">Here we take the support of <a href="https://huggingface.co/docs/transformers/model_doc/esm#esm" rel="nofollow">ESM models</a> as an example. Let’s create an <code>EsmNeuronConfig</code> class in the <code>optimum/exporters/neuron/model_configs.py</code>.</p> <p data-svelte-h="svelte-3w7mfw">When an Esm model interprets as a text encoder, we are able to inherit from the middle-end class <a href="https://github.com/huggingface/optimum-neuron/blob/v0.0.18/optimum/exporters/neuron/config.py#L36" rel="nofollow"><code>TextEncoderNeuronConfig</code></a>.
Since the modeling and configuration of Esm is almost the same as BERT when it is interpreted as an encoder, we can use the <code>NormalizedConfigManager</code> with <code>model_type=bert</code> to normalize the configuration to generate dummy inputs for tracing the model.</p> <p data-svelte-h="svelte-11pzsso">And one last step, since <code>optimum-neuron</code> is an extension of <code>optimum</code>, we need to register the Neuron config that we create to the <a href="https://huggingface.co/docs/optimum/main/en/exporters/task_manager#optimum.exporters.TasksManager" rel="nofollow">TasksManager</a> with the <code>register_in_tasks_manager</code> decorator by specifying the model type and supported tasks.</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-meta">@register_in_tasks_manager(<span class="hljs-params"><span class="hljs-string">&quot;esm&quot;</span>, *[<span class="hljs-string">&quot;feature-extraction&quot;</span>, <span class="hljs-string">&quot;fill-mask&quot;</span>, <span class="hljs-string">&quot;text-classification&quot;</span>, <span class="hljs-string">&quot;token-classification&quot;</span>]</span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">EsmNeuronConfig</span>(<span class="hljs-title class_ inherited__">TextEncoderNeuronConfig</span>):
NORMALIZED_CONFIG_CLASS = NormalizedConfigManager.get_normalized_config_class(<span class="hljs-string">&quot;bert&quot;</span>)
ATOL_FOR_VALIDATION = <span class="hljs-number">1e-3</span> <span class="hljs-comment"># absolute tolerance to compare for comparing model on CPUs</span>
<span class="hljs-meta"> @property</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>) -&gt; <span class="hljs-type">List</span>[<span class="hljs-built_in">str</span>]:
<span class="hljs-keyword">return</span> [<span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;attention_mask&quot;</span>]
<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="export-and-validate-the-model" 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="#export-and-validate-the-model"><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>Export and validate the model</span></h2> <p data-svelte-h="svelte-1ca0k65">With the Neuron configuration class that you implemented, now do a quick test if it works as expected:</p> <ul data-svelte-h="svelte-1j7x565"><li>Export</li></ul> <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 -->optimum-cli <span class="hljs-built_in">export</span> neuron --model facebook/esm2_t33_650M_UR50D --task text-classification --batch_size 1 --sequence_length 16 esm_neuron/<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1hlus0h">During the export <a href="https://github.com/huggingface/optimum-neuron/blob/7b18de9ddfa5c664c94051304c651eaf855c3e0b/optimum/exporters/neuron/convert.py#L136" rel="nofollow"><code>validate_model_outputs</code></a> will be called to validate the outputs of your exported Neuron model by comparing them to the results of PyTorch on the CPU. You could also validate the model manually with:</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> optimum.exporters.neuron <span class="hljs-keyword">import</span> validate_model_outputs
validate_model_outputs(
neuron_config, base_model, neuron_model_path, neuron_named_outputs, neuron_config.ATOL_FOR_VALIDATION
)<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-7woav9"><li>Inference (optional)</li></ul> <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.neuron <span class="hljs-keyword">import</span> NeuronModelForSequenceClassification
model = NeuronModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;esm_neuron/&quot;</span>)
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;esm_neuron/&quot;</span>)
inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
logits = model(**inputs).logits<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="contribute-to-the-github-repo" 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="#contribute-to-the-github-repo"><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>Contribute to the GitHub repo</span></h2> <p data-svelte-h="svelte-bmbrzm">We are almost all set. Now submit a pull request to make your work accessible to all community members!</p> <ul data-svelte-h="svelte-1tee105"><li>Open an issue in the <a href="https://github.com/huggingface/optimum-neuron/issues" rel="nofollow">Optimum Neuron GitHub repo</a> to describe the new feature and make it visible to Optimum Neuron’s maintainers.</li> <li>Add the model to the exporter test in <a href="https://github.com/huggingface/optimum-neuron/blob/v0.0.18/tests/exporters/exporters_utils.py" rel="nofollow"><code>optimum-neuron/tests/exporters/exporters_utils.py</code></a> and the inference test in <a href="https://github.com/huggingface/optimum-neuron/blob/v0.0.18/tests/inference/inference_utils.py" rel="nofollow"><code>optimum-neuron/tests/inference/inference_utils.py</code></a>.</li> <li>Open a pull request! (Don’t forget to link it to the issue you opened, so that the maintainers could better track it and provide help when needed.)</li></ul> <div class="course-tip bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400"><p data-svelte-h="svelte-r7v6p2">We usually test smaller checkpoints to accelerate the CIs, you could find tiny models for testing under the <a href="https://huggingface.co/hf-internal-testing" rel="nofollow"><code>Hugging Face Internal Testing Organization</code></a>.</p></div> <p data-svelte-h="svelte-bydw52">You have made a new model accessible on Neuron for the community! Thanks for joining us in the endeavor of democratizing good machine learning 🤗.</p> <p></p>
<script>
{
__sveltekit_1eimgpm = {
assets: "/docs/optimum.neuron/v0.2.0.dev2/en",
base: "/docs/optimum.neuron/v0.2.0.dev2/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/entry/start.c3692dcd.js"),
import("/docs/optimum.neuron/v0.2.0.dev2/en/_app/immutable/entry/app.40ef12d9.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 4],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
23.4 kB
·
Xet hash:
b6d5b75303bc496639a6b5be5ace6fb1aab731a994c1c13f277a763605d34cb4

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