Skip to content

Commit

Permalink
Use Distributed helper for client fixture in conftest.py (#1830)
Browse files Browse the repository at this point in the history
* Use Distributed helper for client fixture

* reduce rtol in test_multihot_empty_rows
  • Loading branch information
oliverholworthy committed Jun 5, 2023
1 parent bab6828 commit 5bc0103
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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)

0 comments on commit 5bc0103

Please sign in to comment.