You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve all-in-memory file copy architecture (Python at least) #12641
Current file copy (at least via Python tf.gfile.Copy (gfile.py→ file_io.py → file_io.i)) involves copying the source contents into memory, and then writing memory to the destination. For scenarios like #12630 which is working with an 11GB asset, this is unacceptable design.
file_system.h's WritableFile is not stubbed to allow anything like a streaming, though its RandomAccessFile is. (not entirely, entirely, true - i suppose WriteableFile.Append(const StringPiece& data) could be employed in a streamable fashion -ish.)
To cull the Python low hanging fruit, at least, please implement file_io.i using a regular streaming design instead of the above described current design.
Slurping the whole file into memory and writing it back out isn't exactly optimal. Streaming would be great. What would be even better is the sendfile system call, which does it entirely in kernel space. If would be terrific if @rohan100jain was able to implement that when src and dst are Unix FS, and do streaming otherwise.
There's a PR somewhere adding in-kernel sendfile copy support I spent a lot of time helping to review a while back. I don't know what the status of that is, but I hope the author is generous enough to bring it to completion, because it'd be a great notch in his belt because this isn't an easy problem to solve.
Activity
yongtang commentedon Aug 28, 2017
Created a PR #12658 for that.
jart commentedon Aug 30, 2017
Slurping the whole file into memory and writing it back out isn't exactly optimal. Streaming would be great. What would be even better is the
sendfilesystem call, which does it entirely in kernel space. If would be terrific if @rohan100jain was able to implement that when src and dst are Unix FS, and do streaming otherwise.yongtang commentedon Aug 31, 2017
The implementation of CopyFile in PR #12658 has been updated with calling
sendfilein Linux for posix file systems. Please take a look.tensorflowbutler commentedon Dec 20, 2017
It has been 14 days with no activity and this issue has an assignee.Please update the label and/or status accordingly.
tensorflowbutler commentedon Jan 3, 2018
It has been 14 days with no activity and this issue has an assignee.Please update the label and/or status accordingly.
tensorflowbutler commentedon Jan 18, 2018
Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
tensorflowbutler commentedon Feb 6, 2018
Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
jart commentedon Feb 6, 2018
There's a PR somewhere adding in-kernel sendfile copy support I spent a lot of time helping to review a while back. I don't know what the status of that is, but I hope the author is generous enough to bring it to completion, because it'd be a great notch in his belt because this isn't an easy problem to solve.
quaeler commentedon Feb 6, 2018
It's the PR cited above - #12658