Skip to content

Commit 9297a3d

Browse files
Merge branch 'main' into master
2 parents 3ae5d7d + 123dd5c commit 9297a3d

22 files changed

+757
-62
lines changed

.jenkins/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ sudo apt-get install -y pandoc
2121

2222
#Install PyTorch Nightly for test.
2323
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
24-
# Install 2.2 for testing - uncomment to install nightly binaries (update the version as needed).
25-
# pip uninstall -y torch torchvision torchaudio torchtext torchdata
26-
# pip3 install torch==2.3.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu121
24+
# Install 2.4 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
25+
pip uninstall -y torch torchvision torchaudio torchtext torchdata
26+
pip3 install torch==2.4.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
2727

2828
# Install two language tokenizers for Translation with TorchText tutorial
2929
python -m spacy download en_core_web_sm

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"intermediate_source/fx_conv_bn_fuser",
3030
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release
3131
"advanced_source/super_resolution_with_onnxruntime",
32-
"advanced_source/python_custom_ops", # https://github.com/pytorch/pytorch/issues/127443
3332
"advanced_source/usb_semisup_learn", # fails with CUDA OOM error, should try on a different worker
3433
"prototype_source/fx_graph_mode_ptq_dynamic",
3534
"prototype_source/vmap_recipe",
@@ -54,8 +53,6 @@
5453
"intermediate_source/flask_rest_api_tutorial",
5554
"intermediate_source/text_to_speech_with_torchaudio",
5655
"intermediate_source/tensorboard_profiler_tutorial", # reenable after 2.0 release.
57-
"intermediate_source/inductor_debug_cpu", # reenable after 2942
58-
"beginner_source/onnx/onnx_registry_tutorial", # reenable after 2941 is fixed.
5956
"intermediate_source/torch_export_tutorial" # reenable after 2940 is fixed.
6057
]
6158

486 KB
Loading
423 KB
Loading
3.52 KB
Loading
-22.1 KB
Binary file not shown.
19 KB
Loading

advanced_source/cpp_custom_ops.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,4 +417,4 @@ Conclusion
417417
In this tutorial, we went over the recommended approach to integrating Custom C++
418418
and CUDA operators with PyTorch. The ``TORCH_LIBRARY/torch.library`` APIs are fairly
419419
low-level. For more information about how to use the API, see
420-
`The Custom Operators Manual <https://pytorch.org/docs/main/notes/custom_operators.html>`_.
420+
`The Custom Operators Manual <https://pytorch.org/tutorials/advanced/custom_ops_landing_page.html#the-custom-operators-manual>`_.

advanced_source/cpp_extension.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Custom C++ and CUDA Extensions
22
==============================
33
**Author**: `Peter Goldsborough <https://www.goldsborough.me/>`_
44

5+
.. warning::
6+
7+
This tutorial is deprecated as of PyTorch 2.4. Please see :ref:`custom-ops-landing-page`
8+
for the newest up-to-date guides on extending PyTorch with Custom C++/CUDA Extensions.
59

610
PyTorch provides a plethora of operations related to neural networks, arbitrary
711
tensor algebra, data wrangling and other purposes. However, you may still find
@@ -225,7 +229,7 @@ Instead of:
225229
Currently open issue for nvcc bug `here
226230
<https://github.com/pytorch/pytorch/issues/69460>`_.
227231
Complete workaround code example `here
228-
<https://github.com/facebookresearch/pytorch3d/commit/cb170ac024a949f1f9614ffe6af1c38d972f7d48>`_.
232+
<https://github.com/facebookresearch/pytorch3d/commit/cb170ac024a949f1f9614ffe6af1c38d972f7d48>`_.
229233

230234
Forward Pass
231235
************

advanced_source/custom_ops_landing_page.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _custom-ops-landing-page:
22

3-
PyTorch Custom Operators Landing Page
4-
=====================================
3+
PyTorch Custom Operators
4+
===========================
55

66
PyTorch offers a large library of operators that work on Tensors (e.g. ``torch.add``,
77
``torch.sum``, etc). However, you may wish to bring a new custom operation to PyTorch
@@ -10,26 +10,27 @@ In order to do so, you must register the custom operation with PyTorch via the P
1010
`torch.library docs <https://pytorch.org/docs/stable/library.html>`_ or C++ ``TORCH_LIBRARY``
1111
APIs.
1212

13-
TL;DR
14-
-----
13+
1514

1615
Authoring a custom operator from Python
1716
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1817

1918
Please see :ref:`python-custom-ops-tutorial`.
2019

2120
You may wish to author a custom operator from Python (as opposed to C++) if:
21+
2222
- you have a Python function you want PyTorch to treat as an opaque callable, especially with
23-
respect to ``torch.compile`` and ``torch.export``.
23+
respect to ``torch.compile`` and ``torch.export``.
2424
- you have some Python bindings to C++/CUDA kernels and want those to compose with PyTorch
25-
subsystems (like ``torch.compile`` or ``torch.autograd``)
25+
subsystems (like ``torch.compile`` or ``torch.autograd``)
2626

2727
Integrating custom C++ and/or CUDA code with PyTorch
2828
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2929

3030
Please see :ref:`cpp-custom-ops-tutorial`.
3131

3232
You may wish to author a custom operator from C++ (as opposed to Python) if:
33+
3334
- you have custom C++ and/or CUDA code.
3435
- you plan to use this code with ``AOTInductor`` to do Python-less inference.
3536

0 commit comments

Comments
 (0)