File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,6 @@ def hijack(
309
309
Returns:
310
310
Any: outputs of model
311
311
"""
312
-
313
312
try :
314
313
for i_mutex , i_queue in zip (
315
314
self .inference_mutexes ,
@@ -334,32 +333,9 @@ def hijack(
334
333
outputs = []
335
334
for o_queue in self .outputs_queues :
336
335
output = o_queue .get ()
336
+ outputs .append (output )
337
337
# consumer part
338
338
339
- if isinstance (output , ModelOutput ) or _is_dataclass_instance (
340
- output
341
- ):
342
- _output = output
343
- elif isinstance (output , tuple ) or isinstance (output , list ):
344
- _output = []
345
- for o in output :
346
- if torch .is_tensor (o ):
347
- o = o .clone ().to ("cpu" )
348
- _output .append (o )
349
- elif isinstance (output , dict ):
350
- _output = {}
351
- for k , v in output .items ():
352
- if torch .is_tensor (v ):
353
- v = v .clone ().to ("cpu" )
354
- _output [k ] = v
355
- else :
356
- _output = output
357
- if torch .is_tensor (output ):
358
- _output = output .clone ().to ("cpu" )
359
-
360
- del output
361
- outputs .append (_output )
362
-
363
339
if func in self ._memory_logger :
364
340
final_output = dict (outputs )
365
341
else :
Original file line number Diff line number Diff line change 26
26
27
27
setup (
28
28
name = 'parallelformers' ,
29
- version = '1.2.2 ' ,
29
+ version = '1.2.3 ' ,
30
30
description =
31
31
'An Efficient Model Parallelization Toolkit for Deployment' ,
32
32
long_description = long_description ,
You can’t perform that action at this time.
0 commit comments