8000 raise error when AMM is enabled and broadcast=True is used in scatter · dask/distributed@88c8565 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 88c8565

Browse files
committed
raise error when AMM is enabled and broadcast=True is used in scatter
1 parent 7013e2e commit 88c8565

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

distributed/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,17 @@ def scatter(
27792779
"Consider using a normal for loop and Client.submit"
27802780
)
27812781

2782+
if broadcast and dask.config.get(
2783+
"distributed.scheduler.active-memory-manager.start"
2784+
):
2785+
raise RuntimeError(
2786+
"Scattering data with broadcast=True is incompatible "
2787+
"with the Active Memory Manager’s ReduceReplicas "
2788+
"policy. Please disable the AMM plugin by setting "
2789+
"the following config to False: "
2790+
"'distributed.scheduler.active-memory-manager.start'"
2791+
)
2792+
27822793
try:
27832794
8000 local_worker = get_worker()
27842795
except ValueError:

distributed/tests/test_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,12 @@ async def test__broadcast(c, s, a, b):
23532353
assert a.data == b.data == {x.key: 1, y.key: 2}
23542354

23552355

2356+
@gen_cluster(client=True)
2357+
async def test__broadcast_raises(c, s, a, b):
2358+
with pytest.raises(RuntimeError):
2359+
await c.scatter([1, 2], broadcast=True)
2360+
2361+
23562362
@gen_cluster(client=True, nthreads=[("127.0.0.1", 1)] * 4, config=NO_AMM)
23572363
async def test__broadcast_integer(c, s, *workers):
23582364
x, y = await c.scatter([1, 2], broadcast=2)

0 commit comments

Comments
 (0)
0