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: graph: use plain copy and paste for reorder if fail to create pd #2262

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wzt1997
Copy link
Contributor

@wzt1997 wzt1997 commented Dec 13, 2024

Description

Since the backend does not support int4->int4 reorder currently, we use direct if-else condition to check the unsupported case during input displacement currently. We'd better try with reorder first and use plain copy-and-paste instead if the attempt fails.

@wzt1997 wzt1997 requested a review from dzarukin December 13, 2024 05:44
@wzt1997 wzt1997 self-assigned this Dec 13, 2024
@wzt1997 wzt1997 requested review from a team as code owners December 13, 2024 05:45
@wzt1997 wzt1997 force-pushed the zhitao/bdnn-fix-input-displace branch from 0230587 to e5bd03c Compare December 13, 2024 05:47
@wzt1997
Copy link
Contributor Author

wzt1997 commented Dec 13, 2024

make test
enable benchdnn_nightly
disable benchdnn_all
enable benchdnn_graph

@wzt1997 wzt1997 force-pushed the zhitao/bdnn-fix-input-displace branch 2 times, most recently from 807e034 to 9c5fc54 Compare December 16, 2024 06:57
@wzt1997 wzt1997 force-pushed the zhitao/bdnn-fix-input-displace branch from 9c5fc54 to 361f33c Compare December 16, 2024 07:43
});
return OK;
} else
return FAIL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to build the block like that:

while (!r_pd_) {
    // Fallback to GPU reorder.
    dnnl_status_t status = dnnl_reorder_primitive_desc_create(
            &r_pd_, src.md_, src.engine(), dst.md_, dst.engine(), attr);
    if (status != dnnl_success) break;

    // code that executes pd (written below)
}

// Last resort: fallback to a plain copy for identical mds.
// new code goes here. If not identical, return FAIL.

Please add BENCHDNN_PRINT(2, "%s\n", "[REORDER] Fallback to plain copy."); when the fallback succeeded, to see what's going on.

@wzt1997 wzt1997 force-pushed the zhitao/bdnn-fix-input-displace branch from 361f33c to 141de68 Compare December 17, 2024 03:30
@wzt1997
Copy link
Contributor Author

wzt1997 commented Dec 18, 2024

make test Lightweight_scans

@wzt1997
Copy link
Contributor Author

wzt1997 commented Dec 18, 2024

make test
enable benchdnn_nightly
disable benchdnn_all
enable benchdnn_graph

Copy link
Contributor

@TaoLv TaoLv left a comment

Choose a reason for hiding this comment

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

Please rebase the PR to fix the lightweight scan failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants