def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Batch Transformation Job') _utils.add_default_client_arguments(parser) parser.add_argument('--job_name', type=str, required=False, help='The name of the transform job.', default='') parser.add_argument('--model_name', type=str, required=True, help='The name of the model that you want to use for the transform job.') parser.add_argument('--max_concurrent', type=int, required=False, help='The maximum number of parallel requests that can be sent to each instance in a transform job.', default='0') parser.add_argument('--max_payload', type=int, required=False, help='The maximum allowed size of the payload, in MB.', default='6') parser.add_argument('--batch_strategy', choices=['MultiRecord', 'SingleRecord', ''], type=str, required=False, help='The number of records to include in a mini-batch for an HTTP inference request.', default='') parser.add_argument('--environment', type=_utils.yaml_or_json_str, required=False, help='The dictionary of the environment variables to set in the Docker container. Up to 16 key-value entries in the map.', default={}) parser.add_argument('--input_location', type=str, required=True, help='The S3 location of the data source that is associated with a channel.') parser.add_argument('--data_type', choices=['ManifestFile', 'S3Prefix', 'AugmentedManifestFile', ''], type=str, required=False, help='Data type of the input. Can be ManifestFile, S3Prefix, or AugmentedManifestFile.', default='S3Prefix') parser.add_argument('--content_type', type=str, required=False, help='The multipurpose internet mail extension (MIME) type of the data.', default='') parser.add_argument('--split_type', choices=['None', 'Line', 'RecordIO', 'TFRecord', ''], type=str, required=False, help='The method to use to split the transform job data files into smaller batches.', default='None') parser.add_argument('--compression_type', choices=['None', 'Gzip', ''], type=str, required=False, help='If the transform data is compressed, the specification of the compression type.', default='None') parser.add_argument('--output_location', type=str, required=True, help='The Amazon S3 path where you want Amazon SageMaker to store the results of the transform job.') parser.add_argument('--accept', type=str, required=False, help='The MIME type used to specify the output data.') parser.add_argument('--assemble_with', choices=['None', 'Line', ''], type=str, required=False, help='Defines how to assemble the results of the transform job as a single S3 object. Either None or Line.') parser.add_argument('--output_encryption_key', type=str, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt the model artifacts.', default='') parser.add_argument('--input_filter', type=str, required=False, help='A JSONPath expression used to select a portion of the input data to pass to the algorithm.', default='') parser.add_argument('--output_filter', type=str, required=False, help='A JSONPath expression used to select a portion of the joined dataset to save in the output file for a batch transform job.', default='') parser.add_argument('--join_source', choices=['None', 'Input', ''], type=str, required=False, help='Specifies the source of the data to join with the transformed data.', default='None') parser.add_argument('--instance_type', type=str, required=False, help='The ML compute instance type for the transform job.', default='ml.m4.xlarge') parser.add_argument('--instance_count', type=int, required=False, help='The number of ML compute instances to use in the transform job.') parser.add_argument('--resource_encryption_key', type=str, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument('--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument('--output_location_file', type=str, required=True, help='File path where the program will write the Amazon S3 URI of the transform job results.') return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Training Job') _utils.add_default_client_arguments(parser) parser.add_argument('--job_name', type=str, required=False, help='The name of the training job.', default='') parser.add_argument('--role', type=str, required=True, help='The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks on your behalf.') parser.add_argument('--image', type=str, required=False, help='The registry path of the Docker image that contains the training algorithm.', default='') parser.add_argument('--algorithm_name', type=str, required=False, help='The name of the resource algorithm to use for the training job.', default='') parser.add_argument('--metric_definitions', type=_utils.yaml_or_json_str, required=False, help='The dictionary of name-regex pairs specify the metrics that the algorithm emits.', default={}) parser.add_argument('--training_input_mode', choices=['File', 'Pipe'], type=str, help='The input mode that the algorithm supports. File or Pipe.', default='File') parser.add_argument('--hyperparameters', type=_utils.yaml_or_json_str, help='Dictionary of hyperparameters for the the algorithm.', default={}) parser.add_argument('--channels', type=_utils.yaml_or_json_str, required=True, help='A list of dicts specifying the input channels. Must have at least one.') parser.add_argument('--instance_type', required=True, choices=['ml.m4.xlarge', 'ml.m4.2xlarge', 'ml.m4.4xlarge', 'ml.m4.10xlarge', 'ml.m4.16xlarge', 'ml.m5.large', 'ml.m5.xlarge', 'ml.m5.2xlarge', 'ml.m5.4xlarge', 'ml.m5.12xlarge', 'ml.m5.24xlarge', 'ml.c4.xlarge', 'ml.c4.2xlarge', 'ml.c4.4xlarge', 'ml.c4.8xlarge', 'ml.p2.xlarge', 'ml.p2.8xlarge', 'ml.p2.16xlarge', 'ml.p3.2xlarge', 'ml.p3.8xlarge', 'ml.p3.16xlarge', 'ml.c5.xlarge', 'ml.c5.2xlarge', 'ml.c5.4xlarge', 'ml.c5.9xlarge', 'ml.c5.18xlarge'], type=str, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument('--instance_count', required=True, type=int, help='The registry path of the Docker image that contains the training algorithm.', default=1) parser.add_argument('--volume_size', type=int, required=True, help='The size of the ML storage volume that you want to provision.', default=1) parser.add_argument('--resource_encryption_key', type=str, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument('--max_run_time', type=int, required=True, help='The maximum run time in seconds for the training job.', default=86400) parser.add_argument('--model_artifact_path', type=str, required=True, help='Identifies the S3 path where you want Amazon SageMaker to store the model artifacts.') parser.add_argument('--output_encryption_key', type=str, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt the model artifacts.', default='') parser.add_argument('--vpc_security_group_ids', type=str, required=False, help='The VPC security group IDs, in the form sg-xxxxxxxx.') parser.add_argument('--vpc_subnets', type=str, required=False, help='The ID of the subnets in the VPC to which you want to connect your hpo job.') parser.add_argument('--network_isolation', type=_utils.str_to_bool, required=False, help='Isolates the training container.', default=True) parser.add_argument('--traffic_encryption', type=_utils.str_to_bool, required=False, help='Encrypts all communications between ML compute instances in distributed training.', default=False) ### Start spot instance support parser.add_argument('--spot_instance', type=_utils.str_to_bool, required=False, help='Use managed spot training.', default=False) parser.add_argument('--max_wait_time', type=int, required=False, help='The maximum time in seconds you are willing to wait for a managed spot training job to complete.', default=86400) parser.add_argument('--checkpoint_config', type=_utils.yaml_or_json_str, required=False, help='Dictionary of information about the output location for managed spot training checkpoint data.', default={}) ### End spot instance support parser.add_argument('--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Training Job') _utils.add_default_client_arguments(parser) parser.add_argument('--endpoint_config_name', type=str, required=False, help='The name of the endpoint configuration. If an existing endpoint is being updated, a suffix is automatically added if this config name exists.', default='') parser.add_argument('--variant_name_1', type=str, required=False, help='The name of the production variant.', default='variant-name-1') parser.add_argument('--model_name_1', type=str, required=True, help='The model name used for endpoint deployment.') parser.add_argument('--initial_instance_count_1', type=int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument('--instance_type_1', type=str, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument('--initial_variant_weight_1', type=float, required=False, help='Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument('--accelerator_type_1', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str, required=False, help='The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument('--variant_name_2', type=str, required=False, help='The name of the production variant.', default='variant-name-2') parser.add_argument('--model_name_2', type=str, required=False, help='The model name used for endpoint deployment.', default='') parser.add_argument('--initial_instance_count_2', type=int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument('--instance_type_2', type=str, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument('--initial_variant_weight_2', type=float, required=False, help='Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument('--accelerator_type_2', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str, required=False, help='The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument('--variant_name_3', type=str, required=False, help='The name of the production variant.', default='variant-name-3') parser.add_argument('--model_name_3', type=str, required=False, help='The model name used for endpoint deployment.', default='') parser.add_argument('--initial_instance_count_3', type=int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument('--instance_type_3', type=str, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument('--initial_variant_weight_3', type=float, required=False, help='Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument('--accelerator_type_3', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str, required=False, help='The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument('--resource_encryption_key', type=str, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument('--endpoint_config_tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument('--endpoint_name', type=str, required=False, help='The name of the endpoint.', default='') parser.add_argument('--endpoint_tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument('--update_endpoint', type=_utils.str_to_bool, required=False, help='If True, update endpoint if it exists else creates one', default=False) parser.add_argument('--endpoint_name_output_path', type=str, default='/tmp/endpoint-name', help='Local output path for the file containing the name of the created endpoint.') return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Ground Truth Job') _utils.add_default_client_arguments(parser) parser.add_argument('--role', type=str.strip, required=True, help='The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks on your behalf.') parser.add_argument('--job_name', type=str.strip, required=True, help='The name of the labeling job.') parser.add_argument('--label_attribute_name', type=str.strip, required=False, help='The attribute name to use for the label in the output manifest file. Default is the job name.', default='') parser.add_argument('--manifest_location', type=str.strip, required=True, help='The Amazon S3 location of the manifest file that describes the input data objects.') parser.add_argument('--output_location', type=str.strip, required=True, help='The Amazon S3 location to write output data.') parser.add_argument('--output_encryption_key', type=str.strip, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt the model artifacts.', default='') parser.add_argument('--task_type', type=str.strip, required=True, help='Built in image classification, bounding box, text classification, or semantic segmentation, or custom. If custom, please provide pre- and post-labeling task lambda functions.') parser.add_argument('--worker_type', type=str.strip, required=True, help='The workteam for data labeling, either public, private, or vendor.') parser.add_argument('--workteam_arn', type=str.strip, required=False, help='The ARN of the work team assigned to complete the tasks.') parser.add_argument('--no_adult_content', type=_utils.str_to_bool, required=False, help='If true, your data is free of adult content.', default='False') parser.add_argument('--no_ppi', type=_utils.str_to_bool, required=False, help='If true, your data is free of personally identifiable information.', default='False') parser.add_argument('--label_category_config', type=str.strip, required=False, help='The S3 URL of the JSON structured file that defines the categories used to label the data objects.', default='') parser.add_argument('--max_human_labeled_objects', type=_utils.str_to_int, required=False, help='The maximum number of objects that can be labeled by human workers.', default=0) parser.add_argument('--max_percent_objects', type=_utils.str_to_int, required=False, help='The maximum percentatge of input data objects that should be labeled.', default=0) parser.add_argument('--enable_auto_labeling', type=_utils.str_to_bool, required=False, help='Enables auto-labeling, only for bounding box, text classification, and image classification.', default=False) parser.add_argument('--initial_model_arn', type=str.strip, required=False, help='The ARN of the final model used for a previous auto-labeling job.', default='') parser.add_argument('--resource_encryption_key', type=str.strip, required=False, help='The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument('--ui_template', type=str.strip, required=True, help='The Amazon S3 bucket location of the UI template.') parser.add_argument('--pre_human_task_function', type=str.strip, required=False, help='The ARN of a Lambda function that is run before a data object is sent to a human worker.', default='') parser.add_argument('--post_human_task_function', type=str.strip, required=False, help='The ARN of a Lambda function implements the logic for annotation consolidation.', default='') parser.add_argument('--task_keywords', type=str.strip, required=False, help='Keywords used to describe the task so that workers on Amazon Mechanical Turk can discover the task.', default='') parser.add_argument('--title', type=str.strip, required=True, help='A title for the task for your human workers.') parser.add_argument('--description', type=str.strip, required=True, help='A description of the task for your human workers.') parser.add_argument('--num_workers_per_object', type=_utils.str_to_int, required=True, help='The number of human workers that will label an object.') parser.add_argument('--time_limit', type=_utils.str_to_int, required=True, help='The amount of time that a worker has to complete a task in seconds') parser.add_argument('--task_availibility', type=_utils.str_to_int, required=False, help='The length of time that a task remains available for labelling by human workers.', default=0) parser.add_argument('--max_concurrent_tasks', type=_utils.str_to_int, required=False, help='The maximum number of data objects that can be labeled by human workers at the same time.', default=0) parser.add_argument('--workforce_task_price', type=_utils.str_to_float, required=False, help='The price that you pay for each task performed by a public worker in USD. Specify to the tenth fractions of a cent. Format as "0.000".', default=0.000) parser.add_argument('--tags', type=_utils.str_to_json_dict, required=False, help='An array of key-value pairs, to categorize AWS resources.', default='{}') return parser
def create_parser(): parser = argparse.ArgumentParser( description='SageMaker Hyperparameter Tuning Job') _utils.add_default_client_arguments(parser) parser.add_argument('--team_name', type=str, required=True, help='The name of your work team.') parser.add_argument('--description', type=str, required=True, help='A description of the work team.') parser.add_argument( '--user_pool', type=str, required=False, help= 'An identifier for a user pool. The user pool must be in the same region as the service that you are calling.', default='') parser.add_argument( '--user_groups', type=str, required=False, help='A list of identifiers for user groups separated by commas.', default='') parser.add_argument( '--client_id', type=str, required=False, help= 'An identifier for an application client. You must create the app client ID using Amazon Cognito.', default='') parser.add_argument( '--sns_topic', type=str, required=False, help= 'The ARN for the SNS topic to which notifications should be published.', default='') parser.add_argument( '--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument( '--workteam_arn_output_path', type=str, default='/tmp/workteam-arn', help= 'Local output path for the file containing the ARN of the workteam.') return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Training Job') _utils.add_default_client_arguments(parser) parser.add_argument('--model_name', type=str, required=True, help='The name of the new model.') parser.add_argument('--role', type=str, required=True, help='The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks on your behalf.') parser.add_argument('--container_host_name', type=str, required=False, help='When a ContainerDefinition is part of an inference pipeline, this value uniquely identifies the container for the purposes of logging and metrics.', default='') parser.add_argument('--image', type=str, required=False, help='The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.', default='') parser.add_argument('--model_artifact_url', type=str, required=False, help='S3 path where Amazon SageMaker to store the model artifacts.', default='') parser.add_argument('--environment', type=_utils.yaml_or_json_str, required=False, help='The dictionary of the environment variables to set in the Docker container. Up to 16 key-value entries in the map.', default={}) parser.add_argument('--model_package', type=str, required=False, help='The name or Amazon Resource Name (ARN) of the model package to use to create the model.', default='') parser.add_argument('--secondary_containers', type=_utils.yaml_or_json_str, required=False, help='A list of dicts that specifies the additional containers in the inference pipeline.', default={}) parser.add_argument('--vpc_security_group_ids', type=str, required=False, help='The VPC security group IDs, in the form sg-xxxxxxxx.', default='') parser.add_argument('--vpc_subnets', type=str, required=False, help='The ID of the subnets in the VPC to which you want to connect your hpo job.', default='') parser.add_argument('--network_isolation', type=_utils.str_to_bool, required=False, help='Isolates the training container.', default=True) parser.add_argument('--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument('--model_name_output_path', type=str, default='/tmp/model-name', help='Local output path for the file containing the name of the model SageMaker created.') return parser
def create_parser(): parser = argparse.ArgumentParser( description='SageMaker Hyperparameter Tuning Job') _utils.add_default_client_arguments(parser) parser.add_argument( '--job_name', type=str, required=False, help= 'The name of the tuning job. Must be unique within the same AWS account and AWS region.' ) parser.add_argument( '--role', type=str, required=True, help= 'The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks on your behalf.' ) parser.add_argument( '--image', type=str, required=False, help= 'The registry path of the Docker image that contains the training algorithm.', default='') parser.add_argument( '--algorithm_name', type=str, required=False, help= 'The name of the resource algorithm to use for the hyperparameter tuning job.', default='') parser.add_argument( '--training_input_mode', choices=['File', 'Pipe'], type=str, required=False, help='The input mode that the algorithm supports. File or Pipe.', default='File') parser.add_argument( '--metric_definitions', type=_utils.yaml_or_json_str, required=False, help= 'The dictionary of name-regex pairs specify the metrics that the algorithm emits.', default={}) parser.add_argument( '--strategy', choices=['Bayesian', 'Random'], type=str, required=False, help= 'How hyperparameter tuning chooses the combinations of hyperparameter values to use for the training job it launches.', default='Bayesian') parser.add_argument( '--metric_name', type=str, required=True, help='The name of the metric to use for the objective metric.') parser.add_argument( '--metric_type', choices=['Maximize', 'Minimize'], type=str, required=True, help='Whether to minimize or maximize the objective metric.') parser.add_argument( '--early_stopping_type', choices=['Off', 'Auto'], type=str, required=False, help='Whether to minimize or maximize the objective metric.', default='Off') parser.add_argument( '--static_parameters', type=_utils.yaml_or_json_str, required=False, help= 'The values of hyperparameters that do not change for the tuning job.', default={}) parser.add_argument( '--integer_parameters', type=_utils.yaml_or_json_str, required=False, help= 'The array of IntegerParameterRange objects that specify ranges of integer hyperparameters that you want to search.', default=[]) parser.add_argument( '--continuous_parameters', type=_utils.yaml_or_json_str, required=False, help= 'The array of ContinuousParameterRange objects that specify ranges of continuous hyperparameters that you want to search.', default=[]) parser.add_argument( '--categorical_parameters', type=_utils.yaml_or_json_str, required=False, help= 'The array of CategoricalParameterRange objects that specify ranges of categorical hyperparameters that you want to search.', default=[]) parser.add_argument( '--channels', type=_utils.yaml_or_json_str, required=True, help= 'A list of dicts specifying the input channels. Must have at least one.' ) parser.add_argument( '--output_location', type=str, required=True, help= 'The Amazon S3 path where you want Amazon SageMaker to store the results of the transform job.' ) parser.add_argument( '--output_encryption_key', type=str, required=False, help= 'The AWS KMS key that Amazon SageMaker uses to encrypt the model artifacts.', default='') parser.add_argument('--instance_type', type=str, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument( '--instance_count', type=int, required=False, help='The number of ML compute instances to use in each training job.', default=1) parser.add_argument( '--volume_size', type=int, required=False, help='The size of the ML storage volume that you want to provision.', default=30) parser.add_argument( '--max_num_jobs', type=int, required=True, help= 'The maximum number of training jobs that a hyperparameter tuning job can launch.' ) parser.add_argument( '--max_parallel_jobs', type=int, required=True, help= 'The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.' ) parser.add_argument( '--max_run_time', type=int, required=False, help='The maximum run time in seconds per training job.', default=86400) parser.add_argument( '--resource_encryption_key', type=str, required=False, help= 'The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument( '--vpc_security_group_ids', type=str, required=False, help='The VPC security group IDs, in the form sg-xxxxxxxx.') parser.add_argument( '--vpc_subnets', type=str, required=False, help= 'The ID of the subnets in the VPC to which you want to connect your hpo job.' ) parser.add_argument('--network_isolation', type=_utils.str_to_bool, required=False, help='Isolates the training container.', default=True) parser.add_argument( '--traffic_encryption', type=_utils.str_to_bool, required=False, help= 'Encrypts all communications between ML compute instances in distributed training.', default=False) parser.add_argument( '--warm_start_type', choices=['IdenticalDataAndAlgorithm', 'TransferLearning', ''], type=str, required=False, help= 'Specifies either "IdenticalDataAndAlgorithm" or "TransferLearning"') parser.add_argument( '--parent_hpo_jobs', type=str, required=False, help= 'List of previously completed or stopped hyperparameter tuning jobs to be used as a starting point.', default='') ### Start spot instance support parser.add_argument('--spot_instance', type=_utils.str_to_bool, required=False, help='Use managed spot training.', default=False) parser.add_argument( '--max_wait_time', type=int, required=False, help= 'The maximum time in seconds you are willing to wait for a managed spot training job to complete.', default=86400) parser.add_argument( '--checkpoint_config', type=_utils.yaml_or_json_str, required=False, help= 'Dictionary of information about the output location for managed spot training checkpoint data.', default={}) ### End spot instance support parser.add_argument( '--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Processing Job') _utils.add_default_client_arguments(parser) parser.add_argument('--job_name', type=str, required=False, help='The name of the processing job.', default='') parser.add_argument( '--role', type=str, required=True, help= 'The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks on your behalf.' ) parser.add_argument( '--image', type=str, required=True, help= 'The registry path of the Docker image that contains the processing container.', default='') parser.add_argument('--instance_type', required=True, type=str, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument( '--instance_count', required=True, type=int, help= 'The number of ML compute instances to use in each processing job.', default=1) parser.add_argument( '--volume_size', type=int, required=False, help='The size of the ML storage volume that you want to provision.', default=30) parser.add_argument( '--resource_encryption_key', type=str, required=False, help= 'The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument( '--output_encryption_key', type=str, required=False, help= 'The AWS KMS key that Amazon SageMaker uses to encrypt the processing artifacts.', default='') parser.add_argument( '--max_run_time', type=int, required=False, help='The maximum run time in seconds for the processing job.', default=86400) parser.add_argument( '--environment', type=_utils.yaml_or_json_str, required=False, help= 'The dictionary of the environment variables to set in the Docker container. Up to 16 key-value entries in the map.', default={}) parser.add_argument( '--container_entrypoint', type=_utils.yaml_or_json_str, required=False, help= 'The entrypoint for the processing job. This is in the form of a list of strings that make a command.', default=[]) parser.add_argument( '--container_arguments', type=_utils.yaml_or_json_str, required=False, help='A list of string arguments to be passed to a processing job.', default=[]) parser.add_argument( '--input_config', type=_utils.yaml_or_json_str, required=False, help='Parameters that specify Amazon S3 inputs for a processing job.', default=[]) parser.add_argument( '--output_config', type=_utils.yaml_or_json_str, required=True, help='Parameters that specify Amazon S3 outputs for a processing job.', default=[]) parser.add_argument( '--vpc_security_group_ids', type=str, required=False, help='The VPC security group IDs, in the form sg-xxxxxxxx.') parser.add_argument( '--vpc_subnets', type=str, required=False, help= 'The ID of the subnets in the VPC to which you want to connect your hpo job.' ) parser.add_argument('--network_isolation', type=_utils.str_to_bool, required=False, help='Isolates the processing container.', default=True) parser.add_argument( '--traffic_encryption', type=_utils.str_to_bool, required=False, help= 'Encrypts all communications between ML compute instances in distributed training.', default=False) parser.add_argument( '--tags', type=_utils.yaml_or_json_str, required=False, help='An array of key-value pairs, to categorize AWS resources.', default={}) parser.add_argument( '--job_name_output_path', type=str, default='/tmp/job-name', help= 'Local output path for the file containing the name of the processing job.' ) parser.add_argument( '--output_artifacts_output_path', type=str, default='/tmp/output-artifacts', help= 'Local output path for the file containing the dictionary describing the output S3 artifacts.' ) return parser
def create_parser(): parser = argparse.ArgumentParser(description='SageMaker Training Job') _utils.add_default_client_arguments(parser) parser.add_argument('--endpoint_config_name', type=str.strip, required=False, help='The name of the endpoint configuration.', default='') parser.add_argument('--variant_name_1', type=str.strip, required=False, help='The name of the production variant.', default='variant-name-1') parser.add_argument('--model_name_1', type=str.strip, required=True, help='The model name used for endpoint deployment.') parser.add_argument('--initial_instance_count_1', type=_utils.str_to_int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument( '--instance_type_1', choices=[ 'ml.m4.xlarge', 'ml.m4.2xlarge', 'ml.m4.4xlarge', 'ml.m4.10xlarge', 'ml.m4.16xlarge', 'ml.m5.large', 'ml.m5.xlarge', 'ml.m5.2xlarge', 'ml.m5.4xlarge', 'ml.m5.12xlarge', 'ml.m5.24xlarge', 'ml.c4.xlarge', 'ml.c4.2xlarge', 'ml.c4.4xlarge', 'ml.c4.8xlarge', 'ml.p2.xlarge', 'ml.p2.8xlarge', 'ml.p2.16xlarge', 'ml.p3.2xlarge', 'ml.p3.8xlarge', 'ml.p3.16xlarge', 'ml.c5.xlarge', 'ml.c5.2xlarge', 'ml.c5.4xlarge', 'ml.c5.9xlarge', 'ml.c5.18xlarge', '' ], type=str.strip, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument( '--initial_variant_weight_1', type=_utils.str_to_float, required=False, help= 'Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument( '--accelerator_type_1', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str.strip, required=False, help= 'The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument('--variant_name_2', type=str.strip, required=False, help='The name of the production variant.', default='variant-name-2') parser.add_argument('--model_name_2', type=str.strip, required=False, help='The model name used for endpoint deployment.', default='') parser.add_argument('--initial_instance_count_2', type=_utils.str_to_int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument( '--instance_type_2', choices=[ 'ml.m4.xlarge', 'ml.m4.2xlarge', 'ml.m4.4xlarge', 'ml.m4.10xlarge', 'ml.m4.16xlarge', 'ml.m5.large', 'ml.m5.xlarge', 'ml.m5.2xlarge', 'ml.m5.4xlarge', 'ml.m5.12xlarge', 'ml.m5.24xlarge', 'ml.c4.xlarge', 'ml.c4.2xlarge', 'ml.c4.4xlarge', 'ml.c4.8xlarge', 'ml.p2.xlarge', 'ml.p2.8xlarge', 'ml.p2.16xlarge', 'ml.p3.2xlarge', 'ml.p3.8xlarge', 'ml.p3.16xlarge', 'ml.c5.xlarge', 'ml.c5.2xlarge', 'ml.c5.4xlarge', 'ml.c5.9xlarge', 'ml.c5.18xlarge', '' ], type=str.strip, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument( '--initial_variant_weight_2', type=_utils.str_to_float, required=False, help= 'Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument( '--accelerator_type_2', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str.strip, required=False, help= 'The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument('--variant_name_3', type=str.strip, required=False, help='The name of the production variant.', default='variant-name-3') parser.add_argument('--model_name_3', type=str.strip, required=False, help='The model name used for endpoint deployment.', default='') parser.add_argument('--initial_instance_count_3', type=_utils.str_to_int, required=False, help='Number of instances to launch initially.', default=1) parser.add_argument( '--instance_type_3', choices=[ 'ml.m4.xlarge', 'ml.m4.2xlarge', 'ml.m4.4xlarge', 'ml.m4.10xlarge', 'ml.m4.16xlarge', 'ml.m5.large', 'ml.m5.xlarge', 'ml.m5.2xlarge', 'ml.m5.4xlarge', 'ml.m5.12xlarge', 'ml.m5.24xlarge', 'ml.c4.xlarge', 'ml.c4.2xlarge', 'ml.c4.4xlarge', 'ml.c4.8xlarge', 'ml.p2.xlarge', 'ml.p2.8xlarge', 'ml.p2.16xlarge', 'ml.p3.2xlarge', 'ml.p3.8xlarge', 'ml.p3.16xlarge', 'ml.c5.xlarge', 'ml.c5.2xlarge', 'ml.c5.4xlarge', 'ml.c5.9xlarge', 'ml.c5.18xlarge', '' ], type=str.strip, required=False, help='The ML compute instance type.', default='ml.m4.xlarge') parser.add_argument( '--initial_variant_weight_3', type=_utils.str_to_float, required=False, help= 'Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.', default=1.0) parser.add_argument( '--accelerator_type_3', choices=['ml.eia1.medium', 'ml.eia1.large', 'ml.eia1.xlarge', ''], type=str.strip, required=False, help= 'The size of the Elastic Inference (EI) instance to use for the production variant.', default='') parser.add_argument( '--resource_encryption_key', type=str.strip, required=False, help= 'The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance(s).', default='') parser.add_argument( '--endpoint_config_tags', type=_utils.str_to_json_dict, required=False, help='An array of key-value pairs, to categorize AWS resources.', default='{}') parser.add_argument('--endpoint_name', type=str.strip, required=False, help='The name of the endpoint.', default='') parser.add_argument( '--endpoint_tags', type=_utils.str_to_json_dict, required=False, help='An array of key-value pairs, to categorize AWS resources.', default='{}') return parser