Make functorch notebook symlinks PEP 517 valid (#157813)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157813
Approved by: https://github.com/zou3519, https://github.com/atalman
This commit is contained in:
Klaus Zimmermann
2025-09-11 14:27:34 +02:00
committed by PyTorch MergeBot
parent 872ed60679
commit 31345fb4f7
17 changed files with 19 additions and 21 deletions

View File

@ -73,7 +73,7 @@ exclude =
./docs/src, ./docs/src,
./functorch/docs, ./functorch/docs,
./functorch/examples, ./functorch/examples,
./functorch/notebooks, ./functorch/docs/source/tutorials,
./scripts, ./scripts,
./test/generated_type_hints_smoketest.py, ./test/generated_type_hints_smoketest.py,
./third_party, ./third_party,

View File

@ -13,7 +13,7 @@ exclude_patterns = [
'**/fb/**', '**/fb/**',
'functorch/docs/**', 'functorch/docs/**',
'functorch/examples/**', 'functorch/examples/**',
'functorch/notebooks/**', 'functorch/docs/source/tutorials/**',
'torch/_inductor/fx_passes/serialized_patterns/**', 'torch/_inductor/fx_passes/serialized_patterns/**',
'torch/_inductor/autoheuristic/artifacts/**', 'torch/_inductor/autoheuristic/artifacts/**',
'scripts/**', 'scripts/**',
@ -1568,7 +1568,6 @@ include_patterns = [
exclude_patterns = [ exclude_patterns = [
'caffe2/**', 'caffe2/**',
'functorch/docs/**', 'functorch/docs/**',
'functorch/notebooks/**',
'torch/_inductor/fx_passes/serialized_patterns/**', 'torch/_inductor/fx_passes/serialized_patterns/**',
'torch/_inductor/autoheuristic/artifacts/**', 'torch/_inductor/autoheuristic/artifacts/**',
'test/dynamo/cpython/**', 'test/dynamo/cpython/**',

View File

@ -72,4 +72,4 @@ aot_function(f, ts_compiler, ts_compiler)(torch.randn(3, requires_grad=True))
* Min-cut [recomputation](https://dev-discuss.pytorch.org/t/min-cut-optimal-recomputation-i-e-activation-checkpointing-with-aotautograd/467) with AOT Autograd. * Min-cut [recomputation](https://dev-discuss.pytorch.org/t/min-cut-optimal-recomputation-i-e-activation-checkpointing-with-aotautograd/467) with AOT Autograd.
## Tutorials ## Tutorials
You can use this [tutorial](https://pytorch.org/functorch/nightly/notebooks/aot_autograd_optimizations.html) to play with AOT Autograd. You can use this [tutorial](https://pytorch.org/functorch/nightly/tutorials/aot_autograd_optimizations.html) to play with AOT Autograd.

View File

@ -50,7 +50,7 @@ extensions = [
"myst_nb", "myst_nb",
] ]
# sys.path.insert(0, os.path.abspath('./notebooks')) # sys.path.insert(0, os.path.abspath('./tutorials'))
# build the templated autosummary files # build the templated autosummary files
# autosummary_generate = True # autosummary_generate = True
@ -131,7 +131,7 @@ language = "en"
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path # This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["notebooks/colab**", "notebooks/_src/**"] exclude_patterns = ["tutorials/colab**", "tutorials/_src/**"]
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx" pygments_style = "sphinx"

View File

@ -55,7 +55,7 @@ Check out our `whirlwind tour <whirlwind_tour>`_ or some of our tutorials mentio
:caption: functorch: Getting Started :caption: functorch: Getting Started
install install
notebooks/whirlwind_tour.ipynb tutorials/whirlwind_tour.ipynb
ux_limitations ux_limitations
.. toctree:: .. toctree::
@ -70,9 +70,9 @@ Check out our `whirlwind tour <whirlwind_tour>`_ or some of our tutorials mentio
:maxdepth: 1 :maxdepth: 1
:caption: functorch Tutorials :caption: functorch Tutorials
notebooks/jacobians_hessians.ipynb tutorials/jacobians_hessians.ipynb
notebooks/ensembling.ipynb tutorials/ensembling.ipynb
notebooks/per_sample_grads.ipynb tutorials/per_sample_grads.ipynb
notebooks/neural_tangent_kernels.ipynb tutorials/neural_tangent_kernels.ipynb
notebooks/aot_autograd_optimizations.ipynb tutorials/aot_autograd_optimizations.ipynb
notebooks/minifier.ipynb tutorials/minifier.ipynb

View File

@ -1 +0,0 @@
../../notebooks/

View File

@ -6,7 +6,7 @@
"source": [ "source": [
"# AOT Autograd - How to use and optimize?\n", "# AOT Autograd - How to use and optimize?\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/aot_autograd_optimizations.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/aot_autograd_optimizations.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -11,7 +11,7 @@
"\n", "\n",
"This example illustrates how to vectorize model ensembling using vmap.\n", "This example illustrates how to vectorize model ensembling using vmap.\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/ensembling.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/ensembling.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -5,7 +5,7 @@
"source": [ "source": [
"# Jacobians, Hessians, hvp, vhp, and more: composing functorch transforms\n", "# Jacobians, Hessians, hvp, vhp, and more: composing functorch transforms\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/jacobians_hessians.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/jacobians_hessians.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -7,7 +7,7 @@
"source": [ "source": [
"# Neural Tangent Kernels\n", "# Neural Tangent Kernels\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/neural_tangent_kernels.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/neural_tangent_kernels.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -9,7 +9,7 @@
"source": [ "source": [
"# Per-sample-gradients\n", "# Per-sample-gradients\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/per_sample_grads.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/per_sample_grads.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -7,7 +7,7 @@
"source": [ "source": [
"# Whirlwind Tour\n", "# Whirlwind Tour\n",
"\n", "\n",
"<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/master/functorch/notebooks/whirlwind_tour.ipynb\">\n", "<a href=\"https://colab.research.google.com/github/pytorch/pytorch/blob/main/functorch/docs/source/tutorials/whirlwind_tour.ipynb\">\n",
" <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n", " <img style=\"width: auto\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
"</a>\n", "</a>\n",
"\n", "\n",

View File

@ -278,7 +278,7 @@ keep-runtime-typing = true
"PYI021", # docstring-in-stub "PYI021", # docstring-in-stub
"PYI053", # string-or-bytes-too-long "PYI053", # string-or-bytes-too-long
] ]
"functorch/notebooks/**" = [ "functorch/docs/source/tutorials/**" = [
"F401", "F401",
] ]
"test/export/**" = [ "test/export/**" = [