Built site for gh-pages
This commit is contained in:
@@ -2,13 +2,16 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="quarto-1.8.27">
|
||||
<meta name="generator" content="quarto-1.9.36">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
|
||||
<title>monkeypatch.utils – Axolotl</title>
|
||||
<style>
|
||||
/* Default styles provided by pandoc.
|
||||
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
|
||||
*/
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
@@ -67,15 +70,14 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
||||
<link href="../../favicon.jpg" rel="icon" type="image/jpeg">
|
||||
<script src="../../site_libs/quarto-html/quarto.js" type="module"></script>
|
||||
<script src="../../site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
|
||||
<script src="../../site_libs/quarto-html/axe/axe-check.js" type="module"></script>
|
||||
<script src="../../site_libs/quarto-html/popper.min.js"></script>
|
||||
<script src="../../site_libs/quarto-html/tippy.umd.min.js"></script>
|
||||
<script src="../../site_libs/quarto-html/anchor.min.js"></script>
|
||||
<link href="../../site_libs/quarto-html/tippy.css" rel="stylesheet">
|
||||
<link href="../../site_libs/quarto-html/quarto-syntax-highlighting-dark-4d9afe2b8d18ee9fa5d0d57b5ed4214d.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
||||
<link href="../../site_libs/quarto-html/quarto-syntax-highlighting-dark-f418161beb48e0141c760e455f12af2c.css" rel="stylesheet" id="quarto-text-highlighting-styles">
|
||||
<script src="../../site_libs/bootstrap/bootstrap.min.js"></script>
|
||||
<link href="../../site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||||
<link href="../../site_libs/bootstrap/bootstrap-35ef2ff98a2131eb4c49a687ae04ea22.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="dark">
|
||||
<link href="../../site_libs/bootstrap/bootstrap-f15b14cef494beb09422a8174b542cad.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="dark">
|
||||
<script id="quarto-search-options" type="application/json">{
|
||||
"location": "navbar",
|
||||
"copy-button": false,
|
||||
@@ -698,7 +700,7 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<li class="sidebar-item">
|
||||
<div class="sidebar-item-container">
|
||||
<a href="../../docs/gradient_checkpointing.html" class="sidebar-item-text sidebar-link">
|
||||
<span class="menu-text">Gradient Checkpointing and Activation Offloading</span></a>
|
||||
<span class="menu-text">Gradient Checkpointing, Activation Offloading, and Layer Offloading</span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
@@ -760,7 +762,6 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<ul class="collapse">
|
||||
<li><a href="#axolotl.monkeypatch.utils.get_cu_seqlens" id="toc-axolotl.monkeypatch.utils.get_cu_seqlens" class="nav-link" data-scroll-target="#axolotl.monkeypatch.utils.get_cu_seqlens">get_cu_seqlens</a></li>
|
||||
<li><a href="#axolotl.monkeypatch.utils.get_cu_seqlens_from_pos_ids" id="toc-axolotl.monkeypatch.utils.get_cu_seqlens_from_pos_ids" class="nav-link" data-scroll-target="#axolotl.monkeypatch.utils.get_cu_seqlens_from_pos_ids">get_cu_seqlens_from_pos_ids</a></li>
|
||||
<li><a href="#axolotl.monkeypatch.utils.mask_2d_to_4d" id="toc-axolotl.monkeypatch.utils.mask_2d_to_4d" class="nav-link" data-scroll-target="#axolotl.monkeypatch.utils.mask_2d_to_4d">mask_2d_to_4d</a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
@@ -794,10 +795,6 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<td><a href="#axolotl.monkeypatch.utils.get_cu_seqlens_from_pos_ids">get_cu_seqlens_from_pos_ids</a></td>
|
||||
<td>generate a cumulative sequence length mask for flash attention using pos ids</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#axolotl.monkeypatch.utils.mask_2d_to_4d">mask_2d_to_4d</a></td>
|
||||
<td>Expands attention_mask from <code>[bsz, seq_len]</code> to <code>[bsz, 1, tgt_seq_len, src_seq_len]</code>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<section id="axolotl.monkeypatch.utils.get_cu_seqlens" class="level3">
|
||||
@@ -809,14 +806,6 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<h3 class="anchored" data-anchor-id="axolotl.monkeypatch.utils.get_cu_seqlens_from_pos_ids">get_cu_seqlens_from_pos_ids</h3>
|
||||
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>monkeypatch.utils.get_cu_seqlens_from_pos_ids(position_ids)</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
|
||||
<p>generate a cumulative sequence length mask for flash attention using pos ids</p>
|
||||
</section>
|
||||
<section id="axolotl.monkeypatch.utils.mask_2d_to_4d" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.monkeypatch.utils.mask_2d_to_4d">mask_2d_to_4d</h3>
|
||||
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>monkeypatch.utils.mask_2d_to_4d(mask, dtype, tgt_len<span class="op">=</span><span class="va">None</span>)</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
|
||||
<p>Expands attention_mask from <code>[bsz, seq_len]</code> to <code>[bsz, 1, tgt_seq_len, src_seq_len]</code>.
|
||||
This expansion handles packed sequences so that sequences share the same attention mask integer value
|
||||
when they attend to each other within that sequence.
|
||||
This expansion transforms the mask to lower triangular form to prevent future peeking.</p>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user