VBoussot commited on
Commit
cc45df7
·
1 Parent(s): 9b3f426

fix(convexadam): disable JIT profiling executor for TorchScript feature models

Browse files

The TS segmentation TorchScript exports crash itk-impact's libtorch in the TensorExpr fuser ('INTERNAL ASSERT FAILED ... aten::dim'); MIND (simpler graph) was fine. Disable the JIT profiling/fusion executor at module import so every registry model runs on the stable legacy path (itk-impact shares Python's libtorch).

ConvexAdam_Coarse/Model.py CHANGED
@@ -49,6 +49,13 @@ from konfai.network import network
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
 
 
 
 
 
 
 
52
  DIM = 3
53
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
54
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
 
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
52
+ # Some TorchScript feature models (notably the TS segmentation exports) trip the JIT TensorExpr fuser's alias
53
+ # analysis ("INTERNAL ASSERT FAILED ... We don't have an op for aten::dim") when itk-impact runs them through
54
+ # libtorch. Fall back to the stable legacy executor (no profiling / no fusion) so every registry model runs;
55
+ # itk-impact shares Python's libtorch, so setting the global flag here also applies to its C++ execution.
56
+ torch._C._jit_set_profiling_executor(False)
57
+ torch._C._jit_set_profiling_mode(False)
58
+
59
  DIM = 3
60
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
61
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
ConvexAdam_Coarse/__pycache__/Model.cpython-313.pyc CHANGED
Binary files a/ConvexAdam_Coarse/__pycache__/Model.cpython-313.pyc and b/ConvexAdam_Coarse/__pycache__/Model.cpython-313.pyc differ
 
ConvexAdam_Composite/Model.py CHANGED
@@ -49,6 +49,13 @@ from konfai.network import network
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
 
 
 
 
 
 
 
52
  DIM = 3
53
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
54
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
 
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
52
+ # Some TorchScript feature models (notably the TS segmentation exports) trip the JIT TensorExpr fuser's alias
53
+ # analysis ("INTERNAL ASSERT FAILED ... We don't have an op for aten::dim") when itk-impact runs them through
54
+ # libtorch. Fall back to the stable legacy executor (no profiling / no fusion) so every registry model runs;
55
+ # itk-impact shares Python's libtorch, so setting the global flag here also applies to its C++ execution.
56
+ torch._C._jit_set_profiling_executor(False)
57
+ torch._C._jit_set_profiling_mode(False)
58
+
59
  DIM = 3
60
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
61
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
ConvexAdam_Composite/__pycache__/Model.cpython-313.pyc CHANGED
Binary files a/ConvexAdam_Composite/__pycache__/Model.cpython-313.pyc and b/ConvexAdam_Composite/__pycache__/Model.cpython-313.pyc differ
 
ConvexAdam_Fine/Model.py CHANGED
@@ -49,6 +49,13 @@ from konfai.network import network
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
 
 
 
 
 
 
 
52
  DIM = 3
53
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
54
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
 
49
  from konfai.utils.config import Choices, Range
50
  from konfai.utils.dataset import Attribute, data_to_image, image_to_data
51
 
52
+ # Some TorchScript feature models (notably the TS segmentation exports) trip the JIT TensorExpr fuser's alias
53
+ # analysis ("INTERNAL ASSERT FAILED ... We don't have an op for aten::dim") when itk-impact runs them through
54
+ # libtorch. Fall back to the stable legacy executor (no profiling / no fusion) so every registry model runs;
55
+ # itk-impact shares Python's libtorch, so setting the global flag here also applies to its C++ execution.
56
+ torch._C._jit_set_profiling_executor(False)
57
+ torch._C._jit_set_profiling_mode(False)
58
+
59
  DIM = 3
60
  # The feature model's input channel count is an intrinsic property of the pretrained model (grayscale
61
  # medical images), not a tunable — so it's fixed here, never a config/signature parameter.
ConvexAdam_Fine/__pycache__/Model.cpython-313.pyc CHANGED
Binary files a/ConvexAdam_Fine/__pycache__/Model.cpython-313.pyc and b/ConvexAdam_Fine/__pycache__/Model.cpython-313.pyc differ