Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable weights / neff separation of SDXL's UNET for neuron sdk 2.18 #554

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions optimum/exporters/neuron/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ def export_models(
output_path.parent.mkdir(parents=True, exist_ok=True)

try:

# TODO: Remove after the weights/neff separation compilation of sdxl is patched by a neuron sdk release: https://github.com/aws-neuron/aws-neuron-sdk/issues/859
if not inline_weights_to_neff and getattr(sub_neuron_config, "is_sdxl", False):
logger.warning(
"The compilation of SDXL's unet with the weights/neff separation is broken since the Neuron sdk 2.18 release. `inline_weights_to_neff` will be set to True and the caching will be disabled. If you still want to separate the neff and weights, please downgrade your Neuron setup to the 2.17.1 release."
)
inline_weights_to_neff = True

start_time = time.time()
neuron_inputs, neuron_outputs = export(
model=submodel,
Expand Down
1 change: 1 addition & 0 deletions tests/cache/test_neuronx_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def test_stable_diffusion_cache(cache_repos):

@is_inferentia_test
@requires_neuronx
@pytest.mark.skip("Disable the test due to https://github.com/aws-neuron/aws-neuron-sdk/issues/859")
def test_stable_diffusion_xl_cache(cache_repos):
cache_path, cache_repo_id = cache_repos
model_id = "echarlaix/tiny-random-stable-diffusion-xl"
Expand Down
Loading