Skip to content

Commit 310cd3e

Browse files
committed
Mark real multi-device tests with @pytest.mark.multi_device
test_distribution and test_layout_map_mesh_shapes were not marked, so the dedicated multi_device CI job (added in keras-team#2809, filtering on -m "multi_device and not kaggle_key_required and not extra_large") would never collect any real test from this model, staying green while doing nothing. test_layout_map_live_presets already carries the marker (plus kaggle_key_required + extra_large) and is left as-is, correctly excluded from this job by design. For test_layout_map_mesh_shapes, the marker is placed as the innermost decorator (directly above the function, below @parameterized.named_parameters(...)), not outermost: absl.testing.parameterized expands each parameter case into a new function via functools.wraps, which only copies attributes already present on the wrapped function's __dict__ at expansion time. Placing pytest.mark above named_parameters sets pytestmark on the intermediate _ParameterizedTestIter object, which is discarded once the metaclass expands per-case methods, silently losing the marker on every generated case. Verified empirically via --collect-only: outer placement collected 0 of 12 parameterized cases under -m multi_device; inner placement collects all 12.
1 parent 43a9bd8 commit 310cd3e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

keras_hub/src/models/qwen3_5_moe/qwen3_5_moe_backbone_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def test_auxiliary_loss(self):
230230
for loss in model.losses:
231231
self.assertGreater(loss, 0.0, "Auxiliary loss should be positive")
232232

233+
@pytest.mark.multi_device
233234
def test_distribution(self):
234235
# The default config keeps num_key_value_heads=2 (not divisible by
235236
# every host's device count) and includes both a linear_attention and
@@ -295,6 +296,7 @@ def test_distribution(self):
295296
for dims in (QWEN3_5_MOE_35B_A3B_DIMS, QWEN3_5_MOE_SMALL_DIMS)
296297
for shape in CAPPED_MESH_SHAPES
297298
)
299+
@pytest.mark.multi_device
298300
def test_layout_map_mesh_shapes(self, dims, mesh_shape):
299301
if keras.backend.backend() != "jax":
300302
self.skipTest("`ModelParallel` testing requires the Jax backend.")

0 commit comments

Comments
 (0)