Skip to content

Commit 747b7b1

Browse files
committed
Mark test_distribution/test_layout_map_mesh_shapes as multi_device
test_layout_map_live_presets was the only test in this file carrying @pytest.mark.multi_device, but it's also marked kaggle_key_required and extra_large, so PR keras-team#2809's CI job (which filters on "multi_device and not kaggle_key_required and not extra_large") was excluding it too -- leaving zero real tests collected from this model. Mark the two actual multi-device tests instead: test_distribution, and test_layout_map_mesh_shapes (the Tier-2 CI-safe mesh-shape sweep). For test_layout_map_mesh_shapes, the marker must go directly above the def, below @parameterized.named_parameters, not above it: absl's TestGeneratorMetaclass only forwards attributes set via functools.wraps inside _ParameterizedTestIter.__iter__ on the original function; a mark applied outermost lands on the _ParameterizedTestIter object itself and is silently dropped when the class dict is rewritten, so none of the 12 expanded per-mesh-shape test cases would inherit it. Verified via collect-only with the same "-m" filter CI uses: 13/19 tests selected (test_distribution + 12 mesh-shape cases), with test_layout_map_live_presets and the non-distribution tests correctly excluded either way.
1 parent 53aa9d0 commit 747b7b1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

keras_hub/src/models/mixtral/mixtral_backbone_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def test_num_parameters(self):
193193
)
194194
self.assertEqual(model.count_params(), expected_params)
195195

196+
@pytest.mark.multi_device
196197
def test_distribution(self):
197198
# num_experts=4, top_k=2 (distribution-test-only override, not the
198199
# shared setUp): with the shared setUp's num_experts=2, top_k=2,
@@ -253,6 +254,7 @@ def test_distribution(self):
253254
for dims in (MIXTRAL_SMALL_DIMS, MIXTRAL_BASE_DIMS)
254255
for shape in CAPPED_MESH_SHAPES
255256
)
257+
@pytest.mark.multi_device
256258
def test_layout_map_mesh_shapes(self, dims, mesh_shape):
257259
if keras.backend.backend() != "jax":
258260
self.skipTest("`ModelParallel` testing requires the Jax backend.")

0 commit comments

Comments
 (0)