Skip to content

Commit c4c10ca

Browse files
authored
Skip the batch sampler runtime test on ROCm
Summary: The ROCm AOTI unittest job on main fails during pytest collection: the newly added batch sampler test imports the Python runtime at module scope, and the ROCm CI build only ships executor_runner, not the pybindings extension. One collection error aborts the whole backends/cuda/tests run, so every ROCm test stops running. Import the runtime inside the test and skip the class on ROCm, following the existing convention for tests that load through the Python runtime. Differential Revision: D126231386 Pull Request resolved: #24013
1 parent b1beef3 commit c4c10ca

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎backends/cuda/tests/test_batch_sampler.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from executorch.exir.passes import MemoryPlanningPass
2121
from executorch.exir.passes.propagate_device_pass import PropagateDeviceConfig
2222
from executorch.extension.llm.batching.sampler import BatchSampler
23-
from executorch.runtime import Runtime
2423

2524

2625
def export_sampler(directory: Path, vocab: int):
@@ -56,8 +55,14 @@ def export_sampler(directory: Path, vocab: int):
5655

5756

5857
@unittest.skipUnless(torch.cuda.is_available(), "CUDA required")
58+
@unittest.skipIf(
59+
torch.version.hip is not None,
60+
"loads through the Python runtime, which the ROCm build does not include",
61+
)
5962
class CudaBatchSamplerTest(unittest.TestCase):
6063
def test_dynamic_rows_with_masked_reduction_lanes(self):
64+
from executorch.runtime import Runtime
65+
6166
# A vocabulary spanning several reduction tiles exposes padding lanes.
6267
vocab = 202048
6368
with tempfile.TemporaryDirectory() as temporary:

0 commit comments

Comments
 (0)