diff --git a/.flake8 b/.flake8 index fc9ab167fbe..fa73b7b880f 100644 --- a/.flake8 +++ b/.flake8 @@ -73,7 +73,7 @@ exclude = ./docs/src, ./functorch/docs, ./functorch/examples, - ./functorch/notebooks, + ./functorch/docs/source/tutorials, ./scripts, ./test/generated_type_hints_smoketest.py, ./third_party, diff --git a/.lintrunner.toml b/.lintrunner.toml index 944829fa389..1f79f1eb971 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -13,7 +13,7 @@ exclude_patterns = [ '**/fb/**', 'functorch/docs/**', 'functorch/examples/**', - 'functorch/notebooks/**', + 'functorch/docs/source/tutorials/**', 'torch/_inductor/fx_passes/serialized_patterns/**', 'torch/_inductor/autoheuristic/artifacts/**', 'scripts/**', @@ -1568,7 +1568,6 @@ include_patterns = [ exclude_patterns = [ 'caffe2/**', 'functorch/docs/**', - 'functorch/notebooks/**', 'torch/_inductor/fx_passes/serialized_patterns/**', 'torch/_inductor/autoheuristic/artifacts/**', 'test/dynamo/cpython/**', diff --git a/functorch/COMPILE_README.md b/functorch/COMPILE_README.md index 964cda6fbec..47ca484e7c0 100644 --- a/functorch/COMPILE_README.md +++ b/functorch/COMPILE_README.md @@ -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. ## 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. diff --git a/functorch/docs/source/conf.py b/functorch/docs/source/conf.py index 4a47b74f81f..749a8435c03 100644 --- a/functorch/docs/source/conf.py +++ b/functorch/docs/source/conf.py @@ -50,7 +50,7 @@ extensions = [ "myst_nb", ] -# sys.path.insert(0, os.path.abspath('./notebooks')) +# sys.path.insert(0, os.path.abspath('./tutorials')) # build the templated autosummary files # autosummary_generate = True @@ -131,7 +131,7 @@ language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # 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. pygments_style = "sphinx" diff --git a/functorch/docs/source/index.rst b/functorch/docs/source/index.rst index 5f988524fb0..894fb9995af 100644 --- a/functorch/docs/source/index.rst +++ b/functorch/docs/source/index.rst @@ -55,7 +55,7 @@ Check out our `whirlwind tour `_ or some of our tutorials mentio :caption: functorch: Getting Started install - notebooks/whirlwind_tour.ipynb + tutorials/whirlwind_tour.ipynb ux_limitations .. toctree:: @@ -70,9 +70,9 @@ Check out our `whirlwind tour `_ or some of our tutorials mentio :maxdepth: 1 :caption: functorch Tutorials - notebooks/jacobians_hessians.ipynb - notebooks/ensembling.ipynb - notebooks/per_sample_grads.ipynb - notebooks/neural_tangent_kernels.ipynb - notebooks/aot_autograd_optimizations.ipynb - notebooks/minifier.ipynb + tutorials/jacobians_hessians.ipynb + tutorials/ensembling.ipynb + tutorials/per_sample_grads.ipynb + tutorials/neural_tangent_kernels.ipynb + tutorials/aot_autograd_optimizations.ipynb + tutorials/minifier.ipynb diff --git a/functorch/docs/source/notebooks b/functorch/docs/source/notebooks deleted file mode 120000 index d4082256dcf..00000000000 --- a/functorch/docs/source/notebooks +++ /dev/null @@ -1 +0,0 @@ -../../notebooks/ \ No newline at end of file diff --git a/functorch/notebooks/_src/plot_ensembling.py b/functorch/docs/source/tutorials/_src/plot_ensembling.py similarity index 100% rename from functorch/notebooks/_src/plot_ensembling.py rename to functorch/docs/source/tutorials/_src/plot_ensembling.py diff --git a/functorch/notebooks/_src/plot_jacobians_and_hessians.py b/functorch/docs/source/tutorials/_src/plot_jacobians_and_hessians.py similarity index 100% rename from functorch/notebooks/_src/plot_jacobians_and_hessians.py rename to functorch/docs/source/tutorials/_src/plot_jacobians_and_hessians.py diff --git a/functorch/notebooks/_src/plot_per_sample_gradients.py b/functorch/docs/source/tutorials/_src/plot_per_sample_gradients.py similarity index 100% rename from functorch/notebooks/_src/plot_per_sample_gradients.py rename to functorch/docs/source/tutorials/_src/plot_per_sample_gradients.py diff --git a/functorch/notebooks/aot_autograd_optimizations.ipynb b/functorch/docs/source/tutorials/aot_autograd_optimizations.ipynb similarity index 99% rename from functorch/notebooks/aot_autograd_optimizations.ipynb rename to functorch/docs/source/tutorials/aot_autograd_optimizations.ipynb index 9a2db0fa9d1..a0979325976 100644 --- a/functorch/notebooks/aot_autograd_optimizations.ipynb +++ b/functorch/docs/source/tutorials/aot_autograd_optimizations.ipynb @@ -6,7 +6,7 @@ "source": [ "# AOT Autograd - How to use and optimize?\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/functorch/notebooks/ensembling.ipynb b/functorch/docs/source/tutorials/ensembling.ipynb similarity index 99% rename from functorch/notebooks/ensembling.ipynb rename to functorch/docs/source/tutorials/ensembling.ipynb index 1ecc8738b0b..e7e4857f187 100644 --- a/functorch/notebooks/ensembling.ipynb +++ b/functorch/docs/source/tutorials/ensembling.ipynb @@ -11,7 +11,7 @@ "\n", "This example illustrates how to vectorize model ensembling using vmap.\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/functorch/notebooks/jacobians_hessians.ipynb b/functorch/docs/source/tutorials/jacobians_hessians.ipynb similarity index 99% rename from functorch/notebooks/jacobians_hessians.ipynb rename to functorch/docs/source/tutorials/jacobians_hessians.ipynb index 4acf2ec609f..4e2f7d0908a 100644 --- a/functorch/notebooks/jacobians_hessians.ipynb +++ b/functorch/docs/source/tutorials/jacobians_hessians.ipynb @@ -5,7 +5,7 @@ "source": [ "# Jacobians, Hessians, hvp, vhp, and more: composing functorch transforms\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/functorch/notebooks/minifier.ipynb b/functorch/docs/source/tutorials/minifier.ipynb similarity index 100% rename from functorch/notebooks/minifier.ipynb rename to functorch/docs/source/tutorials/minifier.ipynb diff --git a/functorch/notebooks/neural_tangent_kernels.ipynb b/functorch/docs/source/tutorials/neural_tangent_kernels.ipynb similarity index 99% rename from functorch/notebooks/neural_tangent_kernels.ipynb rename to functorch/docs/source/tutorials/neural_tangent_kernels.ipynb index 9d041be9092..0d4704cedf4 100644 --- a/functorch/notebooks/neural_tangent_kernels.ipynb +++ b/functorch/docs/source/tutorials/neural_tangent_kernels.ipynb @@ -7,7 +7,7 @@ "source": [ "# Neural Tangent Kernels\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/functorch/notebooks/per_sample_grads.ipynb b/functorch/docs/source/tutorials/per_sample_grads.ipynb similarity index 99% rename from functorch/notebooks/per_sample_grads.ipynb rename to functorch/docs/source/tutorials/per_sample_grads.ipynb index e2317351f7e..5d5fc7206e1 100644 --- a/functorch/notebooks/per_sample_grads.ipynb +++ b/functorch/docs/source/tutorials/per_sample_grads.ipynb @@ -9,7 +9,7 @@ "source": [ "# Per-sample-gradients\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/functorch/notebooks/whirlwind_tour.ipynb b/functorch/docs/source/tutorials/whirlwind_tour.ipynb similarity index 99% rename from functorch/notebooks/whirlwind_tour.ipynb rename to functorch/docs/source/tutorials/whirlwind_tour.ipynb index deae3418966..4e0236db408 100644 --- a/functorch/notebooks/whirlwind_tour.ipynb +++ b/functorch/docs/source/tutorials/whirlwind_tour.ipynb @@ -7,7 +7,7 @@ "source": [ "# Whirlwind Tour\n", "\n", - "\n", + "\n", " \"Open\n", "\n", "\n", diff --git a/pyproject.toml b/pyproject.toml index afc5aba2ccd..874c629273d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -278,7 +278,7 @@ keep-runtime-typing = true "PYI021", # docstring-in-stub "PYI053", # string-or-bytes-too-long ] -"functorch/notebooks/**" = [ +"functorch/docs/source/tutorials/**" = [ "F401", ] "test/export/**" = [