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
renzhc
diffusers_dcu
Commits
aa79d7da
Unverified
Commit
aa79d7da
authored
Jan 14, 2025
by
Aryan
Committed by
GitHub
Jan 14, 2025
Browse files
Test sequential cpu offload for torchao quantization (#10506)
test sequential cpu offload
parent
74b67524
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
tests/quantization/torchao/test_torchao.py
tests/quantization/torchao/test_torchao.py
+12
-0
No files found.
tests/quantization/torchao/test_torchao.py
View file @
aa79d7da
...
...
@@ -476,6 +476,18 @@ class TorchAoTest(unittest.TestCase):
with
self
.
assertRaises
(
ValueError
):
self
.
get_dummy_components
(
TorchAoConfig
(
"int42"
))
def
test_sequential_cpu_offload
(
self
):
r
"""
A test that checks if inference runs as expected when sequential cpu offloading is enabled.
"""
quantization_config
=
TorchAoConfig
(
"int8wo"
)
components
=
self
.
get_dummy_components
(
quantization_config
)
pipe
=
FluxPipeline
(
**
components
)
pipe
.
enable_sequential_cpu_offload
()
inputs
=
self
.
get_dummy_inputs
(
torch_device
)
_
=
pipe
(
**
inputs
)
# Slices for these tests have been obtained on our aws-g6e-xlarge-plus runners
@
require_torch
...
...
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