deploy: 835a92eba51a939c6b4a069a53cc1e3ddeabd9a5

This commit is contained in:
csukuangfj 2023-12-25 12:33:16 +00:00
parent 058e0442f2
commit 6dfba8b4a3
5 changed files with 96 additions and 18 deletions

View File

@ -20,7 +20,11 @@ We describe the following items in this section:
View available tags View available tags
=================== ===================
You can use the following command to view available tags: CUDA-enabled docker images
--------------------------
You can use the following command to view available tags for CUDA-enabled
docker images:
.. code-block:: bash .. code-block:: bash
@ -43,8 +47,25 @@ which will give you something like below:
Please select an appropriate combination of `torch`_ and CUDA. Please select an appropriate combination of `torch`_ and CUDA.
Download a docker image CPU-only docker images
======================= ----------------------
To view CPU-only docker images, please visit `<https://github.com/k2-fsa/icefall/pkgs/container/icefall>`_
for available tags.
You can select different combinations of ``Python`` and ``torch``. For instance,
to select ``Python 3.8`` and ``torch 2.1.2``, you can use the following tag
.. code-block:: bash
cpu-py3.8-torch2.1.2-v1.1
where ``v1.1`` is the current version of the docker image. You may see
``ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.2`` or some other versions.
We recommend that you always use the latest version.
Download a docker image (CUDA)
==============================
Suppose that you select the tag ``torch1.13.0-cuda11.6``, you can use Suppose that you select the tag ``torch1.13.0-cuda11.6``, you can use
the following command to download it: the following command to download it:
@ -53,6 +74,16 @@ the following command to download it:
sudo docker image pull k2fsa/icefall:torch1.13.0-cuda11.6 sudo docker image pull k2fsa/icefall:torch1.13.0-cuda11.6
Download a docker image (CPU)
==============================
Suppose that you select the tag ``cpu-py3.8-torch2.1.2-v1.1``, you can use
the following command to download it:
.. code-block:: bash
sudo docker pull ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1
Run a docker image with GPU Run a docker image with GPU
=========================== ===========================
@ -65,7 +96,7 @@ Run a docker image with CPU
.. code-block:: bash .. code-block:: bash
sudo docker run --rm -it k2fsa/icefall:torch1.13.0-cuda11.6 /bin/bash sudo docker run --rm -it ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1 /bin/bash
Run yesno within a docker container Run yesno within a docker container
=================================== ===================================
@ -74,8 +105,13 @@ After starting the container, the following interface is presented:
.. code-block:: bash .. code-block:: bash
# GPU-enabled docker
root@60c947eac59c:/workspace/icefall# root@60c947eac59c:/workspace/icefall#
# CPU-only docker
root@60c947eac59c:# mkdir /workspace; git clone https://github.com/k2-fsa/icefall
root@60c947eac59c:# export PYTHONPATH=/workspace/icefall:$PYTHONPATH
It shows the current user is ``root`` and the current working directory It shows the current user is ``root`` and the current working directory
is ``/workspace/icefall``. is ``/workspace/icefall``.
@ -107,7 +143,7 @@ to switch to the ``yesno`` recipe and run
.. hint:: .. hint::
If you are running without GPU, it may report the following error: If you are running without GPU with a GPU-enabled docker, it may report the following error:
.. code-block:: bash .. code-block:: bash

View File

@ -51,7 +51,8 @@
<li class="toctree-l1 current"><a class="current reference internal" href="#">Docker</a><ul> <li class="toctree-l1 current"><a class="current reference internal" href="#">Docker</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro.html">Introduction</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#view-available-tags">View available tags</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#view-available-tags">View available tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#download-a-docker-image">Download a docker image</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#download-a-docker-image-cuda">Download a docker image (CUDA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#download-a-docker-image-cpu">Download a docker image (CPU)</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a></li>
@ -106,8 +107,13 @@ images.</p>
<div class="toctree-wrapper compound"> <div class="toctree-wrapper compound">
<ul> <ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#view-available-tags">View available tags</a></li> <li class="toctree-l1"><a class="reference internal" href="intro.html#view-available-tags">View available tags</a><ul>
<li class="toctree-l1"><a class="reference internal" href="intro.html#download-a-docker-image">Download a docker image</a></li> <li class="toctree-l2"><a class="reference internal" href="intro.html#cuda-enabled-docker-images">CUDA-enabled docker images</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro.html#cpu-only-docker-images">CPU-only docker images</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#download-a-docker-image-cuda">Download a docker image (CUDA)</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#download-a-docker-image-cpu">Download a docker image (CPU)</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li> <li class="toctree-l1"><a class="reference internal" href="intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li> <li class="toctree-l1"><a class="reference internal" href="intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a><ul> <li class="toctree-l1"><a class="reference internal" href="intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a><ul>

View File

@ -50,8 +50,13 @@
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Docker</a><ul class="current"> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Docker</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Introduction</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="#view-available-tags">View available tags</a></li> <li class="toctree-l2"><a class="reference internal" href="#view-available-tags">View available tags</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#download-a-docker-image">Download a docker image</a></li> <li class="toctree-l3"><a class="reference internal" href="#cuda-enabled-docker-images">CUDA-enabled docker images</a></li>
<li class="toctree-l3"><a class="reference internal" href="#cpu-only-docker-images">CPU-only docker images</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#download-a-docker-image-cuda">Download a docker image (CUDA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#download-a-docker-image-cpu">Download a docker image (CPU)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li> <li class="toctree-l2"><a class="reference internal" href="#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li> <li class="toctree-l2"><a class="reference internal" href="#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="#run-yesno-within-a-docker-container">Run yesno within a docker container</a><ul> <li class="toctree-l2"><a class="reference internal" href="#run-yesno-within-a-docker-container">Run yesno within a docker container</a><ul>
@ -123,7 +128,10 @@
</section> </section>
<section id="view-available-tags"> <section id="view-available-tags">
<h1>View available tags<a class="headerlink" href="#view-available-tags" title="Permalink to this heading"></a></h1> <h1>View available tags<a class="headerlink" href="#view-available-tags" title="Permalink to this heading"></a></h1>
<p>You can use the following command to view available tags:</p> <section id="cuda-enabled-docker-images">
<h2>CUDA-enabled docker images<a class="headerlink" href="#cuda-enabled-docker-images" title="Permalink to this heading"></a></h2>
<p>You can use the following command to view available tags for CUDA-enabled
docker images:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>curl<span class="w"> </span>-s<span class="w"> </span><span class="s1">&#39;https://registry.hub.docker.com/v2/repositories/k2fsa/icefall/tags/&#39;</span><span class="p">|</span>jq<span class="w"> </span><span class="s1">&#39;.&quot;results&quot;[][&quot;name&quot;]&#39;</span> <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>curl<span class="w"> </span>-s<span class="w"> </span><span class="s1">&#39;https://registry.hub.docker.com/v2/repositories/k2fsa/icefall/tags/&#39;</span><span class="p">|</span>jq<span class="w"> </span><span class="s1">&#39;.&quot;results&quot;[][&quot;name&quot;]&#39;</span>
</pre></div> </pre></div>
</div> </div>
@ -142,14 +150,36 @@
</div> </div>
<p>Please select an appropriate combination of <a class="reference external" href="https://github.com/pytorch/pytorch">torch</a> and CUDA.</p> <p>Please select an appropriate combination of <a class="reference external" href="https://github.com/pytorch/pytorch">torch</a> and CUDA.</p>
</section> </section>
<section id="download-a-docker-image"> <section id="cpu-only-docker-images">
<h1>Download a docker image<a class="headerlink" href="#download-a-docker-image" title="Permalink to this heading"></a></h1> <h2>CPU-only docker images<a class="headerlink" href="#cpu-only-docker-images" title="Permalink to this heading"></a></h2>
<p>To view CPU-only docker images, please visit <a class="reference external" href="https://github.com/k2-fsa/icefall/pkgs/container/icefall">https://github.com/k2-fsa/icefall/pkgs/container/icefall</a>
for available tags.</p>
<p>You can select different combinations of <code class="docutils literal notranslate"><span class="pre">Python</span></code> and <code class="docutils literal notranslate"><span class="pre">torch</span></code>. For instance,
to select <code class="docutils literal notranslate"><span class="pre">Python</span> <span class="pre">3.8</span></code> and <code class="docutils literal notranslate"><span class="pre">torch</span> <span class="pre">2.1.2</span></code>, you can use the following tag</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>cpu-py3.8-torch2.1.2-v1.1
</pre></div>
</div>
<p>where <code class="docutils literal notranslate"><span class="pre">v1.1</span></code> is the current version of the docker image. You may see
<code class="docutils literal notranslate"><span class="pre">ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.2</span></code> or some other versions.
We recommend that you always use the latest version.</p>
</section>
</section>
<section id="download-a-docker-image-cuda">
<h1>Download a docker image (CUDA)<a class="headerlink" href="#download-a-docker-image-cuda" title="Permalink to this heading"></a></h1>
<p>Suppose that you select the tag <code class="docutils literal notranslate"><span class="pre">torch1.13.0-cuda11.6</span></code>, you can use <p>Suppose that you select the tag <code class="docutils literal notranslate"><span class="pre">torch1.13.0-cuda11.6</span></code>, you can use
the following command to download it:</p> the following command to download it:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>image<span class="w"> </span>pull<span class="w"> </span>k2fsa/icefall:torch1.13.0-cuda11.6 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>image<span class="w"> </span>pull<span class="w"> </span>k2fsa/icefall:torch1.13.0-cuda11.6
</pre></div> </pre></div>
</div> </div>
</section> </section>
<section id="download-a-docker-image-cpu">
<h1>Download a docker image (CPU)<a class="headerlink" href="#download-a-docker-image-cpu" title="Permalink to this heading"></a></h1>
<p>Suppose that you select the tag <code class="docutils literal notranslate"><span class="pre">cpu-py3.8-torch2.1.2-v1.1</span></code>, you can use
the following command to download it:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>pull<span class="w"> </span>ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1
</pre></div>
</div>
</section>
<section id="run-a-docker-image-with-gpu"> <section id="run-a-docker-image-with-gpu">
<h1>Run a docker image with GPU<a class="headerlink" href="#run-a-docker-image-with-gpu" title="Permalink to this heading"></a></h1> <h1>Run a docker image with GPU<a class="headerlink" href="#run-a-docker-image-with-gpu" title="Permalink to this heading"></a></h1>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>--gpus<span class="w"> </span>all<span class="w"> </span>--rm<span class="w"> </span>-it<span class="w"> </span>k2fsa/icefall:torch1.13.0-cuda11.6<span class="w"> </span>/bin/bash <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>--gpus<span class="w"> </span>all<span class="w"> </span>--rm<span class="w"> </span>-it<span class="w"> </span>k2fsa/icefall:torch1.13.0-cuda11.6<span class="w"> </span>/bin/bash
@ -158,14 +188,19 @@ the following command to download it:</p>
</section> </section>
<section id="run-a-docker-image-with-cpu"> <section id="run-a-docker-image-with-cpu">
<h1>Run a docker image with CPU<a class="headerlink" href="#run-a-docker-image-with-cpu" title="Permalink to this heading"></a></h1> <h1>Run a docker image with CPU<a class="headerlink" href="#run-a-docker-image-with-cpu" title="Permalink to this heading"></a></h1>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>--rm<span class="w"> </span>-it<span class="w"> </span>k2fsa/icefall:torch1.13.0-cuda11.6<span class="w"> </span>/bin/bash <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo<span class="w"> </span>docker<span class="w"> </span>run<span class="w"> </span>--rm<span class="w"> </span>-it<span class="w"> </span>ghcr.io/k2-fsa/icefall:cpu-py3.8-torch2.1.2-v1.1<span class="w"> </span>/bin/bash
</pre></div> </pre></div>
</div> </div>
</section> </section>
<section id="run-yesno-within-a-docker-container"> <section id="run-yesno-within-a-docker-container">
<h1>Run yesno within a docker container<a class="headerlink" href="#run-yesno-within-a-docker-container" title="Permalink to this heading"></a></h1> <h1>Run yesno within a docker container<a class="headerlink" href="#run-yesno-within-a-docker-container" title="Permalink to this heading"></a></h1>
<p>After starting the container, the following interface is presented:</p> <p>After starting the container, the following interface is presented:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>root@60c947eac59c:/workspace/icefall# <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># GPU-enabled docker</span>
root@60c947eac59c:/workspace/icefall#
<span class="c1"># CPU-only docker</span>
root@60c947eac59c:#<span class="w"> </span>mkdir<span class="w"> </span>/workspace<span class="p">;</span><span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/k2-fsa/icefall
root@60c947eac59c:#<span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">PYTHONPATH</span><span class="o">=</span>/workspace/icefall:<span class="nv">$PYTHONPATH</span>
</pre></div> </pre></div>
</div> </div>
<p>It shows the current user is <code class="docutils literal notranslate"><span class="pre">root</span></code> and the current working directory <p>It shows the current user is <code class="docutils literal notranslate"><span class="pre">root</span></code> and the current working directory
@ -191,7 +226,7 @@ is <code class="docutils literal notranslate"><span class="pre">/workspace/icefa
<div class="admonition hint"> <div class="admonition hint">
<p class="admonition-title">Hint</p> <p class="admonition-title">Hint</p>
<blockquote> <blockquote>
<div><p>If you are running without GPU, it may report the following error:</p> <div><p>If you are running without GPU with a GPU-enabled docker, it may report the following error:</p>
<blockquote> <blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>File<span class="w"> </span><span class="s2">&quot;/opt/conda/lib/python3.9/site-packages/k2/__init__.py&quot;</span>,<span class="w"> </span>line<span class="w"> </span><span class="m">23</span>,<span class="w"> </span><span class="k">in</span><span class="w"> </span>&lt;module&gt; <div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>File<span class="w"> </span><span class="s2">&quot;/opt/conda/lib/python3.9/site-packages/k2/__init__.py&quot;</span>,<span class="w"> </span>line<span class="w"> </span><span class="m">23</span>,<span class="w"> </span><span class="k">in</span><span class="w"> </span>&lt;module&gt;
<span class="w"> </span>from<span class="w"> </span>_k2<span class="w"> </span>import<span class="w"> </span>DeterminizeWeightPushingType <span class="w"> </span>from<span class="w"> </span>_k2<span class="w"> </span>import<span class="w"> </span>DeterminizeWeightPushingType

View File

@ -116,7 +116,8 @@ speech recognition recipes using <a class="reference external" href="https://git
<li class="toctree-l1"><a class="reference internal" href="docker/index.html">Docker</a><ul> <li class="toctree-l1"><a class="reference internal" href="docker/index.html">Docker</a><ul>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html">Introduction</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#view-available-tags">View available tags</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html#view-available-tags">View available tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#download-a-docker-image">Download a docker image</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html#download-a-docker-image-cuda">Download a docker image (CUDA)</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#download-a-docker-image-cpu">Download a docker image (CPU)</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-a-docker-image-with-gpu">Run a docker image with GPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-a-docker-image-with-cpu">Run a docker image with CPU</a></li>
<li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a></li> <li class="toctree-l2"><a class="reference internal" href="docker/intro.html#run-yesno-within-a-docker-container">Run yesno within a docker container</a></li>

File diff suppressed because one or more lines are too long