Skip to content
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

Enable torch tracing by changing assertions in d2go forwards to allow for torch.fx.proxy.Proxy type. #241

Closed

Conversation

simonhollis
Copy link

Summary:
Torch FX tracing propagates a type of torch.fx.proxy.Proxy through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function is_fx_proxy(), for checking for torch.fx.proxy.Proxy instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

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

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

wat3rBro pushed a commit to wat3rBro/detectron2-1 that referenced this pull request May 11, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/d2go#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

fbshipit-source-id: 96f4389e5c6c6efd4790ce9c3f179e0544f3ff05
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request May 24, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

fbshipit-source-id: 09e516e3c098000dea63ddaf3907648bcae5a1b1
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Jul 19, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

fbshipit-source-id: ed234bf6e6b1c306ef9670ffbcb5ae00376e2d03
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Jul 20, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

fbshipit-source-id: 7feb77561f140825a66d46de93d5ae67b02288cb
@facebook-github-bot
Copy link
Contributor

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

wat3rBro pushed a commit to wat3rBro/detectron2-1 that referenced this pull request Jul 25, 2022
… for torch.fx.proxy.Proxy type.

Summary:
Pull Request resolved: facebookresearch#4227

X-link: facebookresearch/d2go#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Differential Revision: D35518556

fbshipit-source-id: 7f1cc384a30d6f79772e68c28133e5420f966f06
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Jul 26, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This diff adds a helper function `is_fx_proxy()`, for checking for `torch.fx.proxy.Proxy` instances, then uses this to guard the existing assertions, thus enabling the tracing, as well as maintaining the originally intended functionality.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: 539c8c0ccb39c3e2ba953ccda72103d847ad0667
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 2, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: b5d65165f271722af24e3dd9d33b3e37e4cf0e34
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 2, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: 524a3dbcb42736789580459bed2c9323b91a5615
@facebook-github-bot
Copy link
Contributor

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

wat3rBro pushed a commit to wat3rBro/detectron2-1 that referenced this pull request Aug 2, 2022
… for torch.fx.proxy.Proxy type.

Summary:
Pull Request resolved: facebookresearch#4227

X-link: facebookresearch/d2go#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: 82e6f1af479828176baba19bfa19a3272aca25af
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 15, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Differential Revision: D35518556

fbshipit-source-id: 8f5181fccf6cdd29ff2fea0d26385a65a08df76e
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 16, 2022
… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: c866f49a2be8d04bb6ed646ab07004cbdb582938
@facebook-github-bot
Copy link
Contributor

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

… for torch.fx.proxy.Proxy type.

Summary:
X-link: facebookresearch/detectron2#4227

Pull Request resolved: facebookresearch#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: e8dbeb2538c2ce9042e5f1c481b30f48b3c8988f
@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit to facebookresearch/detectron2 that referenced this pull request Aug 18, 2022
… for torch.fx.proxy.Proxy type.

Summary:
Pull Request resolved: #4227

X-link: facebookresearch/d2go#241

Torch FX tracing propagates a type of `torch.fx.proxy.Proxy` through the graph.

Existing type assertions in the d2go code base trigger during torch FX tracing, causing tracing to fail.

This adds a check for FX tracing in progress and  adds a helper function `assert_fx_safe()`, that can be used in place of a standard assertion. This function only applies the assertion if one is not tracing, allowing d2go assertion tests to be compatible with FX tracing.

Reviewed By: wat3rBro

Differential Revision: D35518556

fbshipit-source-id: a9b5d3d580518ca74948544973ae89f8b9de3282
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants