question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve file-based kernel cache

See original GitHub issue
  • Often ~/.cupy/kernel_cache inode becomes very big. I think it’s better to introduce a hierarchy e.g. using the first 2 chars from the cache key: ~/.cupy/ab/abXXXXXXXXX....cubin.
  • Avoid appending MD5 to a file. The reason this is introduced was to support Windows that needs special care to do atomic rename (https://github.com/cupy/cupy/pull/37/files#r115385936). os.replace is in Python 3 so we can just use it now. (FYI, on Windows os.replace uses MoveFileExW with MOVEFILE_REPLACE_EXISTING flag which can be considered atomic in our usecase; there is a long thread in the forum.)
  • Include some hint info to filename to manage cache files easily. (maybe NVRTC version and compute capability)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kmaehashicommented, Mar 21, 2021

How about adding this tool https://github.com/cupy/cupy/blob/master/.pfnci/trim_cupy_kernel_cache.py to cupyx/tools?

Include some hint info to filename to manage cache files easily. (maybe NVRTC version and compute capability)

Also including a CuPy’s major version (‘8’, ‘9’, etc.) to filename may help managing caches.

1reaction
leofangcommented, Apr 3, 2021

related? #1890

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 ways to improve hard drive speed in Linux - Dell
2. Bypass PAGE-CACHE for Large Files. ... Consider the case of a reading in a large file (i.e. a database) made of a...
Read more >
How to Get More Value From Your File System Directory Cache
This paper identifies several design principles that can substantially improve hit rate and reduce hit cost transparently to applications and file systems.
Read more >
Can I configure my Linux system for more aggressive file ...
Improving disk cache performance in general is more than just increasing the file system cache size unless your whole system fits in RAM...
Read more >
Improving read performance with dm-cache - Red Hat
Once the cache is populated, the read performance should increase. The Linux kernel file cache generally will perform considerably faster than ...
Read more >
File Caching in Distributed File Systems - GeeksforGeeks
Performance improvement of the file system is based on the ... The kernel can store some of the cached files in the disk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found