cerebras.modelzoo.tools.checkpoint_converters.mup.ConfigConverter_muP_CS22_CS23#
- class cerebras.modelzoo.tools.checkpoint_converters.mup.ConfigConverter_muP_CS22_CS23[source]#
Bases:
cerebras.modelzoo.tools.checkpoint_converters.base_converter.BaseConfigConverter
Transforms a CS 2.2 muP config to a CS 2.3 muP config with the reworked params.
Methods
assert_factory_fn
convert
convert_all_keys
Converts all keys in a config from converter_indices.direction format to the other format.
Attempts to convert the old key by matching against the list of conversion rules.
file_formats
formats
get_converter_indices
is_mup
load
match_indices
post_config_convert
pre_config_convert
Copies value that exists at old_state_dict's old_key to new_state_dict's new_key.
replace_output_logits_scale
save
supports_conversion
unscale_input_initializer
unscale_output_initializer
- convert_helper(model, config, converter_indices, drop_unmatched_keys=False, no_progress_bar=True, debug=False)#
Converts all keys in a config from converter_indices.direction format to the other format. Conversion will fail if at least one of the keys did not match on any conversion rules and drop_unmatched_keys is not enabled. Returns the newly converted config.
- convert_key(old_key, old_state_dict, new_state_dict, from_index, match_start=0, prefix='', action_fn_args=None, debug=False)#
Attempts to convert the old key by matching against the list of conversion rules. The first rule to match is used for conversion (i.e. even if multiple rules would match, the latter ones are never used). Returns True if a conversion occurred.
- static replaceKey(old_key, new_key, old_state_dict, new_state_dict, from_index, action_fn_args=None)#
Copies value that exists at old_state_dict’s old_key to new_state_dict’s new_key.