Skip to content

Conversation

@WIgor
Copy link
Contributor

@WIgor WIgor commented Jun 28, 2025

What do you think about logging of exceptions, instead of hiding them? + There is an example of such hidden exception when head_shards and q_seq_shards were just not initialized because get_dist()==None.

And despite hardware supports flash attention - this code silently falls back to the standard with O(N^2) memory.

What do you think about logging of exceptions, instead of hiding them? + There is an example of such hidden exception when head_shards and q_seq_shards were just not initialized because get_dist()==None.

    And despite hardware supports flash attention - this code silently falls back to the standard with O(N^2) memory.
@codecov-commenter
Copy link

codecov-commenter commented Jun 28, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.74%. Comparing base (744b8be) to head (fa66185).
⚠️ Report is 65 commits behind head on master.

Files with missing lines Patch % Lines
keras/src/backend/jax/nn.py 30.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21432      +/-   ##
==========================================
+ Coverage   74.94%   82.74%   +7.79%     
==========================================
  Files         565      567       +2     
  Lines       55224    56466    +1242     
  Branches     8610     8825     +215     
==========================================
+ Hits        41386    46720    +5334     
+ Misses      11880     7581    -4299     
- Partials     1958     2165     +207     
Flag Coverage Δ
keras 82.54% <30.00%> (+7.77%) ⬆️
keras-jax 63.81% <30.00%> (+0.47%) ⬆️
keras-numpy 58.30% <10.00%> (?)
keras-openvino 34.63% <10.00%> (?)
keras-tensorflow 64.25% <10.00%> (+0.50%) ⬆️
keras-torch 63.87% <10.00%> (+0.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gbaned gbaned requested a review from mattdangerw June 30, 2025 08:16
@gbaned gbaned added this to PR Queue Jun 30, 2025
@github-project-automation github-project-automation bot moved this to Assigned Reviewer in PR Queue Jun 30, 2025
@WIgor WIgor changed the title Worth not to hide exceptions It worth not hiding exceptions Jun 30, 2025
@divyashreepathihalli
Copy link
Collaborator

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the robustness and observability of the dot_product_attention function by adding logging for fallback scenarios and refactoring the attention implementation selection. The changes improve the user's ability to diagnose performance and compatibility issues.

Copy link
Collaborator

@divyashreepathihalli divyashreepathihalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Please run pre-commit run --all-files

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Aug 4, 2025
@github-project-automation github-project-automation bot moved this from Assigned Reviewer to Approved by Reviewer in PR Queue Aug 4, 2025
@hertschuh
Copy link
Collaborator

@WIgor ,

Thanks for the PR! Can you reformat the code? Then I can merge it.

@WIgor
Copy link
Contributor Author

WIgor commented Aug 8, 2025

As far as I see it does nothing

~/Projects/keras on  patch-1 ⌚ 6:07:26
$ pre-commit run --all-files
api_gen..................................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
(ml)
~/Projects/keras on  patch-1 ⌚ 6:08:19
$ git status
On branch patch-1
nothing to commit, working tree clean
(ml)

@google-ml-butler google-ml-butler bot removed the ready to pull Ready to be merged into the codebase label Aug 8, 2025
@WIgor
Copy link
Contributor Author

WIgor commented Aug 8, 2025

Ahh ok - it seems working now.

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Aug 8, 2025
@hertschuh hertschuh merged commit 0589a1c into keras-team:master Aug 8, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Approved by Reviewer to Merged in PR Queue Aug 8, 2025
@google-ml-butler google-ml-butler bot removed awaiting review ready to pull Ready to be merged into the codebase labels Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

6 participants