@@ -1394,7 +1394,8 @@ function do_task(to_proc, task_desc)
1394
1394
# TODO : Choose "closest" processor of same type first
1395
1395
some_proc = first (keys (CHUNK_CACHE[x]))
1396
1396
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)
1398
1399
end )
1399
1400
else
1400
1401
nothing
@@ -1406,13 +1407,16 @@ function do_task(to_proc, task_desc)
1406
1407
else
1407
1408
# Fetch it
1408
1409
time_start = time_ns ()
1409
- _x = move (to_proc, x)
1410
+ from_proc = processor (x)
1411
+ _x = @invokelatest move (from_proc, to_proc, x)
1410
1412
time_finish = time_ns ()
1411
1413
if x. handle. size != = nothing
1412
1414
Threads. atomic_add! (transfer_time, time_finish - time_start)
1413
1415
Threads. atomic_add! (transfer_size, x. handle. size)
1414
1416
end
1415
1417
1418
+ @dagdebug thunk_id :move " Cache miss for argument $id at $from_proc "
1419
+
1416
1420
# Update cache
1417
1421
lock (TASK_SYNC) do
1418
1422
CHUNK_CACHE[x] = Dict {Processor,Any} ()
@@ -1422,8 +1426,9 @@ function do_task(to_proc, task_desc)
1422
1426
_x
1423
1427
end
1424
1428
else
1425
- move (to_proc, x)
1429
+ @invokelatest move (to_proc, x)
1426
1430
end
1431
+ @dagdebug thunk_id :move " Moved argument $id to $to_proc : $x "
1427
1432
timespan_finish (ctx, :move , (;thunk_id, id), (;f, id, data= x); tasks= [Base. current_task ()])
1428
1433
return x
1429
1434
end
0 commit comments