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

graph: backend: dnnl: fix the null pointer issue and remove unused code #2504

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

Conversation

gyhintel
Copy link
Contributor

Description

  • Fix the sanitizer issues: applying non-zero offset 150994944 to null pointer
  • Remove the unused code.

@gyhintel gyhintel added the component:graph-api Codeowner: @oneapi-src/onednn-graph label Jan 24, 2025
@gyhintel gyhintel self-assigned this Jan 24, 2025
@gyhintel gyhintel requested a review from a team as a code owner January 24, 2025 10:35
@gyhintel
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable benchdnn_all
enable benchdnn_graph

@@ -142,13 +142,6 @@ void sdp_primitive_kernel_t<quantized>::prepare_args_set(
mem_idx.first.set_data_handle(
outputs[mem_idx.second].get_data_handle());
}

grantor_t var_grantor = memory_planner_.internal_temporary_grantor(
Copy link
Contributor

Choose a reason for hiding this comment

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

could you explain why remove these code?
Do we need to check if scratchpad is needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sdp_primitive doesn't need scratchpad memory, so we set the scratchpad memory size is 0 in L227. So we don't need to set the data handle for the internal memory.

@gyhintel gyhintel force-pushed the gyh/main/fix-nullptr branch from 31f1e16 to fbd6bc0 Compare January 24, 2025 14:20
@gyhintel
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable benchdnn_all
enable benchdnn_graph

@@ -215,6 +215,7 @@ class grantor_t {
}

char *get(const registry_t::key_t &key) const {
if (aligned_base_ptr_ == nullptr) return nullptr;
return aligned_base_ptr_ + registry_.get(key);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
return aligned_base_ptr_ + registry_.get(key);
return aligned_base_ptr_ ? (aligned_base_ptr_ + registry_.get(key)) : nullptr;

@gyhintel gyhintel force-pushed the gyh/main/fix-nullptr branch from fbd6bc0 to dc994c8 Compare January 25, 2025 14:41
@gyhintel
Copy link
Contributor Author

make test
set test_scope=NIGHTLY
disable benchdnn_all
enable benchdnn_graph

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants