






"""simple docstring"""

import operator as op


lowercase    			=       '''scaler.pt'''
lowercase    			=       '''pytorch_model'''
lowercase    			=       '''random_states'''
lowercase    			=       '''optimizer'''
lowercase    			=       '''scheduler'''
lowercase    			=       '''pytorch_model.bin'''
lowercase    			=       '''pytorch_model.bin.index.json'''
lowercase    			=       '''model.safetensors'''
lowercase    			=       '''model.safetensors.index.json'''
lowercase    			=       '''1.10.2'''
lowercase    			=       '''py38'''
lowercase    			=       '''4.17.0'''
lowercase    			=       ['''ml.p3.16xlarge''', '''ml.p3dn.24xlarge''', '''ml.p4dn.24xlarge''']
lowercase    			=       ['''FULL_SHARD''', '''SHARD_GRAD_OP''', '''NO_SHARD''', '''HYBRID_SHARD''', '''HYBRID_SHARD_ZERO2''']
lowercase    			=       ['''TRANSFORMER_BASED_WRAP''', '''SIZE_BASED_WRAP''', '''NO_WRAP''']
lowercase    			=       ['''BACKWARD_PRE''', '''BACKWARD_POST''', '''NO_PREFETCH''']
lowercase    			=       ['''FULL_STATE_DICT''', '''LOCAL_STATE_DICT''', '''SHARDED_STATE_DICT''']
lowercase    			=       '''2.0.1'''
lowercase    			=       ['''pdsh''', '''standard''', '''openmpi''', '''mvapich''']
lowercase    			=       ['''default''', '''reduce-overhead''', '''max-autotune''']

lowercase    			=       {'''>''': op.gt, '''>=''': op.ge, '''==''': op.eq, '''!=''': op.ne, '''<=''': op.le, '''<''': op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
lowercase    			=       [
    '''nnodes''',
    '''nproc_per_node''',
    '''rdzv_backend''',
    '''rdzv_endpoint''',
    '''rdzv_id''',
    '''rdzv_conf''',
    '''standalone''',
    '''max_restarts''',
    '''monitor_interval''',
    '''start_method''',
    '''role''',
    '''module''',
    '''m''',
    '''no_python''',
    '''run_path''',
    '''log_dir''',
    '''r''',
    '''redirects''',
    '''t''',
    '''tee''',
    '''node_rank''',
    '''master_addr''',
    '''master_port''',
]

lowercase    			=       ['''DEEPSPEED''', '''MULTI_GPU''', '''FSDP''', '''MEGATRON_LM''']
lowercase    			=       ['''DEEPSPEED''', '''MULTI_XPU''', '''FSDP''']











"""simple docstring"""

def _lowerCAmelCase	(  __lowerCamelCase:list ,						__lowerCamelCase:list   ):

						'''simple docstring'''






						_validate_point(__lowerCamelCase   )
						_validate_point(__lowerCamelCase   )
						if len(__lowerCamelCase   ) != len(__lowerCamelCase   ):
												raise ValueError("Both points must be in the same n-dimensional space"   )

						return float(sum(abs(a - b   ) for a, b in zip(__lowerCamelCase ,						__lowerCamelCase   )   )   )






def _lowerCAmelCase	(  __lowerCamelCase:list[float]   ):

						'''simple docstring'''






						if point:
												if isinstance(__lowerCamelCase ,						__lowerCamelCase   ):
																		for item in point:
																								if not isinstance(__lowerCamelCase ,						(int, float)   ):
																														__magic_name__            =     (
																														    "Expected a list of numbers as input, found "
																														    f'''{type(__lowerCamelCase   ).__name__}'''
																														)
																														raise TypeError(__lowerCamelCase   )
												else:
																		__magic_name__            =     f'''Expected a list of numbers as input, found {type(__lowerCamelCase   ).__name__}'''
																		raise TypeError(__lowerCamelCase   )
						else:
												raise ValueError("Missing an input"   )






def _lowerCAmelCase	(  __lowerCamelCase:list ,						__lowerCamelCase:list   ):

						'''simple docstring'''






						_validate_point(__lowerCamelCase   )
						_validate_point(__lowerCamelCase   )
						if len(__lowerCamelCase   ) != len(__lowerCamelCase   ):
												raise ValueError("Both points must be in the same n-dimensional space"   )

						return float(sum(abs(x - y   ) for x, y in zip(__lowerCamelCase ,						__lowerCamelCase   )   )   )


if __name__ == "__main__":
			import doctest

			doctest.testmod()



