def analyze_inputs(cell_visual_pair, library): integrity_result = check_input_integrity(cell_visual_pair) if not isinstance(integrity_result, list): failed = integrity_result return failed integrity_result = fix_version_all_case(integrity_result, library) integrity_result = check_for_compulsory_fields(integrity_result, library) if not isinstance(integrity_result, list): failed = integrity_result return failed inputs = integrity_result[0] extras = integrity_result[1] integrity_result = check_for_repetition(inputs) if not isinstance(integrity_result, list): failed = integrity_result return failed collection_ls = make_possible_collection_permutations(inputs, library) if not isinstance(collection_ls, list): failed = collection_ls return failed speedup_options = get_speedup_options(inputs) if not isinstance(speedup_options, list): failed = speedup_options return failed concat_df = model.get_concat_dataframe(collection_ls) if isinstance(concat_df, list): failed = construct_integrity_fail_message( concat_df[1] + ' is not a valid suite existing in database') return failed if concat_df.empty: failed = construct_integrity_fail_message( 'Nothing found for selection') return failed else: graph = get_graph(inputs) if not isinstance(graph, list): failed = graph return failed versions = get_rocm_versions(inputs) speedup_options = get_speedup_options(inputs) figure, table = visuals.make_graph_table(concat_df, "Performance Plot", graph[0], versions, speedup_options, library, extras=extras) gpu_servers = get_gpu_servers(inputs) gpu_server_specs = specs.get_specs(gpu_servers, versions) if len(speedup_options) > 1 or library.lower() == 'rocblas': return [figure, 'speedup', gpu_server_specs, table] else: return [figure, gpu_server_specs, table]
def get_what_to_save(cell_visual_pair, library): """Returns what we want to save in user browser browser session using the power of json and hiding div mechanism. This way we avoid using global variables. Customized for blas and rand as we use slider. We must save some data so that we don't query database for all slider point callbacks. """ inputs = analysis.check_input_integrity(cell_visual_pair) inputs = analysis.fix_version_all_case(inputs, library) inputs = analysis.check_for_compulsory_fields(inputs, library) inputts = inputs[0] extras = inputs[1] collection_ls = analysis.make_possible_collection_permutations(inputts, library) concat_df = model.get_concat_dataframe(collection_ls) df_json = concat_df.to_json(date_format='iso', orient='split') graph = analysis.get_graph(inputts) versions = analysis.get_rocm_versions(inputts) speedup_options = analysis.get_speedup_options(inputts) if library == 'rocblas': blas_return = [df_json, graph, versions, speedup_options] return blas_return return [df_json, extras]