Skip to content

Use hwloc instead of libnuma for os_provider #105

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
merged 3 commits into from
Jan 24, 2024

Conversation

igchor
Copy link
Member

@igchor igchor commented Jan 5, 2024

This allows us to get rid of libnuma as a dependency.

One missing features from hwloc is lack of support for: UMF_NUMA_FLAGS_MOVE_ALL. Do we care about this?"
Also, I think we need more tests before we can consider merging this. Something where we actually verify if memory is bound to a specific NUAMA node.

@igchor igchor force-pushed the hwloc_provider branch 3 times, most recently from 9cae8db to 23b0cf8 Compare January 5, 2024 00:16
@igchor
Copy link
Member Author

igchor commented Jan 5, 2024

CI fails because I don't know how to best install hwloc on windows and macos yet ;d

@ldorau
Copy link
Contributor

ldorau commented Jan 5, 2024

CI fails because I don't know how to best install hwloc on windows and macos yet ;d

I think we can keep OS provider disabled on Windows and MacOS as it is currently for now.

@bratpiorka
Copy link
Contributor

@igchor I'm not sure about this change. WinAPI already supports NUMA (https://learn.microsoft.com/en-us/windows/win32/procthread/numa-support#numa-api) and with your changes, the UMF would require an additional dependency. Maybe we could use hwloc instead of libnuma only for Linux?

@igchor
Copy link
Member Author

igchor commented Jan 5, 2024

@igchor I'm not sure about this change. WinAPI already supports NUMA (https://learn.microsoft.com/en-us/windows/win32/procthread/numa-support#numa-api) and with your changes, the UMF would require an additional dependency. Maybe we could use hwloc instead of libnuma only for Linux?

I thought we'll need to rely on hwloc anyway for topology discovery (e.g. to implement HOST memspace).

@igchor
Copy link
Member Author

igchor commented Jan 5, 2024

CI fails because I don't know how to best install hwloc on windows and macos yet ;d

I think we can keep OS provider disabled on Windows and MacOS as it is currently for now.

Ok. Done.

@bratpiorka
Copy link
Contributor

@igchor I'm not sure about this change. WinAPI already supports NUMA (https://learn.microsoft.com/en-us/windows/win32/procthread/numa-support#numa-api) and with your changes, the UMF would require an additional dependency. Maybe we could use hwloc instead of libnuma only for Linux?

I thought we'll need to rely on hwloc anyway for topology discovery (e.g. to implement HOST memspace).

OK but what I'm thinking about is that installing hwloc on Windows could be not as easy as for linux. I think we should add short description to the readme how to do that. Also, we should think which hwloc version we would require. Recently hwloc team released 2.10 version with some nice features supporting heterogeneous memory. Maybe for a stand-alone version (without oneAPI base toolkit) we should ship hwloc binaries inside deps or something.

@igchor
Copy link
Member Author

igchor commented Jan 8, 2024

@igchor I'm not sure about this change. WinAPI already supports NUMA (https://learn.microsoft.com/en-us/windows/win32/procthread/numa-support#numa-api) and with your changes, the UMF would require an additional dependency. Maybe we could use hwloc instead of libnuma only for Linux?

I thought we'll need to rely on hwloc anyway for topology discovery (e.g. to implement HOST memspace).

OK but what I'm thinking about is that installing hwloc on Windows could be not as easy as for linux. I think we should add short description to the readme how to do that. Also, we should think which hwloc version we would require. Recently hwloc team released 2.10 version with some nice features supporting heterogeneous memory. Maybe for a stand-alone version (without oneAPI base toolkit) we should ship hwloc binaries inside deps or something.

For now, the OS provider is not implemented for Windows anyway - when we do implement it, then yes, I agree, we should extend the readme. The version of hwloc we need will probably depend on the discovery use-case. For OS provider, we could even use 2.0

@vinser52
Copy link
Contributor

vinser52 commented Jan 9, 2024

Maybe for a stand-alone version (without oneAPI base toolkit) we should ship hwloc binaries inside deps or something.

@bratpiorka what do you mean by "standalone version"? We never discussed the distribution model for UMF except as part of oneAPI or source code on GitHub?

@bratpiorka
Copy link
Contributor

Maybe for a stand-alone version (without oneAPI base toolkit) we should ship hwloc binaries inside deps or something.

@bratpiorka what do you mean by "standalone version"? We never discussed the distribution model for UMF except as part of oneAPI or source code on GitHub?

Ok I was thinking about the far future. Sergey - do you know is hwloc lib is added into oneAPI?

@vinser52
Copy link
Contributor

vinser52 commented Jan 9, 2024

Sergey - do you know is hwloc lib is added into oneAPI?

Yes, it was added for TCM needs.

@bratpiorka
Copy link
Contributor

please rebase - also I think we could set this PR to "ready to review"

@igchor
Copy link
Member Author

igchor commented Jan 17, 2024

please rebase - also I think we could set this PR to "ready to review"

I'd prefer to have tests for NUMA merged first and to verify this on a multiple-node machine.

@igchor
Copy link
Member Author

igchor commented Jan 22, 2024

I've rebased this PR and verified it works fine with tests from: #160 I think we can consider mergining it now. There are still some tests that would be useful (e.g. #144) but I don't think we need to actually wait on those.

@igchor
Copy link
Member Author

igchor commented Jan 22, 2024

Also, I've left dependency for libnuma in tests since I think it should not be a problem and it would be good to verify that hwloc does what it is supposed to do.

There is no implmenetation for windows anyway.
@igchor igchor marked this pull request as ready for review January 22, 2024 22:49
@igchor igchor requested a review from a team as a code owner January 22, 2024 22:49
@igchor igchor requested a review from bratpiorka January 23, 2024 20:07
@bratpiorka bratpiorka merged commit c652cec into oneapi-src:main Jan 24, 2024
@igchor igchor deleted the hwloc_provider branch January 24, 2024 16:19
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.

5 participants