v2.0.0rc1
Pre-releaseThis is the first (and hopefully only) release candidate for AllenNLP 2.0. Please note that this is a release candidate, and the APIs are still subject to change until the final 2.0 release. We'll provide a detailed writeup with the final 2.0 release, including a migration guide. In the meantime, here are the headline features of AllenNLP 2.0:
- Support for models that combine language and vision features
- Transformer Toolkit, a suite of classes and components that make it easy to experiment with transformer architectures
- A framework for multitask training
- Revamped data loading, for improved performance and flexibility
What's new
Added 🎉
- Added
TensorCache
class for caching tensors on disk - Added abstraction and concrete implementation for image loading
- Added abstraction and concrete implementation for
GridEmbedder
- Added abstraction and demo implementation for an image augmentation module.
- Added abstraction and concrete implementation for region detectors.
- A new high-performance default
DataLoader
:MultiProcessDataLoading
. - A
MultiTaskModel
and abstractions to use with it, includingBackbone
andHead
. The
MultiTaskModel
first runs its inputs through theBackbone
, then passes the result (and
whatever other relevant inputs it got) to eachHead
that's in use. - A
MultiTaskDataLoader
, with a correspondingMultiTaskDatasetReader
, and a couple of new
configuration objects:MultiTaskEpochSampler
(for deciding what proportion to sample from each
dataset at every epoch) and aMultiTaskScheduler
(for ordering the instances within an epoch). - Transformer toolkit to plug and play with modular components of transformer architectures.
- Added a command to count the number of instances we're going to be training with
- Added a
FileLock
class tocommon.file_utils
. This is just like theFileLock
from thefilelock
library, except that
it adds an optional flagread_only_ok: bool
, which when set toTrue
changes the behavior so that a warning will be emitted
instead of an exception when lacking write permissions on an existing file lock.
This makes it possible to use theFileLock
class on a read-only file system. - Added a new learning rate scheduler:
CombinedLearningRateScheduler
. This can be used to combine different LR schedulers, using one after the other. - Added an official CUDA 10.1 Docker image.
- Moving
ModelCard
andTaskCard
abstractions into the main repository. - Added a util function
allennlp.nn.util.dist_reduce(...)
for handling distributed reductions.
This is especially useful when implementing a distributedMetric
.
Changed ⚠️
DatasetReader
s are now always lazy. This means there is nolazy
parameter in the base
class, and the_read()
method should always be a generator.- The
DataLoader
now decides whether to load instances lazily or not.
With thePyTorchDataLoader
this is controlled with thelazy
parameter, but with
theMultiProcessDataLoading
this is controlled by themax_instances_in_memory
setting. ArrayField
is now calledTensorField
, and implemented in terms of torch tensors, not numpy.- Improved
nn.util.move_to_device
function by avoiding an unnecessary recursive check for tensors and
adding anon_blocking
optional argument, which is the same argument as intorch.Tensor.to()
. - If you are trying to create a heterogeneous batch, you now get a better error message.
- Readers using the new vision features now explicitly log how they are featurizing images.
master_addr
andmaster_port
renamed toprimary_addr
andprimary_port
, respectively.is_master
parameter for training callbacks renamed tois_primary
.master
branch renamed tomain
- Torch version bumped to 1.7.1 in Docker images.
Removed 👋
- Removed
nn.util.has_tensor
.
Fixed ✅
- The
build-vocab
command no longer crashes when the resulting vocab file is
in the current working directory. - Fixed typo with
LabelField
string representation: removed trailing apostrophe. Vocabulary.from_files
andcached_path
will issue a warning, instead of failing, when a lock on an existing resource
can't be acquired because the file system is read-only.TrackEpochCallback
is now aEpochCallback
.
Commits
9a4a424 Moves vision models to allennlp-models (#4918)
412896b fix merge conflicts
ed322eb A helper for distributed reductions (#4920)
9ab2bf0 add CUDA 10.1 Docker image (#4921)
d82287e Update transformers requirement from <4.1,>=4.0 to >=4.0,<4.2 (#4872)
5497394 Multitask example (#4898)
0f00d4d resolve _read type (#4916)
5229da8 Toolkit decoder (#4914)
4183a49 Update mkdocs-material requirement from <6.2.0,>=5.5.0 to >=5.5.0,<6.3.0 (#4880)
d7c9eab improve worker error handling in MultiProcessDataLoader (#4912)
94dd9cc rename 'master' -> 'primary' for distributed training (#4910)
c9585af fix imports in file_utils
03c7ffb Merge branch 'main' into vision
effcc4e improve data loading docs (#4909)
2f54570 remove PyTorchDataLoader, add SimpleDataLoader for testing (#4907)
31ec6a5 MultiProcessDataLoader takes PathLike data_path (#4908)
5e3757b rename 'multi_process_*' -> 'multiprocess' for consistency (#4906)
df36636 Data loading cuda device (#4879)
aedd3be Toolkit: Cleaning up TransformerEmbeddings (#4900)
54e85ee disable codecov annotations (#4902)
2623c4b Making TrackEpochCallback an EpochCallback (#4893)
1d21c75 issue warning instead of failing when lock can't be acquired on a resource that exists in a read-only file system (#4867)
ec197c3 Create pull_request_template.md (#4891)
15d32da Make GQA work (#4884)
fbab0bd import MultiTaskDataLoader to data_loaders/init.py (#4885)
d1cc146 Merge branch 'main' into vision
abacc01 Adding f1 score (#4890)
9cf41b2 fix navbar link
9635af8 rename 'master' -> 'main' (#4887)
d0a07fb docs: fix simple typo, multplication -> multiplication (#4883)
d1f032d Moving modelcard and taskcard abstractions to main repo (#4881)
f62b819 Make images easier to find for Visual Entailment (#4878)
1fff7ca Update docker torch version (#4873)
7a7c7ea Only cache, no featurizing (#4870)
d2aea97 Fix typo in str (#4874)
1c72a30 Merge branch 'master' into vision
6a8d425 add CombinedLearningRateScheduler (#4871)
85d38ff doc fixes
c4e3f77 Switch to torchvision for vision components 👀, simplify and improve MultiProcessDataLoader (#4821)
3da8e62 Merge branch 'master' into vision
a3732d0 Fix cache volume (#4869)
832901e Turn superfluous warning to info when extending the vocab in the embedding matrix (#4854)
147fefe Merge branch 'master' into vision
87e3536 Make tests work again (#4865)
d16a5c7 Merge remote-tracking branch 'origin/master' into vision
457e56e Merge branch 'master' into vision
c8521d8 Toolkit: Adding documentation and small changes for BiModalAttention
(#4859)
ddbc740 gqa reader fixes during vilbert training (#4851)
50e50df Generalizing transformer layers (#4776)
52fdd75 adding multilabel option (#4843)
7887119 Other VQA datasets (#4834)
e729e9a Added GQA reader (#4832)
52e9dd9 Visual entailment model code (#4822)
01f3a2d Merge remote-tracking branch 'origin/master' into vision
3be6c97 SNLI_VE dataset reader (#4799)
b659e66 VQAv2 (#4639)
c787230 Merge remote-tracking branch 'origin/master' into vision
db2d1d3 Merge branch 'master' into vision
6bf1924 Merge branch 'master' into vision
167bcaa remove vision push trigger
7591465 Merge remote-tracking branch 'origin/master' into vision
22d4633 improve independence of vision components (#4793)
98018cc fix merge conflicts
c780315 fix merge conflicts
5d22ce6 Merge remote-tracking branch 'origin/master' into vision
602399c update with master
ffafaf6 Multitask data loading and scheduling (#4625)
7c47c3a Merge branch 'master' into vision
12c8d1b Generalizing self attention (#4756)
63f61f0 Merge remote-tracking branch 'origin/master' into vision
b48347b Merge remote-tracking branch 'origin/master' into vision
81892db fix failing tests
98edd25 update torch requirement
8da3508 update with master
cc53afe separating TransformerPooler as a new module (#4730)
4ccfa88 Transformer toolkit: BiModalEncoder now has separate num_attention_heads
for both modalities (#4728)
91631ef Transformer toolkit (#4577)
677a9ce Merge remote-tracking branch 'origin/master' into vision
2985236 This should have been part of the previously merged PR
c5d264a Detectron NLVR2 (#4481)
e39a5f6 Merge remote-tracking branch 'origin/master' into vision
f1e46fd Add MultiTaskModel (#4601)
fa22f73 Merge remote-tracking branch 'origin/master' into vision
41872ae Merge remote-tracking branch 'origin/master' into vision
f886fd0 Merge remote-tracking branch 'origin/master' into vision
191b641 make existing readers work with multi-process loading (#4597)
d7124d4 fix len calculation for new data loader (#4618)
8746361 Merge branch 'master' into vision
319794a remove duplicate padding calculations in collate fn (#4617)
de9165e rename 'node_rank' to 'global_rank' in dataset reader 'DistributedInfo' (#4608)
3d11419 Formatting updates for new version of black (#4607)
cde06e6 Changelog
1b08fd6 ensure models check runs on right branch
44c8791 ensure vision CI runs on each commit (#4582)
95e8253 Merge branch 'master' into vision
e74a736 new data loading (#4497)
6f82005 Merge remote-tracking branch 'origin/master' into vision
a7d45de Initializing a VilBERT model from a pre-trained transformer (#4495)
3833f7a Merge branch 'master' into vision
71d7cb4 Merge branch 'master' into vision
3137961 Merge remote-tracking branch 'origin/master' into vision
6cc508d Merge branch 'master' into vision
f87df83 Merge remote-tracking branch 'origin/master' into vision
0bbe84b An initial VilBERT model for NLVR2 (#4423)