From a80c67cd40320ceb3637a8b1892f2bbfa6f06ad5 Mon Sep 17 00:00:00 2001 From: Jerry Zhang Date: Wed, 14 Aug 2024 14:37:39 -0700 Subject: [PATCH] Move developer guide file to a folder Summary: Moved the dev api guide to a folder and we plan to add more developer guide examples e.g. ``` developer_api_guide/training.py - how to make a tensor subclass trainable developer_api_guide/fsdp.py - how to make a tensor subclass work with fsdp developer_api_guide/tensor_parallel.py - how to make a tensor subclass work with tensor parallelism developer_api_guide/autoquant.py - how to make a tensor subclass work with autoquant ... ``` Test Plan: python test/tutorials/developer_api_guide/my_dtype_tensor_subclass.py Reviewers: Subscribers: Tasks: Tags: --- .../my_dtype_tensor_subclass.py} | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename tutorials/{developer_api_guide.py => developer_api_guide/my_dtype_tensor_subclass.py} (96%) diff --git a/tutorials/developer_api_guide.py b/tutorials/developer_api_guide/my_dtype_tensor_subclass.py similarity index 96% rename from tutorials/developer_api_guide.py rename to tutorials/developer_api_guide/my_dtype_tensor_subclass.py index 9c670e14b9..f2ed169289 100644 --- a/tutorials/developer_api_guide.py +++ b/tutorials/developer_api_guide/my_dtype_tensor_subclass.py @@ -1,9 +1,11 @@ -# Following is a example for a simple dtype implemented with tensor subclass -# it shows -# * the basic structure of a new dtype tensor subclass (__new__, __init__, __tensor_flatten__, __tensor_unflatten__) -# * two types of dispatch that people can overwrite (__torch_function__, __torch_dispatch__) -# * how to abstract away packing format with layout -# * how the tensor subclass composes with torch.compile to get speedup +""" +Following is a example for a simple dtype implemented with tensor subclass +it shows + * the basic structure of a new dtype tensor subclass (__new__, __init__, __tensor_flatten__, __tensor_unflatten__) + * two types of dispatch that people can overwrite (__torch_function__, __torch_dispatch__) + * how to abstract away packing format with layout + * how the tensor subclass composes with torch.compile to get speedup +""" import functools