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

Fix import exceptions in tracing.py for older (<1.12) versions of pytorch #362

Closed

Conversation

simonhollis
Copy link

Summary:
X-link: facebookresearch/detectron2#4491

Recently landed D35518556 (1ffc801) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch/detectron2@36a65a0

This change uses try/except to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

@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 Aug 19, 2022
@facebook-github-bot
Copy link
Contributor

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

simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 19, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 7c16f5cea14f7f19184f8c14f2503ab330e73b14
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 30c3668c13bab461bedb583269f15197cf6d3410
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 9fc0f346d0ae0b89403cdeac71118133ccb84886
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: f38f1b574ff676debc72ef116691a5ce96e593c2
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: fe3e792f8ce7937d864b5da31bd0c02652d64138
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: a6d1b2e7484a44e0bf611eee293aef351dd0db45
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 9327ef4607ab3ab069c8c2be5a59855c9747db9c
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: abded64ad6d5cdb7c23afb4f446145fd425ccb31
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 17965831c87514d0dd9a6e31529a3312bfe09624
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 6a85f8044b06e2652ecc7ff6e7b358dd4ecccccb
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 0685bf76695c0229d3c82b5c25debe3fb4077347
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 20, 2022
…orch

Summary:
Pull Request resolved: facebookresearch#362

X-link: facebookresearch/detectron2#4491

Recently landed D35518556 (facebookresearch@1ffc801) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch/detectron2@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

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

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

simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 20, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 671c0766ad179404c42768c0bf85f2ac472f951a
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 21, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: bf812af36c3482e132f2c494cce284c73d78828b
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 21, 2022
…orch

Summary:
Pull Request resolved: facebookresearch#362

X-link: facebookresearch/detectron2#4491

Recently landed D35518556 (facebookresearch@1ffc801) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch/detectron2@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

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

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

simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 21, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 36bdbdb1f10fda5828012bc41ffc39f63acf4b9d
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 21, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: 2e4aa45399300dc95b9b884d9d4af7015ba30177
simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 21, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

fbshipit-source-id: b0df4319ca6d9d63d7aa92f7987af9b5526d02d1
simonhollis pushed a commit to simonhollis/d2go that referenced this pull request Aug 21, 2022
…orch

Summary:
Pull Request resolved: facebookresearch#362

X-link: facebookresearch/detectron2#4491

Recently landed D35518556 (facebookresearch@1ffc801) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch/detectron2@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Differential Revision: D38879134

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

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

simonhollis referenced this pull request in facebookresearch/detectron2 Aug 21, 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
…orch

Summary:
Pull Request resolved: facebookresearch#362

X-link: facebookresearch/detectron2#4491

Recently landed D35518556 (facebookresearch@1ffc801) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch/detectron2@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Reviewed By: wat3rBro

Differential Revision: D38879134

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

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

simonhollis pushed a commit to simonhollis/detectron2 that referenced this pull request Aug 22, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: facebookresearch#4491

Recently landed D35518556 (facebookresearch@36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at facebookresearch@36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Reviewed By: wat3rBro

Differential Revision: D38879134

fbshipit-source-id: d7fe30d101ac3715ee5010bb61d2ad230b0c57d0
facebook-github-bot pushed a commit to facebookresearch/detectron2 that referenced this pull request Aug 23, 2022
…orch

Summary:
X-link: facebookresearch/d2go#362

Pull Request resolved: #4491

Recently landed D35518556 (36a65a0) / Github: 36a65a0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at 36a65a0

This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them.

Reviewed By: wat3rBro

Differential Revision: D38879134

fbshipit-source-id: 72f5a7a8d350eb82be87567f006368bf207f5a74
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