oneapi-src / oneapi-src/unified-memory-framework
Expose memspace and policy API for managing host memory
@kswiecicki is already working on this.
Since Feb 22, 2024.
- Dominant language
- C
- Stars
- 98
- Forks
- 48
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 6
Description
A memspace is an ordered collection of one or more memory targets. It can represent a certain class of memory sources like all NUMA nodes in the system or contain memory targets with different properties (e.g., latency).
A memory target represents a single memory source (e.g., NUMA node) and can have certain attributes (e.g., capacity).
Memspaces to expose (should be exposed as functions or a single function accepting an enum to avoid problems with exporting variables on windows):
- UMF_MEMSPACE_HOST_ALL
- UMF_MEMSPACE_HBW
- UMF_MEMSPACE_LOWEST_LATENCY
- UMF_MEMSPACE_HIGHEST_CAPACITY
- UMF_MEMSPACE_HIGHEST_BANDWITH
Memspace attributes to expose:
- Capacity
- Latency (as distance to local node / other nodes)
- Bandwidth
- Numa node id
Memspace management API:
- Filtering based on one (or more) of the attributes
- Sorting based on one (or more) of the attributes
- Iteration over memory targets within a memspace
All memspaces should be a part of libumf (not separate libraries).
Memspace, along with a policy, can be used to create pools and providers (umfPoolCreateFromMemspace and umfMemoryProviderCreateFromMemspace). Implementation of umfPoolCreateFromMemspace should select the best-suited pool based on memspace and policy type and availability of memory pools.
Policies to expose:
- UMF_MEMSPACE_POLICY_STRICT
- UMF_MEMSPACE_POLICY_PREFERRED
- UMF_MEMSPACE_POLICY_BLOCKED
- UMF_MEMSPACE_POLICY_INTERLEAVED
- UMF_MEMSPACE_POLICY_LOCAL
Optional:
- expose system-level memory metrics for memspaces (.e.g total available/free/allocated memory)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.