A basic Python wrapper for the NVidia cuFile API
Low maintenance activity. Last release 14 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
Consider insteadlibkvikio-cu12Pythie’s Index: 89234.3K downloads/moCompare →
pip install cufile-pythoncufile-python
A basic Python wrapper for the NVidia cuFile API
Installation
pip install cufile-python
Usage
Basic usage with the CuFile context manager:
from cufile import CuFile
import torch
import ctypes
# allocate an empty buffer in VRAM
t = torch.empty((1024, 1024, 16), dtype=torch.float32, device="cuda")
with CuFile("test.bin", "r") as f:
f.read(ctypes.c_void_p(t.data_ptr()), t.nbytes)
Alternatively one could import cufile.bindings and use it as if calling libcufile from C++.
Development
To set up the development environment:
- Clone the repository:
git clone https://github.com/yanok/cufile-python.git
cd cufile-python
- Install development dependencies:
pip install -r requirements.txt
- Run tests:
python -m pytest tests/
License
This project is licensed under the MIT License - see the LICENSE file for details.