Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
5fd4e3c8
Unverified
Commit
5fd4e3c8
authored
Mar 22, 2023
by
Sylvain Gugger
Committed by
GitHub
Mar 22, 2023
Browse files
Enforce `max_memory` for device_map strategies (#22311)
Enforce for device_map strategies
parent
48bef3a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+1
-0
No files found.
src/transformers/modeling_utils.py
View file @
5fd4e3c8
...
...
@@ -2571,6 +2571,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
model
,
dtype
=
torch_dtype
,
low_zero
=
(
device_map
==
"balanced_low_0"
),
max_memory
=
max_memory
,
**
kwargs
,
)
kwargs
[
"max_memory"
]
=
max_memory
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment