Skip to content

Commit

Permalink
Disable weights / neff separation of SDXL's UNET for neuron sdk 2.18 (#…
Browse files Browse the repository at this point in the history
…554)

* temp patch

* disable sdxl caching test

* pytest skip
  • Loading branch information
JingyaHuang authored Apr 5, 2024
1 parent 326d79b commit e3bc576
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit e3bc576

Please sign in to comment.