-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Fix openvino thresholds for export #21911
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
Open
pctablet505
wants to merge
43
commits into
keras-team:master
Choose a base branch
from
pctablet505:fix-openvino-thresholds-clean
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3
−3
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
04cd682
Update nn.py
pctablet505 1a74465
Update nn.py
pctablet505 c11eb81
Update nn.py
pctablet505 c81e18c
Update nn.py
pctablet505 d938e20
Update nn.py
pctablet505 f60811e
Update nn.py
pctablet505 b3ae323
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 28eeb24
Update random_grayscale.py
pctablet505 de81e5b
Update keras/src/layers/preprocessing/image_preprocessing/random_gray…
pctablet505 66661ac
Update random_grayscale_test.py
pctablet505 c37f2b5
code reformat
pctablet505 498dece
Update random_grayscale_test.py
pctablet505 b0b5f63
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 653f5b1
changed compute_output_spec
pctablet505 e681e4c
Merge branch 'keras-team:master' into master
pctablet505 27ad80b
Update random_grayscale.py
pctablet505 50f6292
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 579cc11
Reapply "Fixed issue with dot_product_attention when using TPU. (#21…
pctablet505 7a0c547
Improve error handling in _can_use_flash_attention for better debugging
pctablet505 f7a2290
Revert "Improve error handling in _can_use_flash_attention for better…
pctablet505 8bae892
Fix JAX API compatibility and improve error handling in `_can_use_fla…
pctablet505 ee196cd
Updated `dot_product_attention`
pctablet505 40583c8
Update nn.py
pctablet505 7c918ba
Update nn.py
pctablet505 a927e7e
Merge branch 'keras-team:master' into master
pctablet505 f04eafa
Merge branch 'keras-team:master' into master
pctablet505 bbc29a7
Merge branch 'keras-team:master' into master
pctablet505 bac3416
Merge branch 'keras-team:master' into master
pctablet505 98877eb
Created using Colab
pctablet505 39c559b
Merge branch 'keras-team:master' into master
pctablet505 417e4b1
Delete Model_Pruning.ipynb
pctablet505 14bfd9b
Merge branch 'master' of https://github.com/pctablet505/keras
pctablet505 9d34d0a
Merge branch 'keras-team:master' into master
pctablet505 20d29a8
Merge branch 'keras-team:master' into master
pctablet505 e469244
Merge branch 'keras-team:master' into master
pctablet505 fd197d9
Merge branch 'keras-team:master' into master
pctablet505 a6746e1
Merge branch 'keras-team:master' into master
pctablet505 6a5597d
Merge branch 'keras-team:master' into master
pctablet505 315f7f6
Merge branch 'keras-team:master' into master
pctablet505 30e4cdd
Merge branch 'keras-team:master' into master
pctablet505 04cf978
Merge branch 'keras-team:master' into master
pctablet505 8c98c18
Loosen numerical thresholds in OpenVINO export tests
pctablet505 5687248
Merge branch 'keras-team:master' into fix-openvino-thresholds-clean
pctablet505 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ def test_standard_model_export(self, model_type): | |
|
|
||
| ov_output = compiled_model([ref_input])[compiled_model.output(0)] | ||
|
|
||
| self.assertAllClose(ref_output, ov_output) | ||
| self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3) | ||
|
|
||
| larger_input = np.concatenate([ref_input, ref_input], axis=0) | ||
| compiled_model([larger_input]) | ||
|
|
@@ -178,7 +178,7 @@ def call(self, inputs): | |
| ov_inputs = list(ref_input) | ||
|
|
||
| ov_output = compiled_model(ov_inputs)[compiled_model.output(0)] | ||
| self.assertAllClose(ref_output, ov_output) | ||
| self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| # Test with keras.saving_lib | ||
| temp_filepath = os.path.join( | ||
|
|
@@ -243,7 +243,7 @@ def build(self, y_shape, x_shape): | |
| ov_output = compiled_model([ref_input_x, ref_input_y])[ | ||
| compiled_model.output(0) | ||
| ] | ||
| self.assertAllClose(ref_output, ov_output) | ||
| self.assertAllClose(ref_output, ov_output, atol=1e-3, rtol=1e-3) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| larger_input_x = np.concatenate([ref_input_x, ref_input_x], axis=0) | ||
| larger_input_y = np.concatenate([ref_input_y, ref_input_y], axis=0) | ||
| compiled_model([larger_input_x, larger_input_y]) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve maintainability and avoid magic numbers, consider defining the tolerance values
1e-3as class-level constants. This makes it easier to understand their purpose and update them in one place if needed.For example, you could add these attributes to the
ExportOpenVINOTestclass:Then, you can use them in your assertions like this:
self.assertAllClose(ref_output, ov_output, atol=self.OV_ATOL, rtol=self.OV_RTOL)