|
299 | 299 | <div class="pytorch-left-menu-search">
|
300 | 300 |
|
301 | 301 | <div class="version">
|
302 |
| - <a href='https://pytorch.org/docs/versions.html'>main (2.7.0a0+git714f643 ) ▼</a> |
| 302 | + <a href='https://pytorch.org/docs/versions.html'>main (2.7.0a0+gitefebec5 ) ▼</a> |
303 | 303 | </div>
|
304 | 304 | <div id="searchBox">
|
305 | 305 | <div class="searchbox" id="googleSearchBox">
|
|
526 | 526 | <li class="toctree-l1"><a class="reference external" href="https://pytorch.org/text/stable">torchtext</a></li>
|
527 | 527 | <li class="toctree-l1"><a class="reference external" href="https://pytorch.org/vision/stable">torchvision</a></li>
|
528 | 528 | <li class="toctree-l1"><a class="reference external" href="https://pytorch.org/xla/">PyTorch on XLA Devices</a></li>
|
| 529 | +<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/ao">torchao</a></li> |
529 | 530 | </ul>
|
530 | 531 |
|
531 | 532 |
|
@@ -917,20 +918,21 @@ <h1>Source code for torch</h1><div class="highlight"><pre>
|
917 | 918 |
|
918 | 919 | <span class="k">try</span><span class="p">:</span>
|
919 | 920 | <span class="n">ctypes</span><span class="o">.</span><span class="n">CDLL</span><span class="p">(</span><span class="n">global_deps_lib_path</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="n">ctypes</span><span class="o">.</span><span class="n">RTLD_GLOBAL</span><span class="p">)</span>
|
920 |
| - <span class="c1"># Workaround slim-wheel CUDA-12.4+ dependency bug in libcusparse by preloading nvjitlink</span> |
921 |
| - <span class="c1"># In those versions of cuda cusparse depends on nvjitlink, but does not have rpath when</span> |
| 921 | + <span class="c1"># Workaround slim-wheel CUDA dependency bugs in cusparse and cudnn by preloading nvjitlink</span> |
| 922 | + <span class="c1"># and nvrtc. In CUDA-12.4+ cusparse depends on nvjitlink, but does not have rpath when</span> |
922 | 923 | <span class="c1"># shipped as wheel, which results in OS picking wrong/older version of nvjitlink library</span>
|
923 |
| - <span class="c1"># if `LD_LIBRARY_PATH` is defined</span> |
924 |
| - <span class="c1"># See https://github.com/pytorch/pytorch/issues/138460</span> |
925 |
| - <span class="k">if</span> <span class="n">version</span><span class="o">.</span><span class="n">cuda</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">"12.4"</span><span class="p">,</span> <span class="s2">"12.6"</span><span class="p">]:</span> <span class="c1"># type: ignore[name-defined]</span> |
926 |
| - <span class="k">return</span> |
| 924 | + <span class="c1"># if `LD_LIBRARY_PATH` is defined, see https://github.com/pytorch/pytorch/issues/138460</span> |
| 925 | + <span class="c1"># Similar issue exist in cudnn that dynamically loads nvrtc, unaware of its relative path.</span> |
| 926 | + <span class="c1"># See https://github.com/pytorch/pytorch/issues/145580</span> |
927 | 927 | <span class="k">try</span><span class="p">:</span>
|
928 | 928 | <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"/proc/self/maps"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
929 | 929 | <span class="n">_maps</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
|
930 | 930 | <span class="c1"># libtorch_global_deps.so always depends in cudart, check if its installed via wheel</span>
|
931 | 931 | <span class="k">if</span> <span class="s2">"nvidia/cuda_runtime/lib/libcudart.so"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">_maps</span><span class="p">:</span>
|
932 | 932 | <span class="k">return</span>
|
933 |
| - <span class="c1"># If all abovementioned conditions are met, preload nvjitlink</span> |
| 933 | + <span class="c1"># If all above-mentioned conditions are met, preload nvrtc and nvjitlink</span> |
| 934 | + <span class="c1"># Please note that order are important for CUDA-11.8 , as nvjitlink does not exist there</span> |
| 935 | + <span class="n">_preload_cuda_deps</span><span class="p">(</span><span class="s2">"cuda_nvrtc"</span><span class="p">,</span> <span class="s2">"libnvrtc.so.*[0-9]"</span><span class="p">)</span> |
934 | 936 | <span class="n">_preload_cuda_deps</span><span class="p">(</span><span class="s2">"nvjitlink"</span><span class="p">,</span> <span class="s2">"libnvJitLink.so.*[0-9]"</span><span class="p">)</span>
|
935 | 937 | <span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
|
936 | 938 | <span class="k">pass</span>
|
|
0 commit comments