


'''simple docstring'''






from copy import deepcopy

import torch
import torch.nn.functional as F
from torch.optim import AdamW
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader

from accelerate.accelerator import Accelerator
from accelerate.state import GradientState
from accelerate.test_utils import RegressionDataset, RegressionModel
from accelerate.utils import DistributedType, is_torch_version, set_seed


def  _snake_case       (					A			,   A			,   A			,   A	)						->   Tuple:
							for param, grad_param in zip(model_a.parameters()			,   model_b.parameters()	):
														if not param.requires_grad:
																					continue
														if not did_step:
																					# Grads should not be in sync
																					assert (
																					    torch.allclose(param.grad			,   grad_param.grad	) is False
																					), F"""Gradients in sync when they should not be at iteration {iteration}:\nmodel_a grad ({param.grad}) == model_b grad ({grad_param.grad})"""
														else:
																					# Grads should be in sync
																					assert (
																					    torch.allclose(param.grad			,   grad_param.grad	) is True
																					), F"""Gradients not in sync when they should be at iteration {iteration}:\nmodel_a grad ({param.grad}) != model_b grad ({grad_param.grad})"""


def  _snake_case       (					A			,   A			,   A			,   A			,   A=True	)						->   Optional[Any]:
							model.train()
							lowerCAmelCase__	       =     model(A	)
							lowerCAmelCase__	       =     F.mse_loss(A			,   target.to(output.device	)	)
							if not do_backward:
														loss /= accelerator.gradient_accumulation_steps
														loss.backward()
							else:
														accelerator.backward(A	)


def  _snake_case       (					A			,   A=False	)						->   Tuple:
							set_seed(42	)
							lowerCAmelCase__	       =     RegressionModel()
							lowerCAmelCase__	       =     deepcopy(A	)
							lowerCAmelCase__	       =     RegressionDataset(length=80	)
							lowerCAmelCase__	       =     DataLoader(A			,   batch_size=16	)
							model.to(accelerator.device	)
							if sched:
														lowerCAmelCase__	       =     AdamW(params=model.parameters()			,   lr=1E-3	)
														lowerCAmelCase__	       =     AdamW(params=ddp_model.parameters()			,   lr=1E-3	)
														lowerCAmelCase__	       =     LambdaLR(A			,   lr_lambda=lambda A	: epoch**0.65	)
														lowerCAmelCase__	       =     LambdaLR(A			,   lr_lambda=lambda A	: epoch**0.65	)
							# Make a copy of `model`
							if sched:
														lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.prepare(A			,   A			,   A			,   A	)
							else:
														lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.prepare(A			,   A	)
							if sched:
														return (model, opt, sched, dataloader, ddp_model, ddp_opt, ddp_sched)
							return model, ddp_model, dataloader


def  _snake_case       (					A	)						->   int:
							# Test when on a single CPU or GPU that the context manager does nothing
							lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__	       =     get_training_setup(A	)
							# Use a single batch
							lowerCAmelCase__       , lowerCAmelCase__	       =     next(iter(A	)	).values()
							for iteration in range(3	):
														# Gather the distributed inputs and targs for the base model
														lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.gather((ddp_input, ddp_target)	)
														lowerCAmelCase__       , lowerCAmelCase__	       =     input.to(accelerator.device	), target.to(accelerator.device	)
														# Perform our initial ground truth step in non "DDP"
														step_model(A			,   A			,   A			,   A	)
														# Do "gradient accumulation" (noop)
														if iteration % 2 == 0:
																					# Accumulate grads locally
																					with accelerator.no_sync(A	):
																												step_model(A			,   A			,   A			,   A	)
														else:
																					# Sync grads
																					step_model(A			,   A			,   A			,   A	)

														# Since `no_sync` is a noop, `ddp_model` and `model` grads should always be in sync
														check_model_parameters(A			,   A			,   A			,   A	)
														for param, ddp_param in zip(model.parameters()			,   ddp_model.parameters()	):
																					if not param.requires_grad:
																												continue
																					assert torch.allclose(
																					    param.grad			,   ddp_param.grad	), F"""Gradients not in sync when they should be:\nModel grad ({param.grad}) != DDP grad ({ddp_param.grad})"""

														# Shuffle ddp_input on each iteration
														torch.manual_seed(1337 + iteration	)
														lowerCAmelCase__	       =     ddp_input[torch.randperm(len(A	)	)]


def  _snake_case       (					A	)						->   int:
							# Test on distributed setup that context manager behaves properly
							lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__	       =     get_training_setup(A	)
							# Use a single batch
							lowerCAmelCase__       , lowerCAmelCase__	       =     next(iter(A	)	).values()
							for iteration in range(3	):
														# Gather the distributed inputs and targs for the base model
														lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.gather((ddp_input, ddp_target)	)
														lowerCAmelCase__       , lowerCAmelCase__	       =     input.to(accelerator.device	), target.to(accelerator.device	)
														# Perform our initial ground truth step in non "DDP"
														step_model(A			,   A			,   A			,   A	)
														# Do "gradient accumulation" (noop)
														if iteration % 2 == 0:
																					# Accumulate grads locally
																					with accelerator.no_sync(A	):
																												step_model(A			,   A			,   A			,   A	)
														else:
																					# Sync grads
																					step_model(A			,   A			,   A			,   A	)

														# DDP model and model should only be in sync when not (iteration % 2 == 0)
														for param, ddp_param in zip(model.parameters()			,   ddp_model.parameters()	):
																					if not param.requires_grad:
																												continue
																					if iteration % 2 == 0:
																												# Grads should not be in sync
																												assert (
																												    torch.allclose(param.grad			,   ddp_param.grad	) is False
																												), F"""Gradients in sync when they should not be:\nModel grad ({param.grad}) == DDP grad ({ddp_param.grad})"""
																					else:
																												# Grads should be in sync
																												assert (
																												    torch.allclose(param.grad			,   ddp_param.grad	) is True
																												), F"""Gradients not in sync when they should be:\nModel grad ({param.grad}) != DDP grad ({ddp_param.grad})"""

        # Shuffle ddp_input on each iteration
														torch.manual_seed(1337 + iteration	)
														lowerCAmelCase__	       =     ddp_input[torch.randperm(len(A	)	)]


def  _snake_case       (					A=False			,   A=False	)						->   Optional[Any]:
							lowerCAmelCase__	       =     Accelerator(
							    split_batches=A			,   dispatch_batches=A			,   gradient_accumulation_steps=2	)
							# Test that context manager behaves properly
							lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__	       =     get_training_setup(A	)
							for iteration, batch in enumerate(A	):
														lowerCAmelCase__       , lowerCAmelCase__	       =     batch.values()
														# Gather the distributed inputs and targs for the base model
														lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.gather((ddp_input, ddp_target)	)
														lowerCAmelCase__       , lowerCAmelCase__	       =     input.to(accelerator.device	), target.to(accelerator.device	)
														# Perform our initial ground truth step in non "DDP"
														step_model(A			,   A			,   A			,   A			,   A	)
														# Do "gradient accumulation" (noop)
														with accelerator.accumulate(A	):
																					step_model(A			,   A			,   A			,   A	)

														# DDP model and model should only be in sync when not (iteration % 2 == 0)
														for param, ddp_param in zip(model.parameters()			,   ddp_model.parameters()	):
																					if not param.requires_grad:
																												continue
																					if ((iteration + 1) % 2 == 0) or (iteration == len(A	) - 1):
																												# Grads should be in sync
																												assert (
																												    torch.allclose(param.grad			,   ddp_param.grad	) is True
																												), F"""Gradients not in sync when they should be at iteration {iteration}:\nModel grad ({param.grad}) != DDP grad ({ddp_param.grad})"""
																					else:
																												# Grads should not be in sync
																												assert (
																												    torch.allclose(param.grad			,   ddp_param.grad	) is False
																												), F"""Gradients in sync when they should not be at iteration {iteration}:\nModel grad ({param.grad}) == DDP grad ({ddp_param.grad})"""

        # Shuffle ddp_input on each iteration
														torch.manual_seed(1337 + iteration	)
														lowerCAmelCase__	       =     ddp_input[torch.randperm(len(A	)	)]
							GradientState._reset_state()


def  _snake_case       (					A=False			,   A=False	)						->   List[str]:
							lowerCAmelCase__	       =     Accelerator(
							    split_batches=A			,   dispatch_batches=A			,   gradient_accumulation_steps=2	)
							# Test that context manager behaves properly
							lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__       , lowerCAmelCase__	       =     get_training_setup(A			,   A	)
							for iteration, batch in enumerate(A	):
														lowerCAmelCase__       , lowerCAmelCase__	       =     batch.values()
														# Gather the distributed inputs and targs for the base model
														lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.gather((ddp_input, ddp_target)	)
														lowerCAmelCase__       , lowerCAmelCase__	       =     input.to(accelerator.device	), target.to(accelerator.device	)
														# Perform our initial ground truth step in non "DDP"
														model.train()
														ddp_model.train()
														step_model(A			,   A			,   A			,   A			,   A	)
														opt.step()

														if ((iteration + 1) % 2 == 0) or ((iteration + 1) == len(A	)):
																					if split_batches:
																												sched.step()
																					else:
																												for _ in range(accelerator.num_processes	):
																																			sched.step()
														opt.zero_grad()
														# Perform gradient accumulation under wrapper
														with accelerator.accumulate(A	):
																					step_model(A			,   A			,   A			,   A	)
																					ddp_opt.step()
																					ddp_sched.step()
																					ddp_opt.zero_grad()

														# Learning rates should be the same
														assert (
														    opt.param_groups[0]["lr"] == ddp_opt.param_groups[0]["lr"]
														), F"""Learning rates found in each optimizer did not align\nopt: {opt.param_groups[0]["lr"]}\nDDP opt: {ddp_opt.param_groups[0]["lr"]}\n"""
														lowerCAmelCase__	       =     (((iteration + 1) % 2) == 0) or ((iteration + 1) == len(A	))
														if accelerator.num_processes > 1:
																					check_model_parameters(A			,   A			,   A			,   A	)
														# Shuffle ddp_input on each iteration
														torch.manual_seed(1337 + iteration	)
							GradientState._reset_state()


def  _snake_case       (					)						->   List[str]:
							lowerCAmelCase__	       =     Accelerator()

							lowerCAmelCase__	       =     RegressionDataset(length=80	)
							lowerCAmelCase__	       =     DataLoader(A			,   batch_size=16	)
							lowerCAmelCase__	       =     RegressionDataset(length=96	)
							lowerCAmelCase__	       =     DataLoader(A			,   batch_size=16	)
							lowerCAmelCase__       , lowerCAmelCase__	       =     accelerator.prepare(A			,   A	)
							assert accelerator.gradient_state.active_dataloader is None
							for iteration, _ in enumerate(A	):
														assert id(accelerator.gradient_state.active_dataloader	) == id(A	)
														if iteration < len(A	) - 1:
																					assert not accelerator.gradient_state.end_of_dataloader
																					if iteration == 1:
																												for batch_num, _ in enumerate(A	):
																																			assert id(accelerator.gradient_state.active_dataloader	) == id(A	)
																																			if batch_num < len(A	) - 1:
																																										assert not accelerator.gradient_state.end_of_dataloader
																																			else:
																																										assert accelerator.gradient_state.end_of_dataloader
														else:
																					assert accelerator.gradient_state.end_of_dataloader
							assert accelerator.gradient_state.active_dataloader is None


def  _snake_case       (					)						->   List[Any]:
							lowerCAmelCase__	       =     Accelerator()
							lowerCAmelCase__	       =     accelerator.state
							if state.local_process_index == 0:
														print('''**Test `accumulate` gradient accumulation with dataloader break**'''	)
							test_dataloader_break()
							if state.distributed_type == DistributedType.NO:
														if state.local_process_index == 0:
																					print('''**Test NOOP `no_sync` context manager**'''	)
														test_noop_sync(A	)
							if state.distributed_type in (DistributedType.MULTI_GPU, DistributedType.MULTI_CPU):
														if state.local_process_index == 0:
																					print('''**Test Distributed `no_sync` context manager**'''	)
														test_distributed_sync(A	)
							if state.distributed_type == DistributedType.MULTI_GPU:
														for split_batch in [True, False]:
																					for dispatch_batches in [True, False]:
																												if state.local_process_index == 0:
																																			print(
																																			    '''**Test `accumulate` gradient accumulation, '''			,   F"""`split_batches={split_batch}` and `dispatch_batches={dispatch_batches}`**"""			,   )
																												test_gradient_accumulation(A			,   A	)

    # Currently will break on torch 2.0 +, need to investigate why
							if is_torch_version('''<'''			,   '''2.0'''	) or state.distributed_type == DistributedType.NO:
														if state.local_process_index == 0:
																					print(
																					    '''**Test `accumulate` gradient accumulation with optimizer and scheduler, '''			,   '''`split_batches=False`, `dispatch_batches=False`**'''			,   )
														test_gradient_accumulation_with_opt_and_scheduler()
														if state.distributed_type == DistributedType.MULTI_GPU:
																					for split_batch in [True, False]:
																												for dispatch_batches in [True, False]:
																																			if not split_batch and not dispatch_batches:
																																										continue
																																			if state.local_process_index == 0:
																																										print(
																																										    '''**Test `accumulate` gradient accumulation with optimizer and scheduler, '''			,   F"""`split_batches={split_batch}` and `dispatch_batches={dispatch_batches}`**"""			,   )
																																			test_gradient_accumulation_with_opt_and_scheduler(A			,   A	)


def  _snake_case       (					A	)						->   Union[str, Any]:
							# For xla_spawn (TPUs)
							main()


if __name__ == "__main__":
		main()



'''simple docstring'''






import argparse
import json
import os
import re

import torch

from transformers import BloomConfig, BloomModel
from transformers.file_utils import CONFIG_NAME, WEIGHTS_NAME
from transformers.utils import logging


logging.set_verbosity_info()

__UpperCAmelCase       =							[
    '''word_embeddings_layernorm.weight''',
    '''word_embeddings_layernorm.bias''',
    '''input_layernorm.weight''',
    '''input_layernorm.bias''',
    '''post_attention_layernorm.weight''',
    '''post_attention_layernorm.bias''',
    '''self_attention.dense.bias''',
    '''mlp.dense_4h_to_h.bias''',
    '''ln_f.weight''',
    '''ln_f.bias''',
]

__UpperCAmelCase       =							[
    '''mlp.dense_4h_to_h.weight''',
    '''self_attention.dense.weight''',
]


def  _snake_case       (					A			,   A	)						->   Optional[Any]:
							lowerCAmelCase__	       =     {
							    '''word_embeddings.weight''': '''word_embeddings.weight''',
							    '''word_embeddings.norm.weight''': '''word_embeddings_layernorm.weight''',
							    '''word_embeddings.norm.bias''': '''word_embeddings_layernorm.bias''',
							    '''weight''': '''ln_f.weight''',
							    '''bias''': '''ln_f.bias''',
							}

							if key in layer_rename_map:
														return layer_rename_map[key]

							# Handle transformer blocks
							lowerCAmelCase__	       =     int(re.match(R'''.*layer_(\d*).*'''			,   A	)[1]	)
							layer_number -= 3
							return F"""h.{layer_number}.""" + key


def  _snake_case       (					A	)						->   Optional[int]:
							if dtype == torch.bool:
														return 1 / 8
							lowerCAmelCase__	       =     re.search(R'''[^\d](\d+)$'''			,   str(A	)	)
							if bit_search is None:
														raise ValueError(F"""`dtype` is not a valid dtype: {dtype}."""	)
							lowerCAmelCase__	       =     int(bit_search.groups()[0]	)
							return bit_size // 8


def  _snake_case       (					A			,   A			,   A			,   A			,   A	)						->   Dict:
							# Construct model
							if bloom_config_file == "":
														lowerCAmelCase__	       =     BloomConfig()
							else:
														lowerCAmelCase__	       =     BloomConfig.from_json_file(A	)

							if shard_model:
														lowerCAmelCase__	       =     os.listdir(A	)
														lowerCAmelCase__	       =     sorted(filter(lambda A	: s.startswith('''layer'''	) and "model_00" in s			,   A	)	)

														lowerCAmelCase__	       =     {'''weight_map''': {}, '''metadata''': {}}
														lowerCAmelCase__	       =     0

														lowerCAmelCase__	       =     None

														lowerCAmelCase__	       =     BloomConfig()

														for j, file in enumerate(A	):
																					print('''Processing file: {}'''.format(A	)	)
																					lowerCAmelCase__	       =     None

																					for i in range(A	):
																												# load all TP files
																												lowerCAmelCase__	       =     file.replace('''model_00'''			,   F"""model_0{i}"""	)
																												lowerCAmelCase__	       =     torch.load(os.path.join(A			,   A	)			,   map_location='''cpu'''	)

																												# Rename keys in the transformers names
																												lowerCAmelCase__	       =     list(temp.keys()	)
																												for key in keys:
																																			lowerCAmelCase__	       =     temp.pop(A	)

																												if tensors is None:
																																			lowerCAmelCase__	       =     temp
																												else:
																																			for key in tensors.keys():
																																										if any(key.endswith(A	) for end in WEIGHTS_TO_AVERAGE_ENDSWITH	):
																																																	# We average (sum and then divide) some weights accross TP ranks (see https://github.com/bigscience-workshop/Megatron-DeepSpeed/blob/olruwase/sync_layer_norms/megatron/training.py#L425)
																																																	tensors[key] += temp[key]
																																										else:
																																																	# Some weights are RowParallelLinear in Megatron-Deepspeed, others are ColumnParallel
																																																	lowerCAmelCase__	       =     1 if any(text in key for text in WEIGHTS_WITH_ROW_PARALLELISM_CONTAIN	) else 0
																																																	# We concatenate these weights accross TP ranks
																																																	lowerCAmelCase__	       =     torch.cat([tensors[key], temp[key]]			,   dim=A	)

            # Divide by the number of TP the weights we want to average
																					for key in tensors.keys():
																												if any(key.endswith(A	) for end in WEIGHTS_TO_AVERAGE_ENDSWITH	):
																																			lowerCAmelCase__	       =     tensors[key] / pretraining_tp
																					torch.save(
																					    A			,   os.path.join(
																					        A			,   '''pytorch_model_{}-of-{}.bin'''.format(str(j + 1	).zfill(5	)			,   str(len(A	)	).zfill(5	)	)			,   )			,   )

																					for key in tensors.keys():
																												lowerCAmelCase__	       =     tensors[key]
																												total_size += value.numel() * get_dtype_size(value.dtype	)
																												if key not in index_dict["weight_map"]:
																																			lowerCAmelCase__	       =     '''pytorch_model_{}-of-{}.bin'''.format(
																																			    str(j + 1	).zfill(5	)			,   str(len(A	)	).zfill(5	)	)

														lowerCAmelCase__	       =     BloomConfig()
														lowerCAmelCase__	       =     pytorch_dump_folder_path + '''/''' + CONFIG_NAME
														lowerCAmelCase__	       =     total_size
														with open(A			,   '''w'''			,   encoding='''utf-8'''	) as f:
																					f.write(config.to_json_string()	)
														with open(os.path.join(A			,   WEIGHTS_NAME + '''.index.json'''	)			,   '''w'''			,   encoding='''utf-8'''	) as f:
																					lowerCAmelCase__	       =     json.dumps(A			,   indent=2			,   sort_keys=A	) + '''\n'''
																					f.write(A	)
							else:
														lowerCAmelCase__	       =     BloomModel(A	)

														lowerCAmelCase__	       =     os.listdir(A	)
														lowerCAmelCase__	       =     sorted(filter(lambda A	: s.startswith('''layer'''	) and "model_00" in s			,   A	)	)

														lowerCAmelCase__	       =     None
														for i, file in enumerate(A	):
																					lowerCAmelCase__	       =     None
																					for i in range(A	):
																												# load all TP files
																												lowerCAmelCase__	       =     file.replace('''model_00'''			,   F"""model_0{i}"""	)
																												lowerCAmelCase__	       =     torch.load(os.path.join(A			,   A	)			,   map_location='''cpu'''	)

																												# Rename keys in the transformers names
																												lowerCAmelCase__	       =     list(temp.keys()	)
																												for key in keys:
																																			lowerCAmelCase__	       =     temp.pop(A	)

																												if tensors is None:
																																			lowerCAmelCase__	       =     temp
																												else:
																																			for key in tensors.keys():
																																										# We average (sum and then divide) some weights accross TP ranks (see https://github.com/bigscience-workshop/Megatron-DeepSpeed/blob/olruwase/sync_layer_norms/megatron/training.py#L425)
																																										if any(key.endswith(A	) for end in WEIGHTS_TO_AVERAGE_ENDSWITH	):
																																																	tensors[key] += temp[key]
																																										else:
																																																	# Some weights are RowParallelLinear in Megatron-Deepspeed, others are ColumnParallel
																																																	lowerCAmelCase__	       =     1 if any(text in key for text in WEIGHTS_WITH_ROW_PARALLELISM_CONTAIN	) else 0
																																																	# We concatenate these weights accross TP ranks
																																																	lowerCAmelCase__	       =     torch.cat([tensors[key], temp[key]]			,   dim=A	)

            # Divide by the number of TP the weights we want to average
																					for key in tensors.keys():
																												if any(key.endswith(A	) for end in WEIGHTS_TO_AVERAGE_ENDSWITH	):
																																			lowerCAmelCase__	       =     tensors[key] / pretraining_tp

																					lowerCAmelCase__	       =     model.load_state_dict(A			,   strict=A	)
																					assert not other_keys.unexpected_keys, F"""The keys {other_keys.unexpected_keys} are unexpected"""
																					if missing_keys is None:
																												lowerCAmelCase__	       =     set(other_keys.missing_keys	)
																					else:
																												lowerCAmelCase__	       =     missing_keys.intersection(set(other_keys.missing_keys	)	)

														assert not missing_keys, F"""The keys {missing_keys} are missing"""

														# Save pytorch-model
														os.makedirs(A			,   exist_ok=A	)
														lowerCAmelCase__	       =     pytorch_dump_folder_path + '''/''' + WEIGHTS_NAME
														lowerCAmelCase__	       =     pytorch_dump_folder_path + '''/''' + CONFIG_NAME
														print(F"""Save PyTorch model to {pytorch_weights_dump_path} with dtype {config.torch_dtype}"""	)
														if config.torch_dtype is not None:
																					lowerCAmelCase__	       =     model.to(config.torch_dtype	)
														torch.save(model.state_dict()			,   A	)
														print(F"""Save configuration file to {pytorch_config_dump_path}"""	)
														with open(A			,   '''w'''			,   encoding='''utf-8'''	) as f:
																					f.write(config.to_json_string()	)


if __name__ == "__main__":
		__UpperCAmelCase       =							argparse.ArgumentParser()
		# Required parameters
		parser.add_argument(
		    '''--bloom_checkpoint_path''',
		    default=None,
		    type=str,
		    required=True,
		    help='''Path to the Megatron-LM checkpoint path.''',
		)
		parser.add_argument(
		    '''--pytorch_dump_folder_path''', default=None, type=str, required=True, help='''Path to the output PyTorch model.'''
		)
		parser.add_argument(
		    '''--bloom_config_file''',
		    default='''''',
		    type=str,
		    help=(
		        '''An optional config json file corresponding to the pre-trained model. \n'''
		        '''This specifies the model architecture.'''
		    ),
		)
		parser.add_argument(
		    '''--shard_model''',
		    action='''store_true''',
		    help='''An optional setting to shard the output model \nThis enables sharding the converted checkpoint''',
		)
		parser.add_argument(
		    '''--pretraining_tp''',
		    default=4,
		    type=int,
		    help='''Pretraining TP rank that has been used when training the model in Megatron-LM \n''',
		)
		__UpperCAmelCase       =							parser.parse_args()
		convert_bloom_checkpoint_to_pytorch(
		    args.bloom_checkpoint_path,
		    args.bloom_config_file,
		    args.pytorch_dump_folder_path,
		    args.shard_model,
		    args.pretraining_tp,
		)