Skip to content

Commit 34296a8

Browse files
ai-edge-botcopybara-github
authored andcommitted
Enable PaliGemma conversion tests
- PaliGemma conversion tests crashes because RemoveSDPACompositeZeroMaskPass replaces zero masks (used by ImageDecoder) with identity op which leads XNNPACK to access out-of-range area when it tries to get mask tensors - Disable high-level function until RemoveSDPACompositeZeroMaskPass is removed - Verified that it passes 100% now PiperOrigin-RevId: 716432635
1 parent 3695fdb commit 34296a8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ai_edge_torch/generative/examples/paligemma/image_encoder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ def get_image_encoder_config() -> cfg.ModelConfig:
135135
image_embedding=image_embedding_config,
136136
block_configs=block_config,
137137
final_norm_config=norm_config,
138-
enable_hlfb=True,
138+
# TODO: b/377051577 - Once RemoveSDPACompositeZeroMaskPass is removed,
139+
# enable_hlfb can be set to True. See b/383865404#comment3 for details.
140+
# enable_hlfb=True,
139141
)
140142
return config
141143

ai_edge_torch/generative/test/test_model_conversion_large.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def _test_paligemma_model(self, decoder_class, decoder_config, atol, rtol):
232232
ai_edge_torch.config.in_oss,
233233
reason="tests with custom ops are not supported in oss",
234234
)
235-
def disabled_test_paligemma1(self):
235+
def test_paligemma1(self):
236236
self._test_paligemma_model(
237237
decoder.Decoder, decoder.get_fake_decoder_config, atol=1e-3, rtol=1e-5
238238
)
@@ -241,7 +241,7 @@ def disabled_test_paligemma1(self):
241241
ai_edge_torch.config.in_oss,
242242
reason="tests with custom ops are not supported in oss",
243243
)
244-
def disabled_test_paligemma2(self):
244+
def test_paligemma2(self):
245245
self._test_paligemma_model(
246246
decoder2.Decoder2,
247247
decoder2.get_fake_decoder2_config,

0 commit comments

Comments
 (0)