New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider not checking in autogenerated core/{Tensor.h,TensorMethods.h} #24931
Comments
This may be possible now because we don't actually need the Tensor class for the mobile build (we thought we did and we didn't build codegen for xplat). But I'm not sure if that's the long-term plan. Probably @ljk53 would know better. |
Yes let's stop checking it in. We'll need to macro our way to victory but it seems far preferable. |
I'm not sure why we need to macro our way to victory. |
My idea is that mobile would have a copy of Tensor.h but it just wouldn't have any methods on it. (But really any way to make this work would be fine by me.) |
I was hit by the same issue in PR #24937 . |
Don't generate named tensor methods to {Tensor,TensorMethods}.h when BUILD_NAMEDTENSOR=0 in an attempt to prevent fewer merge conflicts. We can either fix the root cause by solving #24931, or, in the short term, go through with this (hacky) solution. Here's what happens: 1) We filter out all named tensor declarations if BUILD_NAMEDTENSOR=0 so that they never hit the codegen. 2) What is checked in as {Tensor,TensorMethods}.h comes from a BUILD_NAMEDTENSOR=0 build. 3) When BUILD_NAMEDTENSOR=1, then GEN_TO_SOURCE is automatically set to 1. When working on a named tensor build, one must remember not to check in the generated code. Test Plan: - run ci [namedtensor ci]
…ds}.h" Don't generate named tensor methods to {Tensor,TensorMethods}.h Don't generate named tensor methods to {Tensor,TensorMethods}.h when BUILD_NAMEDTENSOR=0 in an attempt to prevent fewer merge conflicts. We can either fix the root cause by solving #24931, or, in the short term, go through with this (hacky) solution. Here's what happens: 1) We filter out all named tensor declarations if BUILD_NAMEDTENSOR=0 so that they never hit the codegen. 2) What is checked in as {Tensor,TensorMethods}.h comes from a BUILD_NAMEDTENSOR=0 build. 3) When BUILD_NAMEDTENSOR=1, then GEN_TO_SOURCE is automatically set to 1. When working on a named tensor build, one must remember not to check in the generated code. Test Plan: - run ci [namedtensor ci] gh-metadata: pytorch pytorch 25022 gh/zou3519/116/head
@ljk53 that's great! Let me try throwing up a patch that gets rid of the src checkin. |
Summary: Resolves #7416 . This PR implements the following indexing methods for sparse tensors: - [x] `select` - [x] `index_select` Note that this PR also modifies [gen.py](https://github.com/pytorch/pytorch/pull/24937/files#diff-76aa8cb3d0fad99c5f761d08cbcb4d19) that is not directly required to resolve the original issue but to work around a CI build issue reported in issue #24931 . Pull Request resolved: #24937 Differential Revision: D17163796 Pulled By: ezyang fbshipit-source-id: 06613301ec456d9ed3491b9ce48e804048600f09
Summary: Resolves pytorch/pytorch#7416 . This PR implements the following indexing methods for sparse tensors: - [x] `select` - [x] `index_select` Note that this PR also modifies [gen.py](https://github.com/pytorch/pytorch/pull/24937/files#diff-76aa8cb3d0fad99c5f761d08cbcb4d19) that is not directly required to resolve the original issue but to work around a CI build issue reported in issue pytorch/pytorch#24931 . Pull Request resolved: pytorch/pytorch#24937 Differential Revision: D17163796 Pulled By: ezyang fbshipit-source-id: 06613301ec456d9ed3491b9ce48e804048600f09
ATen/core/Tensor.h, ATen/core/TensorMethods.h are autogenerated and checked in. However, checking in autogenerated files is a recipe for merge conflicts; I've ran into 3 in the past two weeks. I think this is because git thinks it can merge two of these files from different branches together but they get merged together in a way that isn't consistent with how they get autogenerated.
Potential solutions:
cc @gchanan @ezyang
The text was updated successfully, but these errors were encountered: