Skip to content

Move deprecation warning out of generated code into python_arg_parser.#32907

Closed
bhosmer wants to merge 2 commits intogh/bhosmer/7/basefrom
gh/bhosmer/7/head
Closed

Move deprecation warning out of generated code into python_arg_parser.#32907
bhosmer wants to merge 2 commits intogh/bhosmer/7/basefrom
gh/bhosmer/7/head

Conversation

@bhosmer
Copy link

@bhosmer bhosmer commented Feb 1, 2020

Stack from ghstack:

All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed.

No change in the warning behavior itself, mod minor formatting tweak -
passes existing tests. Saves like ~275K binary size on mac:

-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib

codegen diff

More important than the size savings is the minimization of codegen. Ideally the generated artifact should express distinctive per-op properties in as minimal a form as practically possible - e.g. here instead of generating check-and-warn behavior into every binding, we generate only the data that triggers the behavior in the parser. (And actually we were generating it already.)

Differential Revision: D19679928

All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed. Saves like ~275K binary size on mac:
```
-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib
```

[ghstack-poisoned]
@bhosmer bhosmer requested a review from gchanan February 1, 2020 09:11
…_arg_parser."


All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed. 

No change in the warning behavior itself, mod minor formatting tweak - 
passes existing tests. Saves like ~275K binary size on mac:
```
-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib
```

[codegen diff](bhosmer/scratch@deprecation_warning_before...deprecation_warning_after)

More important than the size savings is the minimization of codegen. Ideally the generated artifact should express distinctive per-op properties in as minimal a form as practically possible - e.g. here instead of generating check-and-warn behavior into every binding, we generate only the data that triggers the behavior in the parser. (And actually we were generating it already.)

Differential Revision: [D19679928](https://our.internmc.facebook.com/intern/diff/D19679928)

[ghstack-poisoned]
bhosmer pushed a commit that referenced this pull request Feb 1, 2020
All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed. Saves like ~275K binary size on mac:
```
-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib
```

ghstack-source-id: 82e7ad6
Pull Request resolved: #32907
@gchanan
Copy link
Contributor

gchanan commented Feb 3, 2020

I don't know if the clang-tidy errors are real.

@facebook-github-bot
Copy link
Contributor

@bhosmer merged this pull request in 544eab3.

@facebook-github-bot
Copy link
Contributor

@bhosmer merged this pull request in 544eab3.

@facebook-github-bot facebook-github-bot deleted the gh/bhosmer/7/head branch February 7, 2020 15:18
BowenBao pushed a commit to BowenBao/pytorch that referenced this pull request Feb 12, 2020
pytorch#32907)

Summary:
Pull Request resolved: pytorch#32907

All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed.

No change in the warning behavior itself, mod minor formatting tweak -
passes existing tests. Saves like ~275K binary size on mac:
```
-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib
```

[codegen diff](bhosmer/scratch@deprecation_warning_before...deprecation_warning_after)

More important than the size savings is the minimization of codegen. Ideally the generated artifact should express distinctive per-op properties in as minimal a form as practically possible - e.g. here instead of generating check-and-warn behavior into every binding, we generate only the data that triggers the behavior in the parser. (And actually we were generating it already.)

Test Plan: Imported from OSS

Differential Revision: D19679928

Pulled By: bhosmer

fbshipit-source-id: cf0140573118430720c6b797c762fe5be98acd86
ttumiel pushed a commit to ttumiel/pytorch that referenced this pull request Mar 4, 2020
pytorch#32907)

Summary:
Pull Request resolved: pytorch#32907

All op-specific information used in this logic was available to the
parser itself, so the check can be done in that context, no codegen
needed.

No change in the warning behavior itself, mod minor formatting tweak -
passes existing tests. Saves like ~275K binary size on mac:
```
-rwxr-xr-x  1 bhosmer  1876110778   16502064 Feb  1 00:43 torch/lib/libtorch_python.dylib
-rwxr-xr-x  1 bhosmer  1876110778   16247888 Feb  1 00:44 torch/lib/libtorch_python.dylib
```

[codegen diff](bhosmer/scratch@deprecation_warning_before...deprecation_warning_after)

More important than the size savings is the minimization of codegen. Ideally the generated artifact should express distinctive per-op properties in as minimal a form as practically possible - e.g. here instead of generating check-and-warn behavior into every binding, we generate only the data that triggers the behavior in the parser. (And actually we were generating it already.)

Test Plan: Imported from OSS

Differential Revision: D19679928

Pulled By: bhosmer

fbshipit-source-id: cf0140573118430720c6b797c762fe5be98acd86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants