Models¶
This module defines mappings from strings to models. This was necessary to isolate the model being run in memsave_torch.util.estimate and having a separate torch runtime for every single run. Otherwise, CUDA does not clear memory unless absolutely required, even on calling the torch.cuda.empty_cache() function, which makes memory measurements very difficult.
Utility file defining the various models, add more in the conv_model_fns dict.
- experiments.util.models.prefix_in_pairs(prefix: str, it: List[str]) List[str]¶
Prefixes the given prefix after each entry of the list it.
Example
>>> models = ['resnet101', 'convnext'] >>> prefix_in_pairs('memsave_', models) ['resnet101', 'memsave_resnet101', 'convnext', 'memsave_convnext']
- experiments.util.models.conv_model_fns¶
All listed models have their MemSave variants accessible as
'memsave_<Model Name>'All conv models defined to be used as strings in experiments.paper_demoscript¶Model Name (
str)Model Function
"alexnet""convnext_base""resnet101""vgg16""resnet18""fasterrcnn_resnet50_fpn_v2""retinanet_resnet50_fpn_v2""ssdlite320_mobilenet_v3_large"torchvision.models.detection.ssdlite320_mobilenet_v3_large()"deeplabv3_resnet101""fcn_resnet101""efficientnet_v2_l""mobilenet_v3_large""resnext101_64x4d"
- experiments.util.models.hf_transformers_models_map¶
All listed models have their MemSave variants accessible as
'memsave_<Model Name>'