Skip to content
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

benchdnn: improve memory estimation #2658

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

dzarukin
Copy link
Contributor

@dzarukin dzarukin commented Feb 11, 2025

This PR brings a bunch of general improvements:

  • Add "run ref" status line so that it's easier to distinguish between GPU and CPU problems when validating GPU cases with CPU reference.
  • Use mprotect for --mode=R, previously it was used for --mode=C only. This brings a consistent behavior to running the test case with the library side.
  • The major one - improves memory estimation for prim_ref objects. It usually happens that CPU ref primitive requires weights in blocked format and padding is possible in this case. In real extreme cases, it could lead up to 64x more memory for weights that it was estimated for reference because original estimation would consider ref memories in f32 abx format. With this PR, the logic would collect real sizes of prim_ref, combine them with the library primitive and perform a check. If it doesn't fit, current prim_ref wouldn't be used (it's allowed up to 4 prim_ref versions). If none of them fits but the library one fits with pure ref, that one will be executed.

@dzarukin dzarukin requested review from a team as code owners February 11, 2025 05:37
@github-actions github-actions bot added documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc component:graph-api Codeowner: @oneapi-src/onednn-graph component:tests Codeowner: @oneapi-src/onednn-arch labels Feb 11, 2025
@dzarukin
Copy link
Contributor Author

make test
set test_scope=NIGHTLY

tests/benchdnn/utils/task.hpp Show resolved Hide resolved
@dzarukin dzarukin force-pushed the dzarukin/benchdnn_mem_estimate branch from e9369c1 to 7094b18 Compare February 12, 2025 00:25
@dzarukin
Copy link
Contributor Author

make test
set test_scope=NIGHTLY

@dzarukin dzarukin force-pushed the dzarukin/benchdnn_mem_estimate branch from 7094b18 to 347dc83 Compare February 12, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:graph-api Codeowner: @oneapi-src/onednn-graph component:tests Codeowner: @oneapi-src/onednn-arch documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants