Skip to content

Commit

Permalink
Remove
Browse files Browse the repository at this point in the history
call to "jax_persistent_cache_min_entry_size_bytes" setting as the default value of 0 is the behavior we want.
  • Loading branch information
shtopane committed Oct 10, 2024
1 parent 789eba2 commit 1dd31cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion econpizza/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def setup_persistent_cache_jax(self):
if jax.config.jax_compilation_cache_dir is None and not os.path.exists(self.jax_cache_folder):
folder_path_jax = self._create_cache_dir(self.jax_cache_folder)
jax.config.update("jax_compilation_cache_dir", folder_path_jax)
jax.config.update("jax_persistent_cache_min_entry_size_bytes", -1)
jax.config.update("jax_persistent_cache_min_compile_time_secs", 0)
self.jax_cache_folder = folder_path_jax

Expand Down
3 changes: 1 addition & 2 deletions econpizza/testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_config_enable_jax_persistent_cache(mock_jax_update, mock_makedirs):
mock_makedirs.assert_any_call(os.path.join(os.getcwd(), "__jax_cache__"), exist_ok=True)

mock_jax_update.assert_any_call("jax_compilation_cache_dir", os.path.join(os.getcwd(), "__jax_cache__"))
mock_jax_update.assert_any_call("jax_persistent_cache_min_entry_size_bytes", -1)
mock_jax_update.assert_any_call("jax_persistent_cache_min_compile_time_secs", 0)

@patch("os.makedirs")
Expand All @@ -71,7 +70,7 @@ def test_jax_cache_folder_not_created_second_time(mock_jax_update, mock_makedirs
# When called for the first time, a cache folder should be created(default is __jax_cache__)
ep.config["enable_jax_persistent_cache"] = True
mock_makedirs.assert_any_call(os.path.join(os.getcwd(), "__jax_cache__"), exist_ok=True)
assert mock_jax_update.call_count == 3
assert mock_jax_update.call_count == 2
# Now reset the mock so that the calls are 0 again.
mock_makedirs.reset_mock()
mock_jax_update.reset_mock()
Expand Down

0 comments on commit 1dd31cf

Please sign in to comment.