-
Notifications
You must be signed in to change notification settings - Fork 312
Open
Labels
type:BugSomething isn't workingSomething isn't working
Description
Description
The test_litert_export test for StableDiffusion3TextToImage is currently failing due to an unresolved custom operation in the LiteRT model.
Steps to Reproduce
- Run the test:
pytest keras_hub/src/models/stable_diffusion_3/stable_diffusion_3_text_to_image_test.py::StableDiffusion3TextToImageTest::test_litert_export --run_large - The test attempts to export the model to LiteRT format and run inference
- The test fails when invoking the LiteRT interpreter due to the unsupported Erfc operation
Expected Behavior
The test should pass, successfully exporting the StableDiffusion3TextToImage model to LiteRT and running inference without errors.
Actual Behavior
The test fails with the following error:
RuntimeError: Encountered unresolved custom op: Erfc.
See instructions: https://www.tensorflow.org/lite/guide/ops_custom Node number 181 (Erfc) failed to prepare.
This indicates that the Erfc (complementary error function) operation is not natively supported in TensorFlow Lite and requires custom op implementation.
Environment
- Python 3.12.10
- TensorFlow/Keras (version from pyproject.toml: keras>=3.13)
- pytest-9.0.0
- macOS
Additional Context
- The test is configured with
allow_custom_ops=Trueto permit custom operations like GatherV2 and Erfc - However, the Erfc operation still fails to prepare in the LiteRT runtime
- The model uses float16 precision in parts, which may contribute to the operation compatibility issues
- This is blocking LiteRT export functionality for StableDiffusion3TextToImage models
- The test is currently marked as skipped with
@pytest.mark.skip(reason="TODO: Bug with StableDiffusion3TextToImage export")
Possible Fix
The issue likely requires implementing a custom Erfc operation for TensorFlow Lite or modifying the model export process to avoid using Erfc. The complementary error function may need to be approximated or replaced with supported operations for LiteRT compatibility.
Metadata
Metadata
Assignees
Labels
type:BugSomething isn't workingSomething isn't working