Skip to content

Commit

Permalink
Stop checking in VmapGeneratedPlumbing.h (pytorch#82351)
Browse files Browse the repository at this point in the history
This PR changes VmapGeneratedPlumbing.h to be generated by torchgen. The
output file is ATen/VmapGeneratedPlumbing.h.

Why generate this file inside PyTorch codegen instead of a separate step
in functorch?
- I can't figure out how to get functorch's fbcode target to generate
- functorch's build system will, in the mid-term, be absorbed into
pytorch's build system, so I don't want to do the extra work of adding
a step to the functorch build process.

Test Plan:
- build pytorch, build functorch
Pull Request resolved: pytorch#82351
Approved by: https://github.com/ezyang
  • Loading branch information
zou3519 authored and pytorchmergebot committed Jul 27, 2022
1 parent d80fe49 commit 5c92777
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5,537 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ generated_cpu_cpp = [
"aten/src/ATen/MethodOperators.h",
"aten/src/ATen/NativeMetaFunctions.h",
"aten/src/ATen/RegistrationDeclarations.h",
"aten/src/ATen/VmapGeneratedPlumbing.h",
"aten/src/ATen/core/aten_interned_strings.h",
"aten/src/ATen/core/enum_tag.h",
"aten/src/ATen/core/TensorBody.h",
Expand Down
1 change: 1 addition & 0 deletions build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ GENERATED_H = [
"FunctionalInverses.h",
"RedispatchFunctions.h",
"RegistrationDeclarations.h",
"VmapGeneratedPlumbing.h",
]

GENERATED_H_CORE = [
Expand Down
53 changes: 0 additions & 53 deletions functorch/codegen/gen.py

This file was deleted.

2 changes: 1 addition & 1 deletion functorch/functorch/csrc/BatchRulesHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <functorch/csrc/PlumbingHelper.h>
#include <ATen/core/dispatch/Dispatcher.h>
#include <functorch/csrc/Constants.h>
#include <functorch/csrc/VmapGeneratedPlumbing.h>
#include <ATen/VmapGeneratedPlumbing.h>

namespace at { namespace functorch {
Tensor reshape_dim_into(int64_t src, int64_t dst, const Tensor& x);
Expand Down
2 changes: 1 addition & 1 deletion functorch/functorch/csrc/BatchingMetaprogramming.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once
#include <ATen/Tensor.h>
#include <functorch/csrc/VmapGeneratedPlumbing.h>
#include <ATen/VmapGeneratedPlumbing.h>

namespace at {
namespace functorch {
Expand Down
Loading

0 comments on commit 5c92777

Please sign in to comment.