@@ -1394,7 +1394,8 @@ function do_task(to_proc, task_desc)
13941394 # TODO : Choose "closest" processor of same type first
13951395 some_proc = first (keys (CHUNK_CACHE[x]))
13961396 some_x = CHUNK_CACHE[x][some_proc]
1397- move (some_proc, to_proc, some_x)
1397+ @dagdebug thunk_id :move " Cache hit for argument $id at $some_proc : $some_x "
1398+ @invokelatest move (some_proc, to_proc, some_x)
13981399 end )
13991400 else
14001401 nothing
@@ -1406,13 +1407,16 @@ function do_task(to_proc, task_desc)
14061407 else
14071408 # Fetch it
14081409 time_start = time_ns ()
1409- _x = move (to_proc, x)
1410+ from_proc = processor (x)
1411+ _x = @invokelatest move (from_proc, to_proc, x)
14101412 time_finish = time_ns ()
14111413 if x. handle. size != = nothing
14121414 Threads. atomic_add! (transfer_time, time_finish - time_start)
14131415 Threads. atomic_add! (transfer_size, x. handle. size)
14141416 end
14151417
1418+ @dagdebug thunk_id :move " Cache miss for argument $id at $from_proc "
1419+
14161420 # Update cache
14171421 lock (TASK_SYNC) do
14181422 CHUNK_CACHE[x] = Dict {Processor,Any} ()
@@ -1422,8 +1426,9 @@ function do_task(to_proc, task_desc)
14221426 _x
14231427 end
14241428 else
1425- move (to_proc, x)
1429+ @invokelatest move (to_proc, x)
14261430 end
1431+ @dagdebug thunk_id :move " Moved argument $id to $to_proc : $x "
14271432 timespan_finish (ctx, :move , (;thunk_id, id), (;f, id, data= x); tasks= [Base. current_task ()])
14281433 return x
14291434 end
0 commit comments