Skip to content
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

Consider subclassing Python CuFile object from io.RawIOBase #577

Open
jakirkham opened this issue Dec 10, 2024 · 4 comments
Open

Consider subclassing Python CuFile object from io.RawIOBase #577

jakirkham opened this issue Dec 10, 2024 · 4 comments

Comments

@jakirkham
Copy link
Member

To improve interoperability between CuFile objects and other Python libraries that accept file objects, it would be nice to subclass io.RawIOBase and implement the methods io.RawIOBase defines

This would allow consumers of KvikIO to create a CuFile object and leverage it with existing Python libraries implementing custom file readers/writers. It would also allow user to interweave any header/footer parsing of metadata with KvikIO (perhaps on to CPU) and then follow up by reading the bulk data after with KvikIO (likely on to GPU)

More generally this would allow users to compose KvikIO's CuFile object with other Python libraries to quickly handle reading more file formats onto the GPU without needing to reimplement each file format/library

@jakirkham
Copy link
Member Author

A subset of this functionality (implementing seek and tell specifically) is mentioned in issue: #576

@yiheng-wang-nv
Copy link

yiheng-wang-nv commented Dec 16, 2024

Hi @jakirkham @madsbk , Do you think we can add some examples/tutorials in https://github.com/rapidsai/kvikio/tree/branch-25.02/notebooks to showcase the applications on CuFile for medical image loading?

According to my current researches and experiments, it's feasible to do:

  1. use kvikio + nibabel to load .nii images faster
  2. use kvikio + pydicom to load .dcm images faster

I'm fine to make some contributions if you agree. Welcome to have further discussions!

@madsbk
Copy link
Member

madsbk commented Dec 19, 2024

Sure @yiheng-wang-nv, that would be great!

@yiheng-wang-nv
Copy link

Thanks @madsbk for the support. I created a ticket: #580 to track the progress.

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

No branches or pull requests

3 participants