-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix torch compile, script, export (#1031)
* Move tests * Add compile test for encoders (to be optimized) * densnet * dpn * efficientnet * inceptionresnetv2 * inceptionv4 * mix-transformer * mobilenet * mobileone * resnet * senet * vgg * xception * Deprecate `timm-` encoders, remap to `tu-` most of them * Add tiny encoders and compile mark * Add conftest * Fix features * Add triggering compile tests on diff * Remove marks * Add test_compile stage to CI * Update requirements * Update makefile * Update get_stages * Fix weight loading for deprecate encoders * Fix weight loading for mobilenetv3 * Format * Add compile test for models * Add torch.export test * Disable export tests for dpn and inceptionv4 * Disable export for timm-eff-net * Huge fix for torch scripting (except Unet++ and UperNet) * Fix scripting * Add test for torch script * Add torch_script test to CI * Fix * Fix timm-effnet encoders * Make from_pretrained strict by default * Fix DeepLabV3 BC * Fix scripting for encoders * Refactor test do not skip * Fix encoders (mobilenet, inceptionv4) * Update encoders table * Fix export test * Fix docs * Update warning * Move pretrained settings * Add BC for timm- encoders * Fixing table * Update compile test * Change compile backend to eager * Update docs * Fixup * Fix batchnorm typo * Add depth validation * Update segmentation_models_pytorch/encoders/__init__.py Co-authored-by: Adam J. Stewart <[email protected]> * Style --------- Co-authored-by: Adam J. Stewart <[email protected]>
- Loading branch information
1 parent
93b19d3
commit 456871a
Showing
63 changed files
with
2,418 additions
and
2,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
gitpython==3.1.44 | ||
packaging==24.2 | ||
pytest==8.3.4 | ||
pytest-xdist==3.6.1 | ||
pytest-cov==6.0.0 | ||
ruff==0.9.1 | ||
setuptools==75.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import torch | ||
|
||
|
||
@torch.jit.unused | ||
def is_torch_compiling(): | ||
try: | ||
return torch.compiler.is_compiling() | ||
except Exception: | ||
try: | ||
import torch._dynamo as dynamo # noqa: F401 | ||
|
||
return dynamo.is_compiling() | ||
except Exception: | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.