How to use the ramp-engine.ramp_engine.aws.api.download_mprof_data function in ramp-engine

To help you get started, we’ve selected a few ramp-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paris-saclay-cds / ramp-board / ramp-engine / ramp_engine / aws / aws_train.py View on Github external
launch_train(conf_aws, instance_id, submission_id)
    set_submission_state(config, submission_id, 'training')
    _run_hook(config, HOOK_START_TRAINING, submission_id)
    _wait_until_train_finished(conf_aws, instance_id, submission_id)
    download_log(conf_aws, instance_id, submission_id)

    label = _get_submission_label_by_id(config, submission_id)
    submission = get_submission_by_id(config, submission_id)
    actual_nb_folds = get_event_nb_folds(config, submission.event.name)
    if _training_successful(conf_aws, instance_id, submission_id,
                            actual_nb_folds):
        logger.info('Training of "{}" was successful'.format(
            label, instance_id))
        if conf_aws[MEMORY_PROFILING_FIELD]:
            logger.info('Download max ram usage info of "{}"'.format(label))
            download_mprof_data(conf_aws, instance_id, submission_id)
            max_ram = _get_submission_max_ram(conf_aws, submission_id)
            logger.info('Max ram usage of "{}": {}MB'.format(label, max_ram))
            set_submission_max_ram(config, submission_id, max_ram)

        logger.info('Downloading predictions of : "{}"'.format(label))
        predictions_folder_path = download_predictions(
            conf_aws, instance_id, submission_id)
        set_predictions(config, submission_id, predictions_folder_path)
        set_time(config, submission_id, predictions_folder_path)
        set_scores(config, submission_id, predictions_folder_path)
        set_submission_state(config, submission_id, 'tested')
        logger.info('Scoring "{}"'.format(label))
        score_submission(config, submission_id)
        _run_hook(config, HOOK_SUCCESSFUL_TRAINING, submission_id)
    else:
        logger.info('Training of "{}" in "{}" failed'.format(
github paris-saclay-cds / ramp-board / ramp-engine / ramp_engine / aws / aws_train.py View on Github external
'if successful or not...'.format(label))
                    submission = get_submission_by_id(config, submission_id)
                    actual_nb_folds = get_event_nb_folds(
                        config, submission.event.name
                    )
                    if _training_successful(
                            conf_aws,
                            instance_id,
                            submission_name,
                            actual_nb_folds):
                        logger.info('Training of "{}" was successful'
                                    .format(label))
                        if conf_aws.get(MEMORY_PROFILING_FIELD):
                            logger.info('Download max ram usage info of "{}"'
                                        .format(label))
                            download_mprof_data(
                                conf_aws, instance_id, submission_name
                            )
                            max_ram = _get_submission_max_ram(
                                conf_aws, submission_name
                            )
                            logger.info('Max ram usage of "{}": {}MB'
                                        .format(label, max_ram))
                            set_submission_max_ram(
                                config, submission_id, max_ram
                            )

                        logger.info('Downloading the predictions of "{}"'
                                    .format(label))
                        path = download_predictions(
                            conf_aws, instance_id, submission_name)
                        set_predictions(config, submission_id, path)