KJA000 / llvm-clang-optimization

0 stars 0 forks source link

refactor #7

Closed KJA000 closed 9 months ago

KJA000 commented 10 months ago

Model_import_replace.py

import json import sys

dataProvider = r"DataProvider.json" from API_COSYM import COSYM_REST_APIs as apis from Make_DataProvider import DataProvider_file_maker from Make_DataProvider import start, end from StartEE import main as StartEE def replaceModel(FMU): try: apis.openProjectById() apis.replaceModel(FMU) except Exception as e: print(f"An error occurred: {e}")

def importModel(FMU): try: apis.openProjectById() apis.importModel(FMU) except Exception as e: print(f"An error occurred: {e}")

def main(action, FMU_name): with open(dataProvider, 'r') as json_file: data = json.load(json_file)

model_names = data['Models'][0]['model_names']
replace_names = [item for sublist in [replace_entry['model_names'] for replace_entry in data['Replace']] for item in sublist]
if action == "replace":
    if FMU_name not in model_names:
        print(f"{FMU_name} not found in model_names for replacement. Exiting.")
        return
    replaceModel(FMU_name)
elif action == "import":
    if FMU_name in model_names:
        print(f"{FMU_name} is already present in Models, so not importing.")
        return
    elif FMU_name not in replace_names:
        print(f"{FMU_name} not found in Replace section for import. Exiting.")
        return
    importModel(FMU_name)
elif action == "mix":
    if FMU_name in replace_names:
        if FMU_name in model_names:
            replaceModel(FMU_name)
            return
        else:
            importModel(FMU_name)
            return
    else:
        print(f"{FMU_name} is neither present in model_names nor in Replace section. Exiting.")
        return
else:
    print(f"Invalid action {action}.")

def build_and_run(): try: apis.openProjectById() apis.openSystemById() apis.autoMapping() apis.generate_code_and_build() except Exception as e: print(f"An error occurred: {e}")

if name == "main":

if len(sys.argv) < 3:

#     print("Usage: python your_script_name.py {action} {FMU_name}")
#     sys.exit(1)    
# action = sys.argv[1]
# FMU_names = sys.argv[2:]
action = 'replace'
FMU_names = ['AutoConnection.fmu', 'SimpleExample.fmu']
start()
DataProvider_file_maker()
for FMU_name in FMU_names:
    main(action, FMU_name)
DataProvider_file_maker()
build_and_run()
StartEE()
end()
KJA000 commented 10 months ago

Make_DataProvider

import os import json import subprocess

def DataProvider_file_maker():
cosym_project = 'C:\Users\lej3sng\Desktop\autoconnection\autoconnection.csp' if not cosym_project: return None
directory, filename_with_extension = os.path.split(cosym_project) filename, extension = os.path.splitext(filename_with_extension) cwd = os.getcwd() replace_dir = os.path.join(cwd,'Replace') replace_fmu_files = [file for file in os.listdir(replace_dir) if file.endswith('.fmu')] command = 'curl -X GET "http://localhost:8181/cxf/cosymserver/v2/projects" -H "accept: application/json"' result = subprocess.run(command, shell=True, capture_output=True, text=True, encoding='utf-8') data = json.loads(result.stdout) for project in data: if project["name"] == filename: project_id = project["id"] parameter_format = project.get("parameterFileFormat", None)

command = f'curl -X GET "http://localhost:8181/cxf/cosymserver/v2/projects/{project_id}/folders" -H  "accept: application/json"'   
result = subprocess.run(command, shell=True, capture_output=True, text=True, encoding='utf-8')
data = json.loads(result.stdout)
fmu_names = []
model_ids = []
for child in data["children"]:
    if child["name"] == "VECU":
        folder_path = child["id"]
        for model in child["children"]:
            model_ids.append(model["id"])
            fmu_names.append(f'{model["name"]}.fmu')
        break
command = f'curl -X GET "http://localhost:8181/cxf/cosymserver/v2/projects/{project_id}/systems" -H  "accept: application/json"' 
result = subprocess.run(command, shell=True, capture_output=True, text=True, encoding='utf-8')
systems_data = json.loads(result.stdout)

# # # # # # # # # # # # # DataProvider.json 파일 작성 # # # # # # # # # # # #
with open('DataProvider.json', 'r', encoding= 'utf-8') as file:
    data = json.load(file)

data['Project']['Name'] = filename
data['Project']['Destination_path'] = directory
data['Project']['id'] = project_id
data['Project']['parameter_file_format'] = parameter_format
data['Models'][0]['source_path'] = folder_path
data['Models'][0]['model_names'] = fmu_names
data['Models'][0]['id'] = model_ids
data['Replace'][0]['source_path'] = replace_dir
data['Replace'][0]['model_names'] = replace_fmu_files

# if systems_data and isinstance(systems_data, list) and systems_data:
#     system_info = systems_data[0]
#     data['System'] = {key: ([value] if key == 'targetId' else value) for key, value in system_info.items()}
if systems_data and isinstance(systems_data, list) and systems_data:
    data['System'] = systems_data[0]

with open('DataProvider.json', 'w', encoding= 'utf-8') as file:
    json.dump(data, file, ensure_ascii=False, indent=4) 
# # # # # # # # # # # # # DataProvider.json 파일 작성 # # # # # # # # # # # #

def start(): from API_COSYM import COSYM_REST_APIs dataProvider = r"DataProvider.json" apis = COSYM_REST_APIs(dataProvider) try: apis.launchCOSYMService() except Exception as e: print(f"An error occurred: {e}") apis.closeCOSYMService()

def end(): from API_COSYM import COSYM_REST_APIs dataProvider = r"DataProvider.json" apis = COSYM_REST_APIs(dataProvider) try: apis.closeCOSYMService() except Exception as e: print(f"An error occurred: {e}")

if name == "main": DataProvider_file_maker()

KJA000 commented 10 months ago

API_COSYM.py

import os import json import logging

from swagger_client.api.project_api import ProjectApi from swagger_client.api.models_api import ModelsApi from swagger_client.api.systems_api import SystemsApi from swagger_client.api.model_instance_api import ModelInstanceApi from swagger_client.api.target_api import TargetApi from swagger_client.api.connections_api import ConnectionsApi from swagger_client.api.os_tasks_api import OSTasksApi from swagger_client.api.common_ee_api import CommonEEApi from swagger_client.api.folder_api import FolderApi

from swagger_client.models.project_vo import ProjectVO from swagger_client.models.target_vo import TargetVO from swagger_client.models.system_vo import SystemVO from swagger_client.models.system_update_vo import SystemUpdateVO from swagger_client.models.model_vo import ModelVO from swagger_client.models.model_instance_vo import ModelInstanceVO from swagger_client.models.auto_mapping_configuration_vo import AutoMappingConfigurationVO from swagger_client.models.connection_vo import ConnectionVO from swagger_client.models.input_model_vo import InputModelVO

class COSYM_REST_APIs:

'''
Initiating the Objects of swagger api class to access the required apis within the class
'''
COSYM_HOME_Path = os.environ["COSYM_HOME"]
ETAS_Data_Path = os.path.join(os.path.abspath(os.path.join(COSYM_HOME_Path, os.pardir)),"ETASData",os.path.basename(os.path.abspath(COSYM_HOME_Path)))

projectAPI_Obj = ProjectApi()
ModelApiObj = ModelsApi()
modelInstanceObj = ModelInstanceApi()
systemAPI_Obj = SystemsApi()
api_TargetAPIObj = TargetApi()
ConnectionObj = ConnectionsApi()
OSConfigObj = OSTasksApi()
AutoMappingConfigurationVOObj = AutoMappingConfigurationVO()
CEE_Obj = CommonEEApi()
folderAPI_Obj = FolderApi()

'''
Initiating the globel variables for Project,Models,System and Target so that these objects can be available to access by other members of the class
'''
project = None
models = []
system = None
target = None

dataProviderPath = None

def __init__(self, dataProviderFilePath):
    '''
    Constructor for the Class, which reads the Dataprovider.json during object creation.
    All the member of the class will be using the loaded json for payload creation (Input data for apis)
    :param dataProviderFilePath: Path to the DataProvider.json
    '''
    self.dataProviderPath = dataProviderFilePath
    with open(dataProviderFilePath, 'r') as f:
        self.dataProvider = json.loads(f.read())
    self.target_id = self.dataProvider.get('System', {}).get('targetId')
    logging.basicConfig(level=logging.INFO, format=f'%(asctime)s - %(levelname)s - %(message)s',
                        handlers=[logging.StreamHandler()])

def inputmodelPayload(self, modelId, sourcePath, destinationFolder):
    if(os.path.exists(sourcePath)):
        fileName = os.path.basename(sourcePath)
        modelVOObj = InputModelVO(model_id=modelId, overwrite=True, source_path=sourcePath, destination_path=destinationFolder,
                             model_type=fileName.split('.')[1], name=fileName.split('.')[0])
        return modelVOObj
    else:
        raise Exception("Source Path doesn't exist")

def launchCOSYMService(self):
    print("Launching COSYM Service in headless mode...")
    os.system("cosym --start --mode=headless --acknowledgement=yes")
    # p = subprocess.Popen(["cosym", "--start", "--mode=headless", "--acknowledgement=yes"], shell=True, stdout=subprocess.PIPE)
    # stdout, stderr = p.communicate()

def openProjectById(self):
    id = self.dataProvider['Project']['id']
    self.project = self.projectAPI_Obj.open_project(id)
    #Reading the data model from the bin file
    self.folderAPI_Obj.read_folder(self.project.id)

def openSystemById(self):
    #get systems
    self.systemAPI_Obj.get_systems(self.project.id)
    systemId = self.dataProvider["System"]["id"]
    self.system = self.systemAPI_Obj.get_system(self.project.id, systemId)

def replaceModel(self, FMU):
    models = self.ModelApiObj.get_models(self.project.id)
    model_dict = {}
    for _ in models:
        model_dict[_.name] = _.id

    target_model = None
    for r_models in self.dataProvider["Replace"]:
        if FMU in r_models["model_names"]:
            target_model = r_models
            break

    if not target_model:
        print(f"{FMU} is not found in the dataProvider for replacement.")
        return

    name = FMU.split('.')[0]
    try:
        model_id = model_dict.get(name)
        if model_id:
            modelPath = os.path.join(self.ETAS_Data_Path, target_model["source_path"], FMU)
            inputModel = self.inputmodelPayload(model_id, modelPath, target_model["destination_folder"])
            self.ModelApiObj.import_model(self.project.id, inputModel)
            print(f"{name} has been successfully replaced.")
        else:
            print(f"{name} is not found in the COSYM project.")
    except Exception as e:
        import traceback
        print(f'Error replacing {name}: {e}')
        print(traceback.format_exc())

def importModel(self, FMU):
    models = self.ModelApiObj.get_models(self.project.id)
    model_dict = {}
    for _ in models:
        model_dict[_.name] = _.id

    target_model = None
    for r_models in self.dataProvider["Replace"]:
        if FMU in r_models["model_names"]:
            target_model = r_models
            break

    if not target_model:
        print(f"{FMU} is not found in the dataProvider for import.")
        return

    name = FMU.split('.')[0]
    if name in model_dict:  
        print(f"{name} is already present, so not importing.")
        return
    else:  
        try:
            modelPath = os.path.join(self.ETAS_Data_Path, target_model["source_path"], FMU)
            inputModel = self.inputmodelPayload(None, modelPath, target_model["destination_folder"])
            simple_input = self.simplify_inputmodel(inputModel)
            self.ModelApiObj.import_model(self.project.id, simple_input)
            print(f"{name} has been successfully imported.")
        except Exception as e:
            import traceback
            print(f'Error importing {name}: {e}')
            print(traceback.format_exc())

def closeCOSYMService(self):
    print("Close COSYM Service...")
    os.system("cosym -stop")

def simplify_inputmodel(self, input_model):
    return {
        "name": getattr(input_model, "name", ""),
        "sourcePath": getattr(input_model, "source_path", ""),
        "destinationPath": getattr(input_model, "destination_path", "")
    }

def autoMapping(self):
    self.OSConfigObj.automap_process_to_task(self.project.id, self.system.id,False,body=self.AutoMappingConfigurationVOObj)

def generate_code_and_build(self):
    '''
    Code generation and Project build will be achieved by the below api
    :return:
    '''
    logging.info("Codegen and Build is in Progress...")
    self.OSConfigObj.automap_process_to_task(self.project.id, self.system.id, False, body=AutoMappingConfigurationVO())
    self.update_system()
    self.systemAPI_Obj.generate_code_and_build(self.project.id, self.system.id, force_build=True)
    logging.info("Codegen and Build is successful")

def update_system(self):
    self.system = self.systemAPI_Obj.update_system(self.project.id,self.system.id, self.systemPayload())
    logging.info("Saved the System")

def systemPayload(self):
    '''
    System Payload object will be added with the Target details and this method will be called by Patch_System() to map the Target with System.
    :return: System Payload
    '''
    system_Payload_Obj = SystemUpdateVO(system_state="OPEN")
    system_Payload_Obj.operation_type = "UPDATE"
    system_Payload_Obj.resource_type = "TARGET"
    system_Payload_Obj.resource_id = self.target_id
    return system_Payload_Obj
KJA000 commented 10 months ago

C:\Users\KIJ5SNG\Desktop\task\15.Replace_API_upgrade(10~12.31)\Replace_1114

KJA000 commented 10 months ago

내가 변경한 경로 : C:\Users\lej3sng\Desktop\Replace_API

KJA000 commented 10 months ago

데이터 생성

data_a = {i: i value for i, value in enumerate(range(1, 10001), start=1)} data_b = {i: i value for i, value in enumerate(range(1, 10001), start=1)}

a가 b보다 큰 경우 추출

result = {key: (value, data_b[key]) for key, value in data_a.items() if value > data_b[key]}

결과 출력

for key, (value_a, value_b) in result.items(): print(f"Number: {key}, Value in A: {value_a}, Value in B: {value_b}")

KJA000 commented 10 months ago

Number: 6, Value in A: 0.019241, Value in B: 0.020078 Number: 14, Value in A: 0.019402, Value in B: 0.019945 Number: 104, Value in A: 0.019194, Value in B: 0.019345 Number: 273, Value in A: 0.019116, Value in B: 0.019471 Number: 322, Value in A: 0.019076, Value in B: 0.020662 Number: 431, Value in A: 0.019177, Value in B: 0.022037 Number: 480, Value in A: 0.019119, Value in B: 0.019379 Number: 529, Value in A: 0.019174, Value in B: 0.02207 Number: 616, Value in A: 0.019087, Value in B: 0.019186 Number: 725, Value in A: 0.019458, Value in B: 0.019925 Number: 790, Value in A: 0.019123, Value in B: 0.019288 Number: 794, Value in A: 0.019045, Value in B: 0.029192 Number: 812, Value in A: 0.019147, Value in B: 0.019307 Number: 921, Value in A: 0.019185, Value in B: 0.021211 Number: 936, Value in A: 0.019159, Value in B: 0.025604 Number: 970, Value in A: 0.019299, Value in B: 0.021379 Number: 1019, Value in A: 0.019205, Value in B: 0.02057 Number: 1106, Value in A: 0.019269, Value in B: 0.020158 Number: 1149, Value in A: 0.019125, Value in B: 0.026726 Number: 1155, Value in A: 0.019231, Value in B: 0.021763 Number: 1204, Value in A: 0.019115, Value in B: 0.022416 Number: 1313, Value in A: 0.019654, Value in B: 0.022101 Number: 1389, Value in A: 0.019246, Value in B: 0.019618 Number: 1547, Value in A: 0.019117, Value in B: 0.021718 Number: 1596, Value in A: 0.01915, Value in B: 0.021679 Number: 1645, Value in A: 0.01916, Value in B: 0.020654 Number: 1680, Value in A: 0.019251, Value in B: 0.01932 Number: 1682, Value in A: 0.019356, Value in B: 0.019551 Number: 1685, Value in A: 0.019135, Value in B: 0.024986 Number: 1688, Value in A: 0.019222, Value in B: 0.020701 Number: 1691, Value in A: 0.019107, Value in B: 0.019841 Number: 1693, Value in A: 0.019171, Value in B: 0.027282 Number: 1694, Value in A: 0.01917, Value in B: 0.024445 Number: 1697, Value in A: 0.01915, Value in B: 0.019998 Number: 1700, Value in A: 0.019184, Value in B: 0.020564 Number: 1703, Value in A: 0.019176, Value in B: 0.022836 Number: 1706, Value in A: 0.019162, Value in B: 0.019451 Number: 1707, Value in A: 0.019206, Value in B: 0.019219 Number: 1712, Value in A: 0.019218, Value in B: 0.01937 Number: 1720, Value in A: 0.019078, Value in B: 0.019803 Number: 1722, Value in A: 0.019121, Value in B: 0.019274 Number: 1724, Value in A: 0.019246, Value in B: 0.019291 Number: 1726, Value in A: 0.019053, Value in B: 0.019337 Number: 1769, Value in A: 0.019172, Value in B: 0.02178 Number: 1887, Value in A: 0.01914, Value in B: 0.021338 Number: 1889, Value in A: 0.019197, Value in B: 0.019854 Number: 1891, Value in A: 0.019094, Value in B: 0.019343 Number: 1896, Value in A: 0.019257, Value in B: 0.019467 Number: 1914, Value in A: 0.019094, Value in B: 0.020531 Number: 1952, Value in A: 0.019254, Value in B: 0.021046 Number: 2039, Value in A: 0.019092, Value in B: 0.019149 Number: 2077, Value in A: 0.019114, Value in B: 0.020656 Number: 2102, Value in A: 0.019453, Value in B: 0.022157 Number: 2153, Value in A: 0.019147, Value in B: 0.020205 Number: 2173, Value in A: 0.019207, Value in B: 0.020032 Number: 2174, Value in A: 0.019094, Value in B: 0.024615 Number: 2175, Value in A: 0.019221, Value in B: 0.024984 Number: 2176, Value in A: 0.019261, Value in B: 0.021926 Number: 2178, Value in A: 0.019154, Value in B: 0.025927 Number: 2181, Value in A: 0.019133, Value in B: 0.019481 Number: 2184, Value in A: 0.019182, Value in B: 0.01971 Number: 2186, Value in A: 0.019167, Value in B: 0.019551 Number: 2189, Value in A: 0.019257, Value in B: 0.019585 Number: 2191, Value in A: 0.019267, Value in B: 0.019364 Number: 2226, Value in A: 0.019189, Value in B: 0.01933 Number: 2228, Value in A: 0.019103, Value in B: 0.022672 Number: 2266, Value in A: 0.019209, Value in B: 0.022256 Number: 2304, Value in A: 0.019236, Value in B: 0.02047 Number: 2325, Value in A: 0.019575, Value in B: 0.027066 Number: 2358, Value in A: 0.019243, Value in B: 0.019662 Number: 2360, Value in A: 0.019252, Value in B: 0.01935 Number: 2361, Value in A: 0.019162, Value in B: 0.019453 Number: 2380, Value in A: 0.019147, Value in B: 0.019844 Number: 2389, Value in A: 0.01925, Value in B: 0.019413 Number: 2394, Value in A: 0.019203, Value in B: 0.019562 Number: 2399, Value in A: 0.0214, Value in B: 0.021628 Number: 2445, Value in A: 0.019219, Value in B: 0.021258 Number: 2488, Value in A: 0.020524, Value in B: 0.026972 Number: 2597, Value in A: 0.01922, Value in B: 0.020147 Number: 2722, Value in A: 0.021137, Value in B: 0.022561 Number: 2728, Value in A: 0.020417, Value in B: 0.02685 Number: 2739, Value in A: 0.01928, Value in B: 0.032145 Number: 2749, Value in A: 0.019459, Value in B: 0.022285 Number: 2825, Value in A: 0.019353, Value in B: 0.021178 Number: 2901, Value in A: 0.019311, Value in B: 0.021914 Number: 2919, Value in A: 0.019211, Value in B: 0.024136 Number: 2920, Value in A: 0.019495, Value in B: 0.019912 Number: 2977, Value in A: 0.019303, Value in B: 0.021049 Number: 3017, Value in A: 0.019266, Value in B: 0.026989 Number: 3028, Value in A: 0.020414, Value in B: 0.020802 Number: 3053, Value in A: 0.019381, Value in B: 0.020269 Number: 3254, Value in A: 0.019528, Value in B: 0.021195 Number: 3292, Value in A: 0.019683, Value in B: 0.021397 Number: 3368, Value in A: 0.019337, Value in B: 0.020055 Number: 3406, Value in A: 0.019138, Value in B: 0.021369 Number: 3509, Value in A: 0.01926, Value in B: 0.020213 Number: 3541, Value in A: 0.019675, Value in B: 0.025404 Number: 3596, Value in A: 0.019143, Value in B: 0.021201 Number: 3623, Value in A: 0.019514, Value in B: 0.020311 Number: 3661, Value in A: 0.019216, Value in B: 0.021372 Number: 3824, Value in A: 0.019281, Value in B: 0.019513 Number: 3862, Value in A: 0.019273, Value in B: 0.020146 Number: 3955, Value in A: 0.019302, Value in B: 0.01949 Number: 3977, Value in A: 0.019244, Value in B: 0.019769 Number: 3988, Value in A: 0.019256, Value in B: 0.019798 Number: 3999, Value in A: 0.019256, Value in B: 0.020016 Number: 4010, Value in A: 0.019196, Value in B: 0.019547 Number: 4147, Value in A: 0.019365, Value in B: 0.020964 Number: 4358, Value in A: 0.020803, Value in B: 0.02145 Number: 4405, Value in A: 0.019178, Value in B: 0.02117 Number: 4416, Value in A: 0.019092, Value in B: 0.019782 Number: 4553, Value in A: 0.019206, Value in B: 0.019322 Number: 4734, Value in A: 0.019154, Value in B: 0.019421 Number: 4745, Value in A: 0.019276, Value in B: 0.020888 Number: 4799, Value in A: 0.019418, Value in B: 0.022562 Number: 4821, Value in A: 0.019797, Value in B: 0.026104 Number: 4882, Value in A: 0.019595, Value in B: 0.028811 Number: 4904, Value in A: 0.019583, Value in B: 0.021052 Number: 5003, Value in A: 0.019409, Value in B: 0.026646 Number: 5112, Value in A: 0.019413, Value in B: 0.02084 Number: 5119, Value in A: 0.019242, Value in B: 0.021341 Number: 5130, Value in A: 0.01932, Value in B: 0.028978 Number: 5249, Value in A: 0.019335, Value in B: 0.020064 Number: 5290, Value in A: 0.019356, Value in B: 0.02896 Number: 5309, Value in A: 0.019295, Value in B: 0.019543 Number: 5320, Value in A: 0.019743, Value in B: 0.021306 Number: 5435, Value in A: 0.01922, Value in B: 0.020958 Number: 5483, Value in A: 0.019215, Value in B: 0.029026 Number: 5643, Value in A: 0.022648, Value in B: 0.029179 Number: 5654, Value in A: 0.022425, Value in B: 0.026758 Number: 5730, Value in A: 0.020565, Value in B: 0.020626 Number: 5823, Value in A: 0.019194, Value in B: 0.02002 Number: 5874, Value in A: 0.019297, Value in B: 0.019642 Number: 5907, Value in A: 0.019191, Value in B: 0.021735 Number: 6009, Value in A: 0.019233, Value in B: 0.020974 Number: 6017, Value in A: 0.019249, Value in B: 0.026779 Number: 6091, Value in A: 0.019127, Value in B: 0.019666 Number: 6102, Value in A: 0.019333, Value in B: 0.019986 Number: 6195, Value in A: 0.019581, Value in B: 0.02083 Number: 6222, Value in A: 0.01918, Value in B: 0.019999 Number: 6249, Value in A: 0.019317, Value in B: 0.022134 Number: 6341, Value in A: 0.019222, Value in B: 0.021284 Number: 6373, Value in A: 0.019365, Value in B: 0.029299 Number: 6406, Value in A: 0.019286, Value in B: 0.021032 Number: 6411, Value in A: 0.01937, Value in B: 0.029412 Number: 6433, Value in A: 0.019182, Value in B: 0.021787 Number: 6645, Value in A: 0.019335, Value in B: 0.032237 Number: 6725, Value in A: 0.019271, Value in B: 0.019835 Number: 6792, Value in A: 0.020387, Value in B: 0.026913 Number: 6909, Value in A: 0.019332, Value in B: 0.020159 Number: 7028, Value in A: 0.019273, Value in B: 0.020816 Number: 7120, Value in A: 0.019354, Value in B: 0.021314 Number: 7174, Value in A: 0.01935, Value in B: 0.020989 Number: 7201, Value in A: 0.019273, Value in B: 0.019662 Number: 7293, Value in A: 0.019385, Value in B: 0.021422 Number: 7320, Value in A: 0.019387, Value in B: 0.020598 Number: 7477, Value in A: 0.019146, Value in B: 0.01975 Number: 7624, Value in A: 0.019165, Value in B: 0.020663 Number: 7810, Value in A: 0.01911, Value in B: 0.021967 Number: 7892, Value in A: 0.01915, Value in B: 0.020956 Number: 7974, Value in A: 0.019184, Value in B: 0.019331 Number: 7985, Value in A: 0.019106, Value in B: 0.021798 Number: 8111, Value in A: 0.019134, Value in B: 0.021289 Number: 8122, Value in A: 0.019235, Value in B: 0.020954 Number: 8201, Value in A: 0.019267, Value in B: 0.027793 Number: 8204, Value in A: 0.0192, Value in B: 0.020901 Number: 8336, Value in A: 0.019055, Value in B: 0.020962 Number: 8463, Value in A: 0.019092, Value in B: 0.020939 Number: 8568, Value in A: 0.019209, Value in B: 0.020765 Number: 8579, Value in A: 0.019214, Value in B: 0.02078 Number: 8640, Value in A: 0.019051, Value in B: 0.021488 Number: 8683, Value in A: 0.019191, Value in B: 0.029046 Number: 8767, Value in A: 0.019205, Value in B: 0.021337 Number: 8778, Value in A: 0.01919, Value in B: 0.019945 Number: 8915, Value in A: 0.01921, Value in B: 0.021747 Number: 8929, Value in A: 0.019116, Value in B: 0.021163 Number: 8953, Value in A: 0.01929, Value in B: 0.020442 Number: 9013, Value in A: 0.019282, Value in B: 0.020511 Number: 9084, Value in A: 0.01938, Value in B: 0.021992 Number: 9155, Value in A: 0.019301, Value in B: 0.020361 Number: 9215, Value in A: 0.019277, Value in B: 0.021347 Number: 9232, Value in A: 0.019097, Value in B: 0.027773 Number: 9264, Value in A: 0.019262, Value in B: 0.020684 Number: 9407, Value in A: 0.019115, Value in B: 0.02929 Number: 9411, Value in A: 0.019073, Value in B: 0.021218 Number: 9460, Value in A: 0.019219, Value in B: 0.022833 Number: 9509, Value in A: 0.019015, Value in B: 0.019202 Number: 9558, Value in A: 0.019087, Value in B: 0.021226 Number: 9656, Value in A: 0.019107, Value in B: 0.021872 Number: 9759, Value in A: 0.019373, Value in B: 0.020779 Number: 9830, Value in A: 0.01918, Value in B: 0.020702 Number: 9879, Value in A: 0.019107, Value in B: 0.020828 Number: 9917, Value in A: 0.019173, Value in B: 0.020698

KJA000 commented 10 months ago

https://www.notion.so/0127e36c2074465ba049e9d4277fefed

KJA000 commented 10 months ago

[2/1]

Research

Done


O2 - summary: 4122531 1752 1385 1056606 17837 9260 378035 3083 1633

O0 - summary: 4279289 1874 1441 1117178 17140 9220 400744 2791 1639

→ O2가 D1mr, D1mw, Dccmw 에서 더 많은 캐시 쓰기 충돌 미스를 가짐

Number: 6, Value in A: 0.019241, Value in B: 0.020078
Number: 14, Value in A: 0.019402, Value in B: 0.019945
Number: 104, Value in A: 0.019194, Value in B: 0.019345
Number: 273, Value in A: 0.019116, Value in B: 0.019471
Number: 322, Value in A: 0.019076, Value in B: 0.020662
Number: 431, Value in A: 0.019177, Value in B: 0.022037
Number: 480, Value in A: 0.019119, Value in B: 0.019379
Number: 529, Value in A: 0.019174, Value in B: 0.02207
Number: 616, Value in A: 0.019087, Value in B: 0.019186
Number: 725, Value in A: 0.019458, Value in B: 0.019925
Number: 790, Value in A: 0.019123, Value in B: 0.019288
Number: 794, Value in A: 0.019045, Value in B: 0.029192
Number: 812, Value in A: 0.019147, Value in B: 0.019307
Number: 921, Value in A: 0.019185, Value in B: 0.021211
Number: 936, Value in A: 0.019159, Value in B: 0.025604
Number: 970, Value in A: 0.019299, Value in B: 0.021379
Number: 1019, Value in A: 0.019205, Value in B: 0.02057
Number: 1106, Value in A: 0.019269, Value in B: 0.020158
Number: 1149, Value in A: 0.019125, Value in B: 0.026726
Number: 1155, Value in A: 0.019231, Value in B: 0.021763
Number: 1204, Value in A: 0.019115, Value in B: 0.022416
Number: 1313, Value in A: 0.019654, Value in B: 0.022101
Number: 1389, Value in A: 0.019246, Value in B: 0.019618
Number: 1547, Value in A: 0.019117, Value in B: 0.021718
Number: 1596, Value in A: 0.01915, Value in B: 0.021679
Number: 1645, Value in A: 0.01916, Value in B: 0.020654
Number: 1680, Value in A: 0.019251, Value in B: 0.01932
Number: 1682, Value in A: 0.019356, Value in B: 0.019551
Number: 1685, Value in A: 0.019135, Value in B: 0.024986
Number: 1688, Value in A: 0.019222, Value in B: 0.020701
Number: 1691, Value in A: 0.019107, Value in B: 0.019841
Number: 1693, Value in A: 0.019171, Value in B: 0.027282
Number: 1694, Value in A: 0.01917, Value in B: 0.024445
Number: 1697, Value in A: 0.01915, Value in B: 0.019998
Number: 1700, Value in A: 0.019184, Value in B: 0.020564
Number: 1703, Value in A: 0.019176, Value in B: 0.022836
Number: 1706, Value in A: 0.019162, Value in B: 0.019451
Number: 1707, Value in A: 0.019206, Value in B: 0.019219
Number: 1712, Value in A: 0.019218, Value in B: 0.01937
Number: 1720, Value in A: 0.019078, Value in B: 0.019803
Number: 1722, Value in A: 0.019121, Value in B: 0.019274
Number: 1724, Value in A: 0.019246, Value in B: 0.019291
Number: 1726, Value in A: 0.019053, Value in B: 0.019337
Number: 1769, Value in A: 0.019172, Value in B: 0.02178
Number: 1887, Value in A: 0.01914, Value in B: 0.021338
Number: 1889, Value in A: 0.019197, Value in B: 0.019854
Number: 1891, Value in A: 0.019094, Value in B: 0.019343
Number: 1896, Value in A: 0.019257, Value in B: 0.019467
Number: 1914, Value in A: 0.019094, Value in B: 0.020531
Number: 1952, Value in A: 0.019254, Value in B: 0.021046
Number: 2039, Value in A: 0.019092, Value in B: 0.019149
Number: 2077, Value in A: 0.019114, Value in B: 0.020656
Number: 2102, Value in A: 0.019453, Value in B: 0.022157
Number: 2153, Value in A: 0.019147, Value in B: 0.020205
Number: 2173, Value in A: 0.019207, Value in B: 0.020032
Number: 2174, Value in A: 0.019094, Value in B: 0.024615
Number: 2175, Value in A: 0.019221, Value in B: 0.024984
Number: 2176, Value in A: 0.019261, Value in B: 0.021926
Number: 2178, Value in A: 0.019154, Value in B: 0.025927
Number: 2181, Value in A: 0.019133, Value in B: 0.019481
Number: 2184, Value in A: 0.019182, Value in B: 0.01971
Number: 2186, Value in A: 0.019167, Value in B: 0.019551
Number: 2189, Value in A: 0.019257, Value in B: 0.019585
Number: 2191, Value in A: 0.019267, Value in B: 0.019364
Number: 2226, Value in A: 0.019189, Value in B: 0.01933
Number: 2228, Value in A: 0.019103, Value in B: 0.022672
Number: 2266, Value in A: 0.019209, Value in B: 0.022256
Number: 2304, Value in A: 0.019236, Value in B: 0.02047
Number: 2325, Value in A: 0.019575, Value in B: 0.027066
Number: 2358, Value in A: 0.019243, Value in B: 0.019662
Number: 2360, Value in A: 0.019252, Value in B: 0.01935
Number: 2361, Value in A: 0.019162, Value in B: 0.019453
Number: 2380, Value in A: 0.019147, Value in B: 0.019844
Number: 2389, Value in A: 0.01925, Value in B: 0.019413
Number: 2394, Value in A: 0.019203, Value in B: 0.019562
Number: 2399, Value in A: 0.0214, Value in B: 0.021628
Number: 2445, Value in A: 0.019219, Value in B: 0.021258
Number: 2488, Value in A: 0.020524, Value in B: 0.026972
Number: 2597, Value in A: 0.01922, Value in B: 0.020147
Number: 2722, Value in A: 0.021137, Value in B: 0.022561
Number: 2728, Value in A: 0.020417, Value in B: 0.02685
Number: 2739, Value in A: 0.01928, Value in B: 0.032145
Number: 2749, Value in A: 0.019459, Value in B: 0.022285
Number: 2825, Value in A: 0.019353, Value in B: 0.021178
Number: 2901, Value in A: 0.019311, Value in B: 0.021914
Number: 2919, Value in A: 0.019211, Value in B: 0.024136
Number: 2920, Value in A: 0.019495, Value in B: 0.019912
Number: 2977, Value in A: 0.019303, Value in B: 0.021049
Number: 3017, Value in A: 0.019266, Value in B: 0.026989
Number: 3028, Value in A: 0.020414, Value in B: 0.020802
Number: 3053, Value in A: 0.019381, Value in B: 0.020269
Number: 3254, Value in A: 0.019528, Value in B: 0.021195
Number: 3292, Value in A: 0.019683, Value in B: 0.021397
Number: 3368, Value in A: 0.019337, Value in B: 0.020055
Number: 3406, Value in A: 0.019138, Value in B: 0.021369
Number: 3509, Value in A: 0.01926, Value in B: 0.020213
Number: 3541, Value in A: 0.019675, Value in B: 0.025404
Number: 3596, Value in A: 0.019143, Value in B: 0.021201
Number: 3623, Value in A: 0.019514, Value in B: 0.020311
Number: 3661, Value in A: 0.019216, Value in B: 0.021372
Number: 3824, Value in A: 0.019281, Value in B: 0.019513
Number: 3862, Value in A: 0.019273, Value in B: 0.020146
Number: 3955, Value in A: 0.019302, Value in B: 0.01949
Number: 3977, Value in A: 0.019244, Value in B: 0.019769
Number: 3988, Value in A: 0.019256, Value in B: 0.019798
Number: 3999, Value in A: 0.019256, Value in B: 0.020016
Number: 4010, Value in A: 0.019196, Value in B: 0.019547
Number: 4147, Value in A: 0.019365, Value in B: 0.020964
Number: 4358, Value in A: 0.020803, Value in B: 0.02145
Number: 4405, Value in A: 0.019178, Value in B: 0.02117
Number: 4416, Value in A: 0.019092, Value in B: 0.019782
Number: 4553, Value in A: 0.019206, Value in B: 0.019322
Number: 4734, Value in A: 0.019154, Value in B: 0.019421
Number: 4745, Value in A: 0.019276, Value in B: 0.020888
Number: 4799, Value in A: 0.019418, Value in B: 0.022562
Number: 4821, Value in A: 0.019797, Value in B: 0.026104
Number: 4882, Value in A: 0.019595, Value in B: 0.028811
Number: 4904, Value in A: 0.019583, Value in B: 0.021052
Number: 5003, Value in A: 0.019409, Value in B: 0.026646
Number: 5112, Value in A: 0.019413, Value in B: 0.02084
Number: 5119, Value in A: 0.019242, Value in B: 0.021341
Number: 5130, Value in A: 0.01932, Value in B: 0.028978
Number: 5249, Value in A: 0.019335, Value in B: 0.020064
Number: 5290, Value in A: 0.019356, Value in B: 0.02896
Number: 5309, Value in A: 0.019295, Value in B: 0.019543
Number: 5320, Value in A: 0.019743, Value in B: 0.021306
Number: 5435, Value in A: 0.01922, Value in B: 0.020958
Number: 5483, Value in A: 0.019215, Value in B: 0.029026
Number: 5643, Value in A: 0.022648, Value in B: 0.029179
Number: 5654, Value in A: 0.022425, Value in B: 0.026758
Number: 5730, Value in A: 0.020565, Value in B: 0.020626
Number: 5823, Value in A: 0.019194, Value in B: 0.02002
Number: 5874, Value in A: 0.019297, Value in B: 0.019642
Number: 5907, Value in A: 0.019191, Value in B: 0.021735
Number: 6009, Value in A: 0.019233, Value in B: 0.020974
Number: 6017, Value in A: 0.019249, Value in B: 0.026779
Number: 6091, Value in A: 0.019127, Value in B: 0.019666
Number: 6102, Value in A: 0.019333, Value in B: 0.019986
Number: 6195, Value in A: 0.019581, Value in B: 0.02083
Number: 6222, Value in A: 0.01918, Value in B: 0.019999
Number: 6249, Value in A: 0.019317, Value in B: 0.022134
Number: 6341, Value in A: 0.019222, Value in B: 0.021284
Number: 6373, Value in A: 0.019365, Value in B: 0.029299
Number: 6406, Value in A: 0.019286, Value in B: 0.021032
Number: 6411, Value in A: 0.01937, Value in B: 0.029412
Number: 6433, Value in A: 0.019182, Value in B: 0.021787
Number: 6645, Value in A: 0.019335, Value in B: 0.032237
Number: 6725, Value in A: 0.019271, Value in B: 0.019835
Number: 6792, Value in A: 0.020387, Value in B: 0.026913
Number: 6909, Value in A: 0.019332, Value in B: 0.020159
Number: 7028, Value in A: 0.019273, Value in B: 0.020816
Number: 7120, Value in A: 0.019354, Value in B: 0.021314
Number: 7174, Value in A: 0.01935, Value in B: 0.020989
Number: 7201, Value in A: 0.019273, Value in B: 0.019662
Number: 7293, Value in A: 0.019385, Value in B: 0.021422
Number: 7320, Value in A: 0.019387, Value in B: 0.020598
Number: 7477, Value in A: 0.019146, Value in B: 0.01975
Number: 7624, Value in A: 0.019165, Value in B: 0.020663
Number: 7810, Value in A: 0.01911, Value in B: 0.021967
Number: 7892, Value in A: 0.01915, Value in B: 0.020956
Number: 7974, Value in A: 0.019184, Value in B: 0.019331
Number: 7985, Value in A: 0.019106, Value in B: 0.021798
Number: 8111, Value in A: 0.019134, Value in B: 0.021289
Number: 8122, Value in A: 0.019235, Value in B: 0.020954
Number: 8201, Value in A: 0.019267, Value in B: 0.027793
Number: 8204, Value in A: 0.0192, Value in B: 0.020901
Number: 8336, Value in A: 0.019055, Value in B: 0.020962
Number: 8463, Value in A: 0.019092, Value in B: 0.020939
Number: 8568, Value in A: 0.019209, Value in B: 0.020765
Number: 8579, Value in A: 0.019214, Value in B: 0.02078
Number: 8640, Value in A: 0.019051, Value in B: 0.021488
Number: 8683, Value in A: 0.019191, Value in B: 0.029046
Number: 8767, Value in A: 0.019205, Value in B: 0.021337
Number: 8778, Value in A: 0.01919, Value in B: 0.019945
Number: 8915, Value in A: 0.01921, Value in B: 0.021747
Number: 8929, Value in A: 0.019116, Value in B: 0.021163
Number: 8953, Value in A: 0.01929, Value in B: 0.020442
Number: 9013, Value in A: 0.019282, Value in B: 0.020511
Number: 9084, Value in A: 0.01938, Value in B: 0.021992
Number: 9155, Value in A: 0.019301, Value in B: 0.020361
Number: 9215, Value in A: 0.019277, Value in B: 0.021347
Number: 9232, Value in A: 0.019097, Value in B: 0.027773
Number: 9264, Value in A: 0.019262, Value in B: 0.020684
Number: 9407, Value in A: 0.019115, Value in B: 0.02929
Number: 9411, Value in A: 0.019073, Value in B: 0.021218
Number: 9460, Value in A: 0.019219, Value in B: 0.022833
Number: 9509, Value in A: 0.019015, Value in B: 0.019202
Number: 9558, Value in A: 0.019087, Value in B: 0.021226
Number: 9656, Value in A: 0.019107, Value in B: 0.021872
Number: 9759, Value in A: 0.019373, Value in B: 0.020779
Number: 9830, Value in A: 0.01918, Value in B: 0.020702
Number: 9879, Value in A: 0.019107, Value in B: 0.020828
Number: 9917, Value in A: 0.019173, Value in B: 0.020698

Week Plan

KJA000 commented 9 months ago

O0으로 cg_annotate한 경우 : jiaekim@raspberrypi:~/s8_O0/10000 $ cg_annotate O0_6

I1 cache: 16384 B, 64 B, 4-way associative D1 cache: 16384 B, 64 B, 4-way associative LL cache: 262144 B, 64 B, 8-way associative Command: ../test_arm_convolve_s8 Data file: O0_6 Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Thresholds: 0.1 100 100 100 100 100 100 100 100 Include dirs:
User annotated:
Auto-annotation: on


Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw

4,279,289 (100.0%) 1,874 (100.0%) 1,441 (100.0%) 1,117,178 (100.0%) 17,140 (100.0%) 9,220 (100.0%) 400,744 (100.0%) 2,791 (100.0%) 1,639 (100.0%) PROGRAM TOTALS


Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw file:function

662,370 (15.48%) 27 ( 1.44%) 14 ( 0.97%) 234,444 (20.99%) 46 ( 0.27%) 41 ( 0.44%) 9,314 ( 2.32%) 3 ( 0.11%) 0 /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c:arm_nn_mat_mult_kernel_s8_s16 572,136 (13.37%) 51 ( 2.72%) 47 ( 3.26%) 202,614 (18.14%) 5,906 (34.46%) 1,049 (11.38%) 86,774 (21.65%) 74 ( 2.65%) 23 ( 1.40%) ./elf/dl-lookup.c:do_lookup_x 538,413 (12.58%) 17 ( 0.91%) 16 ( 1.11%) 149,313 (13.37%) 2,030 (11.84%) 1,651 (17.91%) 50,545 (12.61%) 71 ( 2.54%) 16 ( 0.98%) ./elf/dl-lookup.c:_dl_lookup_symbol_x 501,329 (11.72%) 7 ( 0.37%) 4 ( 0.28%) 82,668 ( 7.40%) 0 0 82,668 (20.63%) 39 ( 1.40%) 39 ( 2.38%) /home/jiae/CMSIS-NN/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c:arm_q7_to_q15_with_offset 412,412 ( 9.64%) 36 ( 1.92%) 22 ( 1.53%) 117,177 (10.49%) 4 ( 0.02%) 0 10,829 ( 2.70%) 0 0 /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_s8.c:arm_convolve_s8 392,184 ( 9.16%) 7 ( 0.37%) 4 ( 0.28%) 64,159 ( 5.74%) 423 ( 2.47%) 229 ( 2.48%) 64,159 (16.01%) 14 ( 0.50%) 13 ( 0.79%) ./string/../sysdeps/aarch64/multiarch/../memcpy.S:GI_memcpy 247,319 ( 5.78%) 34 ( 1.81%) 34 ( 2.36%) 49,670 ( 4.45%) 3,674 (21.44%) 3,239 (35.13%) 17,667 ( 4.41%) 1,904 (68.22%) 938 (57.23%) ./elf/../sysdeps/aarch64/dl-machine.h:_dl_relocate_object 110,417 ( 2.58%) 127 ( 6.78%) 94 ( 6.52%) 27,582 ( 2.47%) 100 ( 0.58%) 34 ( 0.37%) 248 ( 0.06%) 17 ( 0.61%) 16 ( 0.98%) ???:??? 102,521 ( 2.40%) 12 ( 0.64%) 11 ( 0.76%) 37,617 ( 3.37%) 339 ( 1.98%) 211 ( 2.29%) 14,618 ( 3.65%) 11 ( 0.39%) 5 ( 0.31%) ./elf/dl-lookup.c:check_match 102,325 ( 2.39%) 12 ( 0.64%) 7 ( 0.49%) 11,912 ( 1.07%) 168 ( 0.98%) 71 ( 0.77%) 0 0 0 ./string/../sysdeps/aarch64/strcmp.S:strcmp 102,230 ( 2.39%) 3 ( 0.16%) 2 ( 0.14%) 329 ( 0.03%) 0 0 0 0 0 /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h:arm_convolve_s8 76,440 ( 1.79%) 24 ( 1.28%) 4 ( 0.28%) 32,760 ( 2.93%) 4 ( 0.02%) 0 20,020 ( 5.00%) 30 ( 1.07%) 29 ( 1.77%) ./libio/putchar.c:putchar 70,972 ( 1.66%) 19 ( 1.01%) 4 ( 0.28%) 0 0 0 12,860 ( 3.21%) 36 ( 1.29%) 36 ( 2.20%) ./string/../sysdeps/aarch64/memset.S:GI_memset 60,495 ( 1.41%) 5 ( 0.27%) 5 ( 0.35%) 16,876 ( 1.51%) 2,284 (13.33%) 1,085 (11.77%) 3,388 ( 0.85%) 4 ( 0.14%) 0 ./elf/do-rel.h:_dl_relocate_object 57,413 ( 1.34%) 9 ( 0.48%) 9 ( 0.62%) 13,997 ( 1.25%) 1,072 ( 6.25%) 1,022 (11.08%) 13 ( 0.00%) 2 ( 0.07%) 0 ./elf/dl-addr.c:_dl_addr 36,030 ( 0.84%) 21 ( 1.12%) 4 ( 0.28%) 18,825 ( 1.69%) 7 ( 0.04%) 7 ( 0.08%) 3,940 ( 0.98%) 0 0 /home/jiae/CMSIS-NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/../../Utils/validate.h:validate 30,888 ( 0.72%) 3 ( 0.16%) 3 ( 0.21%) 12,012 ( 1.08%) 0 0 3,432 ( 0.86%) 0 0 /home/jiae/CMSIS-NN/Tests/UnitTest/Unity/src/unity.c:UnityPrintChar 30,010 ( 0.70%) 7 ( 0.37%) 6 ( 0.42%) 0 0 0 0 0 0 /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h:arm_nn_mat_mult_kernel_s8_s16 23,660 ( 0.55%) 4 ( 0.21%) 1 ( 0.07%) 5,460 ( 0.49%) 0 0 3,640 ( 0.91%) 0 0 ./libio/libioP.h:putchar 20,476 ( 0.48%) 3 ( 0.16%) 2 ( 0.14%) 3,723 ( 0.33%) 7 ( 0.04%) 2 ( 0.02%) 1,862 ( 0.46%) 0 0 ???:aarch64_cas4_acq 16,749 ( 0.39%) 4 ( 0.21%) 2 ( 0.14%) 3,722 ( 0.33%) 0 0 1,861 ( 0.46%) 0 0 ???:aarch64_swp4_rel 16,133 ( 0.38%) 6 ( 0.32%) 1 ( 0.07%) 7,129 ( 0.64%) 20 ( 0.12%) 12 ( 0.13%) 1,875 ( 0.47%) 0 0 /home/jiae/CMSIS-NN/Tests/UnitTest/Unity/src/unity.c:UnityPrint 14,034 ( 0.33%) 5 ( 0.27%) 5 ( 0.35%) 3,106 ( 0.28%) 22 ( 0.13%) 22 ( 0.24%) 12 ( 0.00%) 3 ( 0.11%) 3 ( 0.18%) ./elf/dl-tunables.c:GI_tunables_init 10,065 ( 0.24%) 1 ( 0.05%) 1 ( 0.07%) 3,355 ( 0.30%) 0 0 0 0 0 ./elf/../sysdeps/generic/ldsodefs.h:_dl_relocate_object 6,264 ( 0.15%) 0 0 2,088 ( 0.19%) 0 0 0 0 0 ./elf/../sysdeps/generic/ldsodefs.h:do_lookup_x 4,608 ( 0.11%) 1 ( 0.05%) 1 ( 0.07%) 966 ( 0.09%) 10 ( 0.06%) 10 ( 0.11%) 0 0 0 ./elf/dl-tunables.h:GI_tunables_init


The following files chosen for auto-annotation could not be found:

./elf/../sysdeps/aarch64/dl-machine.h ./elf/../sysdeps/generic/ldsodefs.h ./elf/dl-addr.c ./elf/dl-lookup.c ./elf/dl-tunables.c ./elf/dl-tunables.h ./elf/do-rel.h ./libio/libioP.h ./libio/putchar.c ./string/../sysdeps/aarch64/memset.S ./string/../sysdeps/aarch64/multiarch/../memcpy.S ./string/../sysdeps/aarch64/strcmp.S /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_s8.c /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c /home/jiae/CMSIS-NN/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c /home/jiae/CMSIS-NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/../../Utils/validate.h /home/jiae/CMSIS-NN/Tests/UnitTest/Unity/src/unity.c O2로 cg_annotate한 경우 : -------------------------------------------------------------------------------- I1 cache: 16384 B, 64 B, 4-way associative D1 cache: 16384 B, 64 B, 4-way associative LL cache: 262144 B, 64 B, 8-way associative Command: ../test_arm_convolve_s8 Data file: O2_6 Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Thresholds: 0.1 100 100 100 100 100 100 100 100 Include dirs:
User annotated:
Auto-annotation: on


Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw

4,122,531 (100.0%) 1,752 (100.0%) 1,385 (100.0%) 1,056,606 (100.0%) 17,837 (100.0%) 9,260 (100.0%) 378,035 (100.0%) 3,083 (100.0%) 1,633 (100.0%) PROGRAM TOTALS


Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw file:function

662,370 (16.07%) 24 ( 1.37%) 15 ( 1.08%) 234,444 (22.19%) 45 ( 0.25%) 42 ( 0.45%) 9,314 ( 2.46%) 3 ( 0.10%) 0 /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c:arm_nn_mat_mult_kernel_s8_s16 572,208 (13.88%) 50 ( 2.85%) 47 ( 3.39%) 202,621 (19.18%) 6,430 (36.05%) 1,050 (11.34%) 86,812 (22.96%) 45 ( 1.46%) 24 ( 1.47%) ./elf/dl-lookup.c:do_lookup_x 538,509 (13.06%) 17 ( 0.97%) 16 ( 1.16%) 149,344 (14.13%) 2,035 (11.41%) 1,649 (17.81%) 50,569 (13.38%) 373 (12.10%) 14 ( 0.86%) ./elf/dl-lookup.c:_dl_lookup_symbol_x 501,329 (12.16%) 5 ( 0.29%) 3 ( 0.22%) 82,668 ( 7.82%) 0 0 82,668 (21.87%) 40 ( 1.30%) 39 ( 2.39%) /home/jiae/CMSIS-NN/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c:arm_q7_to_q15_with_offset 412,412 (10.00%) 45 ( 2.57%) 23 ( 1.66%) 117,177 (11.09%) 7 ( 0.04%) 0 10,829 ( 2.86%) 0 0 /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_s8.c:arm_convolve_s8 392,184 ( 9.51%) 6 ( 0.34%) 4 ( 0.29%) 64,159 ( 6.07%) 485 ( 2.72%) 259 ( 2.80%) 64,159 (16.97%) 14 ( 0.45%) 13 ( 0.80%) ./string/../sysdeps/aarch64/multiarch/../memcpy.S:GI_memcpy 247,358 ( 6.00%) 36 ( 2.05%) 36 ( 2.60%) 49,666 ( 4.70%) 3,698 (20.73%) 3,237 (34.96%) 17,667 ( 4.67%) 1,923 (62.37%) 938 (57.44%) ./elf/../sysdeps/aarch64/dl-machine.h:_dl_relocate_object 110,353 ( 2.68%) 129 ( 7.36%) 95 ( 6.86%) 27,566 ( 2.61%) 99 ( 0.56%) 33 ( 0.36%) 248 ( 0.07%) 18 ( 0.58%) 16 ( 0.98%) ???:??? 102,580 ( 2.49%) 14 ( 0.80%) 11 ( 0.79%) 37,637 ( 3.56%) 396 ( 2.22%) 215 ( 2.32%) 14,625 ( 3.87%) 13 ( 0.42%) 5 ( 0.31%) ./elf/dl-lookup.c:check_match 102,504 ( 2.49%) 13 ( 0.74%) 7 ( 0.51%) 11,938 ( 1.13%) 176 ( 0.99%) 75 ( 0.81%) 0 0 0 ./string/../sysdeps/aarch64/strcmp.S:strcmp 102,230 ( 2.48%) 2 ( 0.11%) 1 ( 0.07%) 329 ( 0.03%) 0 0 0 0 0 /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h:arm_convolve_s8 70,684 ( 1.71%) 20 ( 1.14%) 4 ( 0.29%) 0 0 0 12,734 ( 3.37%) 36 ( 1.17%) 36 ( 2.20%) ./string/../sysdeps/aarch64/memset.S:GI_memset 60,499 ( 1.47%) 5 ( 0.29%) 5 ( 0.36%) 16,881 ( 1.60%) 2,284 (12.80%) 1,083 (11.70%) 3,389 ( 0.90%) 4 ( 0.13%) 0 ./elf/do-rel.h:_dl_relocate_object 57,413 ( 1.39%) 9 ( 0.51%) 9 ( 0.65%) 13,997 ( 1.32%) 1,072 ( 6.01%) 1,022 (11.04%) 13 ( 0.00%) 2 ( 0.06%) 0 ./elf/dl-addr.c:_dl_addr 36,400 ( 0.88%) 4 ( 0.23%) 3 ( 0.22%) 16,380 ( 1.55%) 2 ( 0.01%) 0 14,560 ( 3.85%) 31 ( 1.01%) 29 ( 1.78%) ./libio/putc.c:putc 30,010 ( 0.73%) 5 ( 0.29%) 5 ( 0.36%) 0 0 0 0 0 0 /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h:arm_nn_mat_mult_kernel_s8_s16 14,311 ( 0.35%) 2 ( 0.11%) 2 ( 0.14%) 1,981 ( 0.19%) 21 ( 0.12%) 13 ( 0.14%) 212 ( 0.06%) 0 0 /home/jiae/CMSIS-NN/Tests/UnitTest/Unity/src/unity.c:UnityPrint 14,034 ( 0.34%) 5 ( 0.29%) 5 ( 0.36%) 3,106 ( 0.29%) 22 ( 0.12%) 22 ( 0.24%) 12 ( 0.00%) 3 ( 0.10%) 3 ( 0.18%) ./elf/dl-tunables.c:GI_tunables_init 10,068 ( 0.24%) 1 ( 0.06%) 1 ( 0.07%) 3,356 ( 0.32%) 0 0 0 0 0 ./elf/../sysdeps/generic/ldsodefs.h:_dl_relocate_object 6,267 ( 0.15%) 0 0 2,089 ( 0.20%) 0 0 0 0 0 ./elf/../sysdeps/generic/ldsodefs.h:do_lookup_x 4,608 ( 0.11%) 1 ( 0.06%) 1 ( 0.07%) 966 ( 0.09%) 10 ( 0.06%) 10 ( 0.11%) 0 0 0 ./elf/dl-tunables.h:GI_tunables_init


The following files chosen for auto-annotation could not be found:

./elf/../sysdeps/aarch64/dl-machine.h ./elf/../sysdeps/generic/ldsodefs.h ./elf/dl-addr.c ./elf/dl-lookup.c ./elf/dl-tunables.c ./elf/dl-tunables.h ./elf/do-rel.h ./libio/putc.c ./string/../sysdeps/aarch64/memset.S ./string/../sysdeps/aarch64/multiarch/../memcpy.S ./string/../sysdeps/aarch64/strcmp.S /home/jiae/CMSIS-NN/Include/arm_nnsupportfunctions.h /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_convolve_s8.c /home/jiae/CMSIS-NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c /home/jiae/CMSIS-NN/Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c /home/jiae/CMSIS-NN/Tests/UnitTest/Unity/src/unity.c 둘을비교해서 분석해줘

KJA000 commented 9 months ago

https://www.notion.so/2-8-119803f843dd4c4cb015a41f81373212?pvs=4

KJA000 commented 9 months ago

https://twitter.com/kinkyo0/status/1484206750559457286?t=Kf_ltFbhm08m1redzjrM3Q&s=19