Rate this Page

Computation times#

00:26.477 total execution time for 129 files from all galleries:

Example

Time

Mem (MB)

(beta) Utilizing Torch Function modes with torch.compile (recipes_source/torch_compile_torch_function_modes.py)

00:11.063

0.0

How to save memory by fusing the optimizer step into the backward pass (intermediate_source/optimizer_step_in_backward_tutorial.py)

00:09.173

0.0

sphx_glr_beginner_basics_transforms_tutorial.py (beginner_source/basics/transforms_tutorial.py)

00:04.312

0.0

Model ensembling (intermediate_source/ensembling.py)

00:00.756

0.0

Using Variable Length Attention in PyTorch (intermediate_source/variable_length_attention_tutorial.py)

00:00.464

0.0

Introduction to PyTorch (beginner_source/nlp/pytorch_tutorial.py)

00:00.362

0.0

torch.vmap (unstable_source/vmap_recipe.py)

00:00.129

0.0

Chatbot Tutorial (beginner_source/chatbot_tutorial.py)

00:00.003

0.0

Knowledge Distillation Tutorial (beginner_source/knowledge_distillation_tutorial.py)

00:00.003

0.0

DCGAN Tutorial (beginner_source/dcgan_faces_tutorial.py)

00:00.003

0.0

(Beta) Implementing High-Performance Transformers with Scaled Dot Product Attention (SDPA) (intermediate_source/scaled_dot_product_attention_tutorial.py)

00:00.003

0.0

torch.export Tutorial (intermediate_source/torch_export_tutorial.py)

00:00.003

0.0

Accelerating PyTorch Transformers by replacing nn.Transformer with Nested Tensors and torch.compile() (intermediate_source/transformer_building_blocks.py)

00:00.003

0.0

sphx_glr_beginner_introyt_introyt1_tutorial.py (beginner_source/introyt/introyt1_tutorial.py)

00:00.003

0.0

Deep Learning with PyTorch (beginner_source/nlp/deep_learning_tutorial.py)

00:00.003

0.0

NLP From Scratch: Generating Names with a Character-Level RNN (intermediate_source/char_rnn_generation_tutorial.py)

00:00.003

0.0

Introduction to torch.compile (intermediate_source/torch_compile_tutorial.py)

00:00.003

0.0

Inductor CPU backend debugging and profiling (intermediate_source/inductor_debug_cpu.py)

00:00.003

0.0

A guide on good usage of non_blocking and pin_memory() in PyTorch (intermediate_source/pinmem_nonblock.py)

00:00.003

0.0

sphx_glr_beginner_introyt_trainingyt.py (beginner_source/introyt/trainingyt.py)

00:00.003

0.0

sphx_glr_beginner_introyt_tensorboardyt_tutorial.py (beginner_source/introyt/tensorboardyt_tutorial.py)

00:00.003

0.0

Forward-mode Automatic Differentiation (Beta) (intermediate_source/forward_ad_usage.py)

00:00.003

0.0

TorchVision Object Detection Finetuning Tutorial (intermediate_source/torchvision_tutorial.py)

00:00.003

0.0

Jacobians, Hessians, hvp, vhp, and more: composing function transforms (intermediate_source/jacobians_hessians.py)

00:00.003

0.0

Transfer Learning for Computer Vision Tutorial (beginner_source/transfer_learning_tutorial.py)

00:00.003

0.0

Adversarial Example Generation (beginner_source/fgsm_tutorial.py)

00:00.003

0.0

(prototype) GPU Quantization with TorchAO (unstable_source/gpu_quantization_torchao_tutorial.py)

00:00.003

0.0

Channels Last Memory Format in PyTorch (intermediate_source/memory_format_tutorial.py)

00:00.002

0.0

Training a Classifier (beginner_source/blitz/cifar10_tutorial.py)

00:00.002

0.0

Neural Transfer Using PyTorch (advanced_source/neural_style_tutorial.py)

00:00.002

0.0

MaskedTensor Overview (unstable_source/maskedtensor_overview.py)

00:00.002

0.0

Train a Mario-playing RL Agent (intermediate_source/mario_rl_tutorial.py)

00:00.002

0.0

Sequence Models and Long Short-Term Memory Networks (beginner_source/nlp/sequence_models_tutorial.py)

00:00.002

0.0

torch.compile End-to-End Tutorial (intermediate_source/torch_compile_full_example.py)

00:00.002

0.0

Reinforcement Learning (PPO) with TorchRL Tutorial (intermediate_source/reinforcement_ppo.py)

00:00.002

0.0

Dynamic Compilation Control with torch.compiler.set_stance (recipes_source/torch_compiler_set_stance_tutorial.py)

00:00.002

0.0

Hooks for autograd saved tensors (intermediate_source/autograd_saved_tensors_hooks_tutorial.py)

00:00.002

0.0

TorchRL objectives: Coding a DDPG loss (advanced_source/coding_ddpg.py)

00:00.002

0.0

Advanced: Making Dynamic Decisions and the Bi-LSTM CRF (beginner_source/nlp/advanced_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_onnx_onnx_registry_tutorial.py (beginner_source/onnx/onnx_registry_tutorial.py)

00:00.002

0.0

Writing Custom Datasets, DataLoaders and Transforms (beginner_source/data_loading_tutorial.py)

00:00.002

0.0

Distributed training at scale with PyTorch and Ray Train (beginner_source/distributed_training_with_ray_tutorial.py)

00:00.002

0.0

Understanding requires_grad, retain_grad, Leaf, and Non-leaf Tensors (beginner_source/understanding_leaf_vs_nonleaf_tutorial.py)

00:00.002

0.0

NLP From Scratch: Classifying Names with a Character-Level RNN (intermediate_source/char_rnn_classification_tutorial.py)

00:00.002

0.0

Spatial Transformer Networks Tutorial (intermediate_source/spatial_transformer_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_basics_quickstart_tutorial.py (beginner_source/basics/quickstart_tutorial.py)

00:00.002

0.0

Explicit horizontal fusion with foreach_map and torch.compile (recipes_source/foreach_map.py)

00:00.002

0.0

What is torch.nn really? (beginner_source/nn_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_introyt_tensors_deeper_tutorial.py (beginner_source/introyt/tensors_deeper_tutorial.py)

00:00.002

0.0

(beta) Running the compiled optimizer with an LR Scheduler (recipes_source/compiling_optimizer_lr_scheduler.py)

00:00.002

0.0

Data Loading Optimization in PyTorch (intermediate_source/intermediate_data_loading_tutorial.py)

00:00.002

0.0

Custom Python Operators (advanced_source/python_custom_ops.py)

00:00.002

0.0

A Gentle Introduction to torch.autograd (beginner_source/blitz/autograd_tutorial.py)

00:00.002

0.0

Efficiently writing “sparse” semantics for Adagrad with MaskedTensor (unstable_source/maskedtensor_adagrad.py)

00:00.002

0.0

Parametrizations Tutorial (intermediate_source/parametrizations.py)

00:00.002

0.0

Tensors (beginner_source/blitz/tensor_tutorial.py)

00:00.002

0.0

Fusing Convolution and Batch Norm using Custom Function (intermediate_source/custom_function_conv_bn_tutorial.py)

00:00.002

0.0

Getting Started with Nested Tensors (unstable_source/nestedtensor.py)

00:00.002

0.0

Creating Extensions Using NumPy and SciPy (advanced_source/numpy_extensions_tutorial.py)

00:00.002

0.0

Neural Tangent Kernels (intermediate_source/neural_tangent_kernels.py)

00:00.002

0.0

sphx_glr_beginner_basics_tensorqs_tutorial.py (beginner_source/basics/tensorqs_tutorial.py)

00:00.002

0.0

Reinforcement Learning (DQN) Tutorial (intermediate_source/reinforcement_q_learning.py)

00:00.002

0.0

Serve PyTorch models at scale with Ray Serve (beginner_source/serving_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_basics_data_tutorial.py (beginner_source/basics/data_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_onnx_export_simple_model_to_onnx_tutorial.py (beginner_source/onnx/export_simple_model_to_onnx_tutorial.py)

00:00.002

0.0

Optional: Data Parallelism (beginner_source/blitz/data_parallel_tutorial.py)

00:00.002

0.0

Per-sample-gradients (intermediate_source/per_sample_grads.py)

00:00.002

0.0

Word Embeddings: Encoding Lexical Semantics (beginner_source/nlp/word_embeddings_tutorial.py)

00:00.002

0.0

NLP From Scratch: Translation with a Sequence to Sequence Network and Attention (intermediate_source/seq2seq_translation_tutorial.py)

00:00.002

0.0

MaskedTensor Advanced Semantics (unstable_source/maskedtensor_advanced_semantics.py)

00:00.002

0.0

(beta) Using TORCH_LOGS python API with torch.compile (recipes_source/torch_logs.py)

00:00.002

0.0

Pendulum: Writing your environment and transforms with TorchRL (advanced_source/pendulum.py)

00:00.002

0.0

sphx_glr_beginner_basics_optimization_tutorial.py (beginner_source/basics/optimization_tutorial.py)

00:00.002

0.0

Tips for Loading an nn.Module from a Checkpoint (recipes_source/recipes/module_load_state_dict_tips.py)

00:00.002

0.0

Multi-Objective NAS with Ax (intermediate_source/ax_multiobjective_nas_tutorial.py)

00:00.002

0.0

MaskedTensor Sparsity (unstable_source/maskedtensor_sparsity.py)

00:00.002

0.0

Pruning Tutorial (intermediate_source/pruning_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_introyt_autogradyt_tutorial.py (beginner_source/introyt/autogradyt_tutorial.py)

00:00.002

0.0

Visualizing Gradients (intermediate_source/visualizing_gradients_tutorial.py)

00:00.002

0.0

Template Tutorial (beginner_source/template_tutorial.py)

00:00.002

0.0

Hyperparameter tuning using Ray Tune (beginner_source/hyperparameter_tuning_tutorial.py)

00:00.002

0.0

Reducing torch.compile cold start compilation time with regional compilation (recipes_source/regional_compilation.py)

00:00.002

0.0

sphx_glr_beginner_basics_buildmodel_tutorial.py (beginner_source/basics/buildmodel_tutorial.py)

00:00.002

0.0

Using User-Defined Triton Kernels with torch.compile (recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_basics_autogradqs_tutorial.py (beginner_source/basics/autogradqs_tutorial.py)

00:00.002

0.0

(beta) Building a Simple CPU Performance Profiler with FX (intermediate_source/fx_profiling_tutorial.py)

00:00.002

0.0

Reasoning about Shapes in PyTorch (recipes_source/recipes/reasoning_about_shapes.py)

00:00.002

0.0

Neural Networks (beginner_source/blitz/neural_networks_tutorial.py)

00:00.002

0.0

Extension points in nn.Module for load_state_dict and tensor subclasses (recipes_source/recipes/swap_tensors.py)

00:00.002

0.0

PyTorch: nn (beginner_source/examples_nn/polynomial_nn.py)

00:00.002

0.0

Warm-up: numpy (beginner_source/examples_tensor/polynomial_numpy.py)

00:00.002

0.0

Changing default device (recipes_source/recipes/changing_default_device.py)

00:00.002

0.0

Reducing AoT cold start compilation time with regional compilation (recipes_source/regional_aot.py)

00:00.002

0.0

sphx_glr_beginner_onnx_export_control_flow_model_to_onnx_tutorial.py (beginner_source/onnx/export_control_flow_model_to_onnx_tutorial.py)

00:00.002

0.0

torch.export AOTInductor Tutorial for Python runtime (Beta) (recipes_source/torch_export_aoti_python.py)

00:00.002

0.0

DebugMode: Recording Dispatched Operations and Numerical Debugging (recipes_source/debug_mode_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_basics_saveloadrun_tutorial.py (beginner_source/basics/saveloadrun_tutorial.py)

00:00.002

0.0

sphx_glr_beginner_introyt_modelsyt_tutorial.py (beginner_source/introyt/modelsyt_tutorial.py)

00:00.002

0.0

PyTorch: Tensors (beginner_source/examples_tensor/polynomial_tensor.py)

00:00.002

0.0

(beta) Accelerating BERT with semi-structured (2:4) sparsity (advanced_source/semi_structured_sparse.py)

00:00.000

0.0

Semi-Supervised Learning using USB built upon PyTorch (advanced_source/usb_semisup_learn.py)

00:00.000

0.0

sphx_glr_beginner_basics_intro.py (beginner_source/basics/intro.py)

00:00.000

0.0

PyTorch: Tensors and autograd (beginner_source/examples_autograd/polynomial_autograd.py)

00:00.000

0.0

PyTorch: Defining New autograd Functions (beginner_source/examples_autograd/polynomial_custom_function.py)

00:00.000

0.0

PyTorch: Control Flow + Weight Sharing (beginner_source/examples_nn/dynamic_net.py)

00:00.000

0.0

PyTorch: Custom nn Modules (beginner_source/examples_nn/polynomial_module.py)

00:00.000

0.0

PyTorch: optim (beginner_source/examples_nn/polynomial_optim.py)

00:00.000

0.0

sphx_glr_beginner_introyt_captumyt.py (beginner_source/introyt/captumyt.py)

00:00.000

0.0

sphx_glr_beginner_introyt_introyt_index.py (beginner_source/introyt/introyt_index.py)

00:00.000

0.0

Mosaic: Memory Profiling for PyTorch (beginner_source/mosaic_memory_profiling_tutorial.py)

00:00.000

0.0

sphx_glr_beginner_onnx_intro_onnx.py (beginner_source/onnx/intro_onnx.py)

00:00.000

0.0

Profiling your PyTorch Module (beginner_source/profiler.py)

00:00.000

0.0

Saving and Loading Models (beginner_source/saving_loading_models.py)

00:00.000

0.0

Recurrent DQN: Training recurrent policies (intermediate_source/dqn_with_rnn_tutorial.py)

00:00.000

0.0

sphx_glr_intermediate_mnist_train_nas.py (intermediate_source/mnist_train_nas.py)

00:00.000

0.0

Building a Convolution/Batch Norm fuser with torch.compile (intermediate_source/torch_compile_conv_bn_fuser.py)

00:00.000

0.0

Introduction to TorchRec (intermediate_source/torchrec_intro_tutorial.py)

00:00.000

0.0

Model Interpretability using Captum (recipes_source/recipes/Captum_Recipe.py)

00:00.000

0.0

Automatic Mixed Precision (recipes_source/recipes/amp_recipe.py)

00:00.000

0.0

SyntaxError (recipes_source/recipes/benchmark.py)

00:00.000

0.0

Defining a Neural Network in PyTorch (recipes_source/recipes/defining_a_neural_network.py)

00:00.000

0.0

PyTorch Profiler (recipes_source/recipes/profiler_recipe.py)

00:00.000

0.0

How to use TensorBoard with PyTorch (recipes_source/recipes/tensorboard_with_pytorch.py)

00:00.000

0.0

Timer quick start (recipes_source/recipes/timer_quick_start.py)

00:00.000

0.0

Performance Tuning Guide (recipes_source/recipes/tuning_guide.py)

00:00.000

0.0

Warmstarting model using parameters from a different model in PyTorch (recipes_source/recipes/warmstarting_model_using_parameters_from_a_different_model.py)

00:00.000

0.0

What is a state_dict in PyTorch (recipes_source/recipes/what_is_state_dict.py)

00:00.000

0.0

Zeroing out gradients in PyTorch (recipes_source/recipes/zeroing_out_gradients.py)

00:00.000

0.0

(prototype) Accelerating torch.save and torch.load with GPUDirect Storage (unstable_source/gpu_direct_storage.py)

00:00.000

0.0