Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Distributed helper for client fixture in conftest.py #1830

Merged
merged 2 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def assert_eq(a, b, *args, **kwargs):

import pytest
from asvdb import ASVDb, BenchmarkInfo, utils
from dask.distributed import Client, LocalCluster
from numba import cuda

import nvtabular
from merlin.core.utils import Distributed
from merlin.dag.node import iter_nodes

REPO_ROOT = Path(__file__).parent.parent
Expand Down Expand Up @@ -97,8 +97,9 @@ def assert_eq(a, b, *args, **kwargs):

@pytest.fixture(scope="module")
def client():
cluster = LocalCluster(n_workers=2)
client = Client(cluster)
distributed = Distributed(n_workers=2)
cluster = distributed.cluster
client = distributed.client
yield client
client.close()
cluster.close()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/framework_utils/test_tf_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@ def test_multihot_empty_rows():
)

y_hat = model(x).numpy()
np.testing.assert_allclose(y_hat, multi_hot_embedding_rows, rtol=1e-06)
np.testing.assert_allclose(y_hat, multi_hot_embedding_rows, rtol=1e-05)