Skip to content

Commit 2f574f2

Browse files
committed
Mark real multi-device distribution tests in t5gemma2 backbone test
test_distribution, test_distribution_vision, and test_layout_map_mesh_shapes build an actual ModelParallel/DeviceMesh and need multiple simulated devices, but were missing @pytest.mark.multi_device. Without it, the dedicated multi_device CI job (added by keras-team#2809) collects zero tests from this file -- only test_layout_map_live_presets carried the marker, and that test is deliberately excluded by the job's own "not kaggle_key_required and not extra_large" filter. For test_layout_map_mesh_shapes, the marker is placed as the innermost decorator (below @parameterized.named_parameters), not outermost: absl.testing.parameterized generates fresh function objects per expanded case and only copies pytestmark onto them when it wraps an already-marked function, not when the mark wraps the parameterized descriptor itself. Verified empirically that outermost placement causes pytest to collect 0 of the 18 expanded cases, while innermost placement collects all 18.
1 parent a712df4 commit 2f574f2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

keras_hub/src/models/t5gemma2/t5gemma2_backbone_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def test_all_presets(self):
231231
input_data=self.input_data,
232232
)
233233

234+
@pytest.mark.multi_device
234235
def test_distribution(self):
235236
# Encoder self_attention and decoder merged_attention share the
236237
# query/key/value/attention_output naming, so the attention patterns
@@ -279,6 +280,7 @@ def test_distribution(self):
279280
parity_rtol=1e-4,
280281
)
281282

283+
@pytest.mark.multi_device
282284
def test_distribution_vision(self):
283285
# Multimodal variant: build a tiny Gemma3VisionEncoder INSIDE the
284286
# distribution scope via a callable init_kwargs (required -- a vision
@@ -379,6 +381,7 @@ def vision_init_kwargs():
379381
)
380382
for shape in CAPPED_MESH_SHAPES
381383
)
384+
@pytest.mark.multi_device
382385
def test_layout_map_mesh_shapes(self, dims, mesh_shape):
383386
if keras.backend.backend() != "jax":
384387
self.skipTest("`ModelParallel` testing requires the Jax backend.")

0 commit comments

Comments
 (0)