Skip to content

Commit

Permalink
feat(cache): add warning on cache miss
Browse files Browse the repository at this point in the history
  • Loading branch information
dacorvo committed Jan 16, 2024
1 parent 048db0e commit b78972c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion optimum/neuron/utils/hub_neuronx_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,14 @@ def exists(self, path):
# Always prioritize the default cache
if self.default_cache.exists(path):
return True
return self.api.file_exists(self.repo_id, self._rel_path(path))
rel_path = self._rel_path(path)
exists = self.api.file_exists(self.repo_id, rel_path)
if not exists:
logger.warning(
f"{rel_path} not found in {self.repo_id}: the corresponding graph will be recompiled."
" This may take up to one hour for large models."
)
return exists

def download_file(self, filename, dst_path):
# Always prioritize the default cache for faster retrieval
Expand Down

0 comments on commit b78972c

Please sign in to comment.