{"id":27501,"library":"umf","title":"Unified Memory Framework (UMF)","description":"UMF is a C library for constructing allocators and memory pools, with Python bindings provided by the umf package. It manages multiple memory pools for different hardware resources (CPU, GPU). Current version 1.1.0, release cadence: minor releases every few months with patch releases as needed.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/oneapi-src/unified-memory-framework","tags":["memory management","unified memory","allocators","UMF","oneAPI"],"install":[{"cmd":"pip install umf","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for C library bindings","package":"cffi","optional":false},{"reason":"Commonly used with UMF for arrays","package":"numpy","optional":true}],"imports":[{"note":"The main class is UMF; direct import of module does not expose functionality.","wrong":"import umf","symbol":"UMF","correct":"from umf import UMF"},{"note":"","wrong":"","symbol":"MemoryPool","correct":"from umf.pool import MemoryPool"}],"quickstart":{"code":"from umf import UMF\n\n# Initialize UMF\numf = UMF()\n\n# Create a memory pool (example: JUMA pool)\npool = umf.create_pool('JUMA')\n\n# Allocate memory\nptr = pool.alloc(1024)\nprint(f\"Allocated 1024 bytes at {ptr}\")\n\n# Free memory\npool.free(ptr)","lang":"python","description":"Initializes UMF and creates a memory pool to allocate and free memory. Replace 'JUMA' with appropriate pool type for your hardware."},"warnings":[{"fix":"Migrate to umfParamsCreate/umfParamsDestroy and parameter setter/getter functions.","message":"In UMF 0.10.0, the parameters API changed from direct struct access to a new set/get API. Code using UMF_PARAMS or similar struct fields will break.","severity":"breaking","affected_versions":"<0.10.0"},{"fix":"Remove any usage of UMF_DISABLE_HWLOC. hwloc topology is now initialized automatically.","message":"UMF_DISABLE_HWLOC option was removed in UMF 1.1.0.","severity":"deprecated","affected_versions":"<=1.1.0"},{"fix":"Check UMF documentation for which providers are available in your build. Use umf.supported_providers() to list them.","message":"The Python package 'umf' wraps only a subset of the C library. Some providers (e.g., Level Zero, CUDA) are only available if the C library was built with those backends.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from umf import UMF` for the main class.","cause":"The main class is UMF, but the module name is umf. Common mistake is `import umf` instead of `from umf import UMF`.","error":"ImportError: cannot import name 'UMF' from 'umf'"},{"fix":"Either `from umf import UMF` and use `UMF()`, or call the class directly.","cause":"Calling `umf()` after `import umf` which imports the module, not the class.","error":"TypeError: 'module' object is not callable"},{"fix":"Install the C library (e.g., via conda or building from source) or set LD_LIBRARY_PATH appropriately.","cause":"The C library is not installed or not in LD_LIBRARY_PATH.","error":"FileNotFoundError: Could not find libumf.so"},{"fix":"Check available providers with `umf.supported_providers()` and use one of them.","cause":"The requested memory pool type is not supported in the current UMF build.","error":"ValueError: Provider 'JUMA' is not available"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}