Skip to content

Commit aba9064

Browse files
committed
Mark Llama distribution tests with multi_device
test_distribution, test_distribution_with_lora, and test_layout_map_mesh_shapes were not marked, so the dedicated multi_device CI job (added in keras-team#2809) was collecting zero real tests for this model -- only test_layout_map_live_presets carried the marker, and that test is deliberately excluded by the job's own kaggle_key_required/extra_large filter. For test_layout_map_mesh_shapes, which uses absl's parameterized.named_parameters, the marker must be applied as the innermost decorator (closest to the function) rather than outermost: named_parameters generates fresh method objects per expansion that don't inherit the pytestmark attribute pytest.mark sets on the original function, so an outer marker never reaches the expanded test cases. Verified empirically that only the inner-decorator ordering makes the parameterized cases collectible under -m multi_device.
1 parent 9399083 commit aba9064

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

keras_hub/src/models/llama/llama_backbone_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def test_all_presets(self):
174174
input_data=self.input_data,
175175
)
176176

177+
@pytest.mark.multi_device
177178
def test_distribution(self):
178179
# Note (preserved from the pre-refactor manual test): mesh is
179180
# pinned to exactly 2 devices (not len(devices), see the shared
@@ -203,6 +204,7 @@ def test_distribution(self):
203204
allow_replicated=(),
204205
)
205206

207+
@pytest.mark.multi_device
206208
def test_distribution_with_lora(self):
207209
if keras.backend.backend() != "jax":
208210
self.skipTest("`ModelParallel` testing requires the Jax backend.")
@@ -248,6 +250,7 @@ def test_distribution_with_lora(self):
248250
for dims in (LLAMA2_7B_DIMS, LLAMA2_70B_DIMS)
249251
for shape in CAPPED_MESH_SHAPES
250252
)
253+
@pytest.mark.multi_device
251254
def test_layout_map_mesh_shapes(self, dims, mesh_shape):
252255
if keras.backend.backend() != "jax":
253256
self.skipTest("`ModelParallel` testing requires the Jax backend.")

0 commit comments

Comments
 (0)