Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

This is a desperate attempt to make TensorCache a little more stable #5334

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
with a default value of `False`. `False` means gradients are not rescaled and the gradient
norm is never even calculated. `True` means the gradients are still not rescaled but the gradient
norm is calculated and passed on to callbacks. A `float` value means gradients are rescaled.
- `TensorCache` now supports more concurrent readers and writers.


## [v2.6.0](https://github.com/allenai/allennlp/releases/tag/v2.6.0) - 2021-07-19
Expand Down
4 changes: 2 additions & 2 deletions allennlp/common/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ def __init__(
str(filename),
subdir=False,
map_size=map_size,
max_readers=cpu_count * 2,
max_spare_txns=cpu_count * 2,
max_readers=cpu_count * 4,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have an option to specify the kwargs in TensorCache's init? Or do we want to shield the users from the gory details?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to shield users from this. It seems like an implementation detail. Another implementation might not have that setting at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

max_spare_txns=cpu_count * 4,
metasync=False,
sync=True,
readahead=False,
Expand Down