Zhen Ye Claude Opus 4.6 commited on
Commit
10eb3c6
·
1 Parent(s): 4c36e1e

fix: drop fullgraph=True from torch.compile for broader compatibility

Browse files

fullgraph=True requires no graph breaks, which fails without
SAM2VideoPredictorVOS's .clone() patches. Removing it allows
torch.compile to handle graph breaks gracefully via partial
compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. models/segmenters/grounded_sam2.py +5 -5
models/segmenters/grounded_sam2.py CHANGED
@@ -395,11 +395,11 @@ class GroundedSAM2Segmenter(Segmenter):
395
  """
396
  vp = self._video_predictor
397
  components = [
398
- ("image_encoder", dict(mode="max-autotune", fullgraph=True, dynamic=False)),
399
- ("memory_encoder", dict(mode="max-autotune", fullgraph=True, dynamic=False)),
400
- ("memory_attention", dict(mode="max-autotune", fullgraph=True, dynamic=True)),
401
- ("sam_prompt_encoder", dict(mode="max-autotune", fullgraph=True, dynamic=False)),
402
- ("sam_mask_decoder", dict(mode="max-autotune", fullgraph=True, dynamic=False)),
403
  ]
404
  self._original_forwards: Dict[str, Any] = {}
405
  compiled = []
 
395
  """
396
  vp = self._video_predictor
397
  components = [
398
+ ("image_encoder", dict(mode="max-autotune", dynamic=False)),
399
+ ("memory_encoder", dict(mode="max-autotune", dynamic=False)),
400
+ ("memory_attention", dict(mode="max-autotune", dynamic=True)),
401
+ ("sam_prompt_encoder", dict(mode="max-autotune", dynamic=False)),
402
+ ("sam_mask_decoder", dict(mode="max-autotune", dynamic=False)),
403
  ]
404
  self._original_forwards: Dict[str, Any] = {}
405
  compiled = []