Skip to content

Fix highest capacity memspace with OS provider integration. #390

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

Merged

Conversation

igchor
Copy link
Member

@igchor igchor commented Mar 25, 2024

The integration was not correct - umfMemoryProviderCreateFromMemspace was passing nodemask with all bits set to OS provider (with MODE_BIND) which resulted in memory being allocated from the arbitrary node. This wasn't caught by the test due to wrong way of checking allocation location.

Fix this, by changing the implementation of numa_memory_target to only pass a single node to OS provider for now. This should be changed once we have implemented memspace policies and/or extend OS provider to possibly support setting priority for nodes from which we want to allocate.

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used

@igchor igchor requested a review from a team as a code owner March 25, 2024 19:49
@igchor igchor force-pushed the memspace_highest_capacity_alloc branch 5 times, most recently from 416c8f0 to e5926d8 Compare March 26, 2024 02:38
@igchor igchor force-pushed the memspace_highest_capacity_alloc branch 2 times, most recently from be8cf0a to b2d3822 Compare March 26, 2024 14:49
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

👍 lgtm

igchor added 2 commits March 26, 2024 08:25
The test was using get_mempolicy to verify whether allocation
was done on a specific node but params to get_mem_policy were wrong.

Instead of returning the nodeId, get_mempolicy was returning a policy
associated with the address which was always: all nodes set.
when creating provider from highest capacity memspace
@igchor igchor force-pushed the memspace_highest_capacity_alloc branch from b2d3822 to 2a2680e Compare March 26, 2024 15:25
Id stored in memory target is physcial, not logical id so use
hwloc_get_numanode_obj_by_os_index
@lukaszstolarczuk lukaszstolarczuk merged commit 9a4675b into oneapi-src:main Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants