-
Notifications
You must be signed in to change notification settings - Fork 518
Da custom layer #1429
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
Da custom layer #1429
Conversation
|
Looks very nice, but I do have a question about the user interface. The switches for the fallback are added to the |
|
**kwargs are passed through from convert_from_keras_model |
|
Yes, the point is more that they are not explained in the doc for that function. So the user has no pointers on how to configure this, except by reading the code. I guess the specific request would be to add this to the function doc string for |
Added allow_da_fallback and allow_v2_fallback args from PR fastmachinelearning#1429
* Fix Keras v3 model conversion in numerical profiling * Address review feedback: remove unnecessary else clause and add test to LONGLIST - Removed else clause in convert_from_config() as it's no longer needed - Added test_keras_v3_profiling to LONGLIST in generate_ci_yaml.py for proper CI environment * Fix line length issue in generate_ci_yaml.py Break KERAS3_LIST into multiple lines to comply with max line length of 125 characters * Einsum and EinsumDense for oneAPI * Add tests * Add tests * Remove hgq2 from testing-keras3 dependencies and test_hgq2_mha from KERAS3_LIST As requested by reviewers: - Removed hgq2>=0.0.1 from testing-keras3 optional dependencies - Removed test_hgq2_mha from KERAS3_LIST * [pre-commit.ci] pre-commit autoupdate (#1425) updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.13 → v0.14.14](astral-sh/ruff-pre-commit@v0.14.13...v0.14.14) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Add LHC trigger use case context to README (#1418) * Add LHC trigger use case context to README * Clarify hls4ml application domains in README --------- Co-authored-by: Siddardha Desu <siddardhadesu@Siddardhas-MacBook-Air.local> * [pre-commit.ci] pre-commit autoupdate (#1430) updates: - [github.com/tox-dev/pyproject-fmt: v2.11.1 → v2.12.1](tox-dev/pyproject-fmt@v2.11.1...v2.12.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix Keras v3 profiling tests: build models and correct bar count expectations - Call model.build() or pass sample data to initialize Keras v3 models - Fix bar count assertions to match actual behavior (1 bar per layer, not per weight) - Ensures models have defined inputs before profiling * Fix qkeras import to avoid namespace conflict with hgq2 - Change 'import qkeras' to 'from qkeras import QActivation' in profiling.py - This protects against hgq2's qkeras compatibility layer causing conflicts - Add back hgq2>=0.0.1 to testing-keras3 dependencies - Add back test_hgq2_mha to KERAS3_LIST As requested by reviewers to resolve qkeras/hgq2 namespace issues. * Fix activation and batch norm tests - Call model with data instead of just build() for activation test - Fix batch norm expected bar count to 3 * Add new arguments to convert_from_keras_model call Added allow_da_fallback and allow_v2_fallback args from PR #1429 * Fix Keras v3 profiling tests - 4/5 passing One test (hls_model comparison) is skipped because get_unoptimized_hlsmodel() tries to recreate the model from saved config, which fails for Keras v3 due to config format changes. This is a library issue in keras_v2_to_hls parser that needs a separate fix. --------- Co-authored-by: Jovan Mitrevski <jmitrevs@fnal.gov> Co-authored-by: laurilaatu <l.laatu@imperial.ac.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: siddardhadesu <153359094+siddardhadesu@users.noreply.github.com> Co-authored-by: Siddardha Desu <siddardhadesu@Siddardhas-MacBook-Air.local>
Description
Allows the use of any subclass of
keras.layers.Layerobject that is supported in da4ml to be used in the hls4ml project, such as LUT-based layers (such ashgq.layers.DenseT/ConvT12Dorkeras.layers.Conv3D). Due to parser limitation,keras.operation.Operationstill cannot be supported (yet), so arbitrary tensor slicing or indexing operations will not work for now.Now, the keras v3 parser will try da parser fallback before trying v2 parser. If it falls by not finding the corresponding layer or da4ml is not present, it will proceed with the current behavior.
Type of change
Tests
Still no keras v3 test infra there.
Checklist