From f2fffb17643879c765a9b320121dd67c874220c2 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Wed, 2 Dec 2020 11:23:56 +0100 Subject: [PATCH] Avoid internal comparisons of ProxyObjects --- dask_cuda/object_spilling_host_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dask_cuda/object_spilling_host_file.py b/dask_cuda/object_spilling_host_file.py index 505b5722d..5f9eec5de 100644 --- a/dask_cuda/object_spilling_host_file.py +++ b/dask_cuda/object_spilling_host_file.py @@ -61,6 +61,7 @@ def unspilled_proxies(self): return ret def obj_mappings(self): + # TODO: simplify and optimize proxied_id_to_proxy = {} buffer_to_proxies = {} @@ -71,7 +72,7 @@ def obj_mappings(self): proxied_id_to_proxy[proxied_id] = p for buf in get_device_memory_objects(proxied): l = buffer_to_proxies.get(buf, []) - if p not in l: + if id(p) not in set(id(i) for i in l): l.append(p) buffer_to_proxies[buf] = l return proxied_id_to_proxy, buffer_to_proxies