Skip to content

Commit

Permalink
Update docs from 9c11632
Browse files Browse the repository at this point in the history
  • Loading branch information
olivedevteam committed Aug 22, 2024
1 parent 33a7322 commit 41bce4c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 5 deletions.
15 changes: 15 additions & 0 deletions _modules/olive/model/handler/onnx.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,21 @@ <h1>Source code for olive.model.handler.onnx</h1><div class="highlight"><pre>
<span class="n">model_path</span> <span class="o">=</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">model_path</span>
<span class="k">return</span> <span class="n">get_additional_file_path</span><span class="p">(</span><span class="n">model_path</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">constant_inputs_file_name</span><span class="p">)</span> <span class="k">if</span> <span class="n">model_path</span> <span class="k">else</span> <span class="kc">None</span>

<span class="k">def</span> <span class="nf">change_model_path_to_dir</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Path</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Change the model path to the parent directory of the model file.</span>

<span class="sd"> This is used when we want to store more files in the same directory as the model file.</span>
<span class="sd"> :return: The parent directory of the model file.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">model_path_resource</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_resource</span><span class="p">(</span><span class="s2">&quot;model_path&quot;</span><span class="p">))</span>
<span class="k">if</span> <span class="n">model_path_resource</span><span class="o">.</span><span class="n">is_dir</span><span class="p">():</span>
<span class="k">return</span> <span class="n">model_path_resource</span>

<span class="bp">self</span><span class="o">.</span><span class="n">set_resource</span><span class="p">(</span><span class="s2">&quot;model_path&quot;</span><span class="p">,</span> <span class="n">model_path_resource</span><span class="o">.</span><span class="n">parent</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">onnx_file_name</span> <span class="o">=</span> <span class="n">model_path_resource</span><span class="o">.</span><span class="n">name</span>

<span class="k">return</span> <span class="n">model_path_resource</span><span class="o">.</span><span class="n">parent</span>

<span class="k">def</span> <span class="nf">load_model</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">rank</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">ModelProto</span><span class="p">:</span>
<span class="k">return</span> <span class="n">onnx</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">model_path</span><span class="p">)</span>

Expand Down
18 changes: 18 additions & 0 deletions api/passes.html
Original file line number Diff line number Diff line change
Expand Up @@ -3352,6 +3352,24 @@
<p><strong>searchable_values:</strong> None</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-arg-dynamic_lora_r">
<span class="sig-name descname"><span class="pre">dynamic_lora_r</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-arg-dynamic_lora_r" title="Permalink to this definition"></a></dt>
<dd><p>Whether the model uses dynamic shape for lora_r. Only used if make_inputs is True. Valid only for float modules.</p>
<p><strong>type:</strong> bool</p>
<p><strong>default_value:</strong> True</p>
<p><strong>searchable_values:</strong> None</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-arg-optional_inputs">
<span class="sig-name descname"><span class="pre">optional_inputs</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-arg-optional_inputs" title="Permalink to this definition"></a></dt>
<dd><p>Create default initializers (empty tensor with lora_r dimension set to 0) for the adapter weights, if inputs not provided during inference. Only used if make_inputs is True. Valid only for float modules.</p>
<p><strong>type:</strong> bool</p>
<p><strong>default_value:</strong> True</p>
<p><strong>searchable_values:</strong> None</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-arg-save_format">
<span class="sig-name descname"><span class="pre">save_format</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-arg-save_format" title="Permalink to this definition"></a></dt>
Expand Down
26 changes: 22 additions & 4 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ <h2 id="C">C</h2>
<li><a href="api/passes.html#cmdoption-arg-double_quant">double_quant</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-duo_scaling">duo_scaling</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-dynamic_lora_r">dynamic_lora_r</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-element_wise_binary_ops">element_wise_binary_ops</a>
</li>
Expand Down Expand Up @@ -724,6 +726,8 @@ <h2 id="C">C</h2>
<li><a href="api/passes.html#cmdoption-arg-optimization_options">optimization_options</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-optimize_model">optimize_model</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-optional_inputs">optional_inputs</a>
</li>
<li><a href="api/passes.html#cmdoption-arg-out_node">out_node</a>
</li>
Expand Down Expand Up @@ -1021,15 +1025,15 @@ <h2 id="D">D</h2>
</li>
<li><a href="api/systems.html#olive.systems.common.AcceleratorConfig.device">device (olive.systems.common.AcceleratorConfig attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
dim_param

<ul>
<li><a href="api/passes.html#cmdoption-arg-dim_param">command line option</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
dim_value

Expand Down Expand Up @@ -1077,6 +1081,13 @@ <h2 id="D">D</h2>

<ul>
<li><a href="api/passes.html#cmdoption-arg-duo_scaling">command line option</a>
</li>
</ul></li>
<li>
dynamic_lora_r

<ul>
<li><a href="api/passes.html#cmdoption-arg-dynamic_lora_r">command line option</a>
</li>
</ul></li>
</ul></td>
Expand Down Expand Up @@ -2049,20 +2060,27 @@ <h2 id="O">O</h2>
</ul></li>
<li><a href="api/passes.html#olive.passes.pytorch.lora.HFTrainingArguments.optim">optim (olive.passes.pytorch.lora.HFTrainingArguments attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
optimization_options

<ul>
<li><a href="api/passes.html#cmdoption-arg-optimization_options">command line option</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
optimize_model

<ul>
<li><a href="api/passes.html#cmdoption-arg-optimize_model">command line option</a>
</li>
</ul></li>
<li>
optional_inputs

<ul>
<li><a href="api/passes.html#cmdoption-arg-optional_inputs">command line option</a>
</li>
</ul></li>
<li>
Expand Down
Binary file modified objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 41bce4c

Please sign in to comment.