Skip to content

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
@Lunderberg Lunderberg requested a review from csullivan July 12, 2024 18:59
@vinx13 vinx13 merged commit b654852 into apache:main Jul 15, 2024
@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