Skip to content

Commit

Permalink
Add new Python and C++/CUDA Custom Op tutorials (#2888)
Browse files Browse the repository at this point in the history
* Add new Python and C++/CUDA Custom Op tutorials

I want to land this before PyTorch 2.4 (so we can link to these in
PyTorch's nightly documentation) and then have a follow-up PR for 2.4
that actually runs the scripts (so that they can generate outputs).

pytorch/pytorch#127443 to remind myself of the
above.

NB: These two tutorials replace all of the existing custom ops (and cpp
extensions) tutorials:
- advanced/cpp_extension
- advanced/torch_script_custom_ops
- advanced/torch_script_custom_classes
- advanced/dispatcher

In a follow-up PR we will add warnings to all of those tutorials stating
that they are deprecated but we will preserve the text just in case
people still need them (e.g. if they are not using PyTorch 2.4).

Test Plan:
- I tested these locally.

* Fix cpp custom ops tutorial per review

* update

* update index.rst

* Update

* update

* update
  • Loading branch information
zou3519 authored Jun 18, 2024
1 parent 63f987d commit 91540a8
Show file tree
Hide file tree
Showing 6 changed files with 771 additions and 3 deletions.
1 change: 1 addition & 0 deletions .jenkins/validate_tutorials_built.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"intermediate_source/fx_conv_bn_fuser",
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release
"advanced_source/super_resolution_with_onnxruntime",
"advanced_source/python_custom_ops", # https://github.com/pytorch/pytorch/issues/127443
"advanced_source/ddp_pipeline", # requires 4 gpus
"advanced_source/usb_semisup_learn", # fails with CUDA OOM error, should try on a different worker
"prototype_source/fx_graph_mode_ptq_dynamic",
Expand Down
Loading

0 comments on commit 91540a8

Please sign in to comment.