Skip to content

Extend constant prop pass to work with int/float/etc scalars and fix input specs. #2950

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

Closed
wants to merge 1 commit into from

Conversation

hsharma35
Copy link
Contributor

Summary:

  1. Cleanup / Refactor constant prop pass.

  2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
    Nodes of type Op(constant_tensor, some_int, some_float, some_dtype, ...) can now be constant propagated.

  3. Fix order of input spec to match the expected spec in ExportGraphSignature class.
    parameters->buffers->constants->user_inputs.
    Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures whe.

Differential Revision: D55891278

Copy link

pytorch-bot bot commented Apr 9, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2950

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 9, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 10, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Reviewed By: dulinriley

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 10, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 11, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 11, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 11, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Reviewed By: dulinriley

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 11, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Reviewed By: dulinriley

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

hsharma35 added a commit to hsharma35/executorch that referenced this pull request Apr 11, 2024
…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Reviewed By: dulinriley

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

…input specs. (pytorch#2950)

Summary:

1. Cleanup / Refactor constant prop pass.

2. Enable constant propagation for ops with constant scalar arguments -- int/float/dtype/bool/str.
Nodes of type `Op(constant_tensor, some_int, some_float, some_dtype, ...)` can now be constant propagated.

3. Fix order of input spec to match the expected spec in `ExportGraphSignature` class. 
parameters->buffers->constants->user_inputs.
Before this diff, input_specs for the newly added constant tensors were appended to graph_signature, which would cause failures.

Reviewed By: dulinriley

Differential Revision: D55891278
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D55891278

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 5ef8427.

@mergennachin mergennachin mentioned this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants