Mark NCCL python test optional. (#9804)

Skip the tests if XGBoost is not compiled with dlopen.
This commit is contained in:
Jiaming Yuan 2023-11-25 11:25:47 +08:00 committed by GitHub
parent 8fe1a2213c
commit 3f4e22015a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,6 +573,10 @@ def test_with_asyncio(local_cuda_client: Client) -> None:
assert isinstance(output["history"], dict) assert isinstance(output["history"], dict)
@pytest.mark.skipif(
condition=not xgb.build_info()["USE_DLOPEN_NCCL"],
reason="Not compiled with dlopen.",
)
def test_invalid_nccl(local_cuda_client: Client) -> None: def test_invalid_nccl(local_cuda_client: Client) -> None:
client = local_cuda_client client = local_cuda_client
workers = tm.get_client_workers(client) workers = tm.get_client_workers(client)
@ -592,6 +596,10 @@ def test_invalid_nccl(local_cuda_client: Client) -> None:
client.gather(futures) client.gather(futures)
@pytest.mark.skipif(
condition=not xgb.build_info()["USE_DLOPEN_NCCL"],
reason="Not compiled with dlopen.",
)
@pytest.mark.parametrize("tree_method", ["hist", "approx"]) @pytest.mark.parametrize("tree_method", ["hist", "approx"])
def test_nccl_load(local_cuda_client: Client, tree_method: str) -> None: def test_nccl_load(local_cuda_client: Client, tree_method: str) -> None:
X, y, w = tm.make_regression(128, 16, use_cupy=True) X, y, w = tm.make_regression(128, 16, use_cupy=True)