We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb1d7c7 commit 240767cCopy full SHA for 240767c
src/transformers/integrations/accelerate.py
@@ -409,10 +409,6 @@ def _get_device_map(
409
if max_memory is not None and device_name in max_memory:
410
inferred_max_memory[device_name] = min(inferred_max_memory[device_name], max_memory[device_name])
411
412
- # Here we need to retie the weights before the call even if they are all on meta device, otherwise accelerate
413
- # mess up the device_map computation
414
- # TODO Cyril: replace this function to avoid re-tying uselessly (and the function is very inefficient)
415
- model.tie_weights()
416
device_map = infer_auto_device_map(
417
model,
418
max_memory=inferred_max_memory,
0 commit comments