f"The experiment exp_id = {exp_id}, exp_name = {exp['name']}, did not run successfully with error = {err}, thus a metrics.txt does not exist for it. Check the stderr.log in {exp['result_dir']}"
f"Skipping exp_id = {exp_id}, exp_name = {exp['name']}, the experiment did not run successfully with error = {err}, thus a metrics.txt does not exist for it. Please check the stderr.log in {exp['result_dir']}"
# HF requires that "ZeRO Offload can only work with DeepSpeed optimizers"
ifoffloadandnotconfig.get("optimizer"):
returnFalse
returnTrue
defremove_dupe_dicts(l):
""" Removes duplicate dictionaries from a list. Uses list comprehension and the json library to sort and stringify each dictionary and the set data type to ensure unique values. Works with nested data structures.
injection_dict: the dictionary that shows the injection policy:
Example: {BertLayer: HFBertLayerPolicy}
return_tuple: if true, inference-API returns a tuple, otherwise a tensor
replace_method: the injection method, this can be passed as auto if no injection-policy is defined, in which case the injection is automatic based on the available policies
quantization_setting:
one of None, Tuple(mlp_extra_grouping, quantize_groups), quantize_groups
replace_with_kernel_inject: this flag need to be set to true to inject inference kernels for models such as, Bert, GPT2, GPT-Neo and GPT-J. Otherwise,
the injection_dict provides the names of two linear layers as a tuple: (attention_output projection, transformer output projection)