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

[Bugfix] Allow import of TVM when current directory is read-only #17142

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

Lunderberg
Copy link
Contributor

Prior to this commit, TVM could only be imported if the current directory had write privileges. This was due to the use of tvm.contrib.pickle_memoize to cache the winograd transformation matrices.

This commit makes multiple related fixes, to ensure that (1) TVM can be imported regardless of directory permissions, (2) the working directory is not left in a cluttered state, and (3) cache files are generated in an expected location to be reused later.

  • The cache directory is only generated when required, just prior to saving a cache.

  • The cache directory defaults to $HOME/.cache/tvm/pkl_memoize, rather than .pkl_memorize_py3 in the working directory.

  • The cache directory respects XDG_CACHE_HOME, using $XDG_CACHE_HOME/tvm/pkl_memoize if set.

Prior to this commit, TVM could only be imported if the current
directory had write privileges.  This was due to the use of
`tvm.contrib.pickle_memoize` to cache the winograd transformation
matrices.

This commit makes multiple related fixes, to ensure that (1) TVM can
be imported regardless of directory permissions, (2) the working
directory is not left in a cluttered state, and (3) cache files are
generated in an expected location to be reused later.

* The cache directory is only generated when required, just prior to
  saving a cache.

* The cache directory defaults to `$HOME/.cache/tvm/pkl_memoize`,
  rather than `.pkl_memorize_py3` in the working directory.

* The cache directory respects `XDG_CACHE_HOME`, using
  `$XDG_CACHE_HOME/tvm/pkl_memoize` if set.
@Lunderberg Lunderberg force-pushed the bugfix_import_tvm_in_read_only_dir branch from 4aa3d74 to 110314b Compare July 8, 2024 14:28
@vinx13 vinx13 merged commit b654852 into apache:main Jul 15, 2024
19 checks passed
@Lunderberg Lunderberg deleted the bugfix_import_tvm_in_read_only_dir branch July 15, 2024 21:03
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

Successfully merging this pull request may close these issues.

2 participants