WO2022111456A1 - Core sharing method and apparatus based on many-core system, electronic device, and medium - Google Patents

Core sharing method and apparatus based on many-core system, electronic device, and medium Download PDF

Info

Publication number
WO2022111456A1
WO2022111456A1 PCT/CN2021/132357 CN2021132357W WO2022111456A1 WO 2022111456 A1 WO2022111456 A1 WO 2022111456A1 CN 2021132357 W CN2021132357 W CN 2021132357W WO 2022111456 A1 WO2022111456 A1 WO 2022111456A1
Authority
WO
WIPO (PCT)
Prior art keywords
core
shared
cluster
processing
storage area
Prior art date
Application number
PCT/CN2021/132357
Other languages
French (fr)
Chinese (zh)
Inventor
吴臻志
祝夭龙
Original Assignee
北京灵汐科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京灵汐科技有限公司 filed Critical 北京灵汐科技有限公司
Publication of WO2022111456A1 publication Critical patent/WO2022111456A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3877Concurrent instruction execution, e.g. pipeline, look ahead using a slave processor, e.g. coprocessor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the present disclosure relates to the field of computer technologies, and in particular, to a core sharing method and apparatus based on a many-core system, an electronic device, and a computer-readable medium.
  • a many-core system usually has many cores (also called processing cores).
  • the core is the smallest computing unit in the many-core system that can be independently scheduled and has complete computing power.
  • the core has certain resources such as storage and computing.
  • the core of the many-core system can run program instructions independently, using the ability of parallel computing, can speed up the running speed of the program, and can provide multi-tasking ability.
  • the present disclosure provides a core sharing method and apparatus based on a many-core system, an electronic device, and a computer-readable medium.
  • the present disclosure provides a core sharing method based on a many-core system
  • the many-core system includes a plurality of pre-configured core clusters, each of the core clusters includes at least one second processing core
  • the method Including: receiving a core sharing request; according to the core sharing request, determining at least one second processing core from the second processing cores of the first core cluster and/or the predetermined second core cluster, as the first core cluster
  • the tasks corresponding to the core clusters respectively store first task data corresponding to the tasks of the first core cluster, and store second task data corresponding to the tasks of the second core cluster.
  • the many-core system further includes a first processing core
  • the receiving a core sharing request includes: receiving a core sharing request sent by an external host or a first processing core, where the core sharing request is the external Generated by the host or the first processing core based on common tasks corresponding to the first core cluster and the second core cluster; or, receiving a core sharing request sent by the main processing core of the second core cluster,
  • the main processing core of the second core cluster is a pre-designated second processing core in at least one second processing core of the second core cluster.
  • the method further includes: updating a core cluster list corresponding to the shared core, where the updated core cluster list includes Identification information corresponding to a core cluster and the second core cluster respectively.
  • the method further includes: creating a first shared core corresponding to the first core cluster in a storage area corresponding to the shared core array a storage area, the first shared storage area is used to store the first task data; a second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the shared core array, the The second shared storage area is used to store the second task data.
  • the method before creating the first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array, the method further includes: judging the storage area corresponding to the shared core array Whether there is available storage space in the storage area; in response to judging that there is available storage space in the storage area corresponding to the shared core array, executing the creation of the first core cluster in the storage area corresponding to the shared core array Corresponding steps of the first shared storage area.
  • the method further includes: in response to determining that the storage area corresponding to the shared core array does not exist Available storage space, determine an idle processing core in the processing cores that do not belong to any core cluster in the many-core system; determine at least one of the idle processing cores as the shared core, and add it to the shared core array .
  • the number of the shared cores is multiple, the storage area corresponding to the shared core array further includes a general shared storage area, the first shared storage area, the second shared storage area and the The general shared storage area corresponds to one or more shared cores respectively; wherein, the shared core corresponding to the first shared storage area is configured to store the first task data; the shared core corresponding to the second shared storage area is configured In order to store the second task data; the shared cores corresponding to the common shared storage area are configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively.
  • the first task data includes first input data, first output data, and first task configuration information
  • the first shared storage area includes a first input data area, a first output data area, and a first a task configuration area; wherein the shared cores in the first input data area are configured to store the first input data; the shared cores in the first output data area are configured to store the first output data ; the shared core in the first task configuration area is configured to store the first task configuration information.
  • the present disclosure provides a core sharing apparatus, which is applied to a many-core system, where the many-core system includes a plurality of preconfigured core clusters, each core cluster includes at least one second processing core, the The core sharing apparatus includes: a receiving module for receiving a core sharing request; a sharing determining module for, according to the core sharing request, from the second processing cores of the first core cluster and/or the predetermined second core cluster, determining at least one second processing core as a shared core between the first core cluster and the second core cluster, and at least one shared core forms a shared core array; wherein the shared core array is configured to receive and execute the tasks corresponding to the first core cluster and the second core cluster respectively, store the first task data corresponding to the tasks of the first core cluster, and store the tasks corresponding to the second core cluster of the second task data.
  • the present disclosure provides an electronic device comprising: a plurality of processing cores; and an on-chip network configured to exchange data among the plurality of processing cores and external data; wherein one or more One or more instructions are stored in each of the processing cores, and the one or more instructions are executed by the one or more processing cores, so that the one or more processing cores can execute the above-mentioned core sharing method.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, the computer program implementing the above-mentioned core sharing method when executed by a processing core.
  • the present disclosure provides a computer program product that, when running on a computer, causes the computer to execute the above-mentioned core sharing method.
  • At least one second processing core in one or more core clusters can be used as a shared core among multiple core clusters according to the received core sharing request, and multiple core clusters can share the shared core
  • multiple core clusters can share the shared core
  • FIG. 1 is a flowchart of a core sharing method based on a many-core system according to an embodiment of the present disclosure
  • FIG. 2 is a block diagram of the composition of a many-core system according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a core sharing method according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of a core sharing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a shared core array according to an embodiment of the disclosure.
  • FIG. 6 is a block diagram of the composition of a core sharing apparatus according to an embodiment of the present disclosure.
  • FIG. 7 is a block diagram of the composition of an electronic device according to an embodiment of the present disclosure.
  • the many-core system includes a plurality of preconfigured core clusters, each core cluster includes at least one second processing core, and each core cluster is respectively used for executing corresponding computing tasks.
  • each core cluster performing the corresponding task, there may exist data and parameters (eg weights) of some processing cores, which are required by multiple core clusters at the same time.
  • the processing core corresponding to the branch network needs to use the data of the processing core corresponding to the backbone network to perform prediction processing.
  • how to effectively implement cross-cluster services between core clusters is a technical problem that needs to be solved urgently in the core cluster scenario of the many-core system.
  • FIG. 1 is a flowchart of a core sharing method based on a many-core system according to an embodiment of the present disclosure.
  • an embodiment of the present disclosure provides a core sharing method based on a many-core system, wherein the many-core system includes a plurality of pre-configured core clusters, each core cluster includes at least one second processing core, and the method can be implemented by a core
  • the device can be implemented by means of software and/or hardware, and the core sharing method includes:
  • Step S1 receiving a core sharing request.
  • Step S2 according to the core sharing request, determine at least one second processing core from the second processing cores of the first core cluster and/or the predetermined second core cluster, as the first core cluster and the second core cluster. Shared cores between core clusters, at least one shared core forms a shared core array.
  • the shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to the tasks of the first core cluster, and store tasks corresponding to the second core cluster Corresponding second task data.
  • the first task data includes first input data, first output data, and first task configuration information
  • the second task data includes second input data, second output data, and second task configuration information.
  • the input data can be, for example, the data required to execute the task
  • the output data can be, for example, the result of executing the task
  • the task configuration information is the configuration required to execute the task, such as memory configuration, routing configuration, operation sequence configuration, operation Time configuration, operator configuration and other information.
  • the present disclosure does not limit the specific categories of input data, output data, and task configuration information.
  • the first core cluster is any core cluster among the multiple core clusters in the many-core system
  • the second core cluster is any core cluster other than the first core cluster in the many-core system
  • the second core cluster is any core cluster other than the first core cluster in the many-core system.
  • the number of clusters can be one or more.
  • any core cluster or multiple core clusters can be used for multiple core clusters.
  • At least one second processing core in the core clusters is used as a shared core among multiple core clusters, and multiple core clusters can share the data of the shared core (for example, parameters required in the deep learning network, etc.), thereby realizing multiple core clusters.
  • the cross-cluster business between multiple core clusters of the core system satisfies the requirement that multiple core clusters need to share the data of some processing cores, improves the control ability of some processing cores in the many-core system, and improves the task processing of the many-core system. flexibility.
  • FIG. 2 is a block diagram of the composition of a many-core system provided by an embodiment of the present disclosure.
  • each core cluster has a main processing core, and the main processing core is the core cluster.
  • the core sharing method of the embodiment of the present disclosure can be applied to the main processing core of any core cluster in the many-core system, that is, the core sharing method of the embodiment of the present disclosure is implemented based on the main processing core of any core cluster, and the main processing core can be used for It handles the tasks corresponding to its own core cluster, and can also be used for task allocation and management within the cluster.
  • the main processing core of the second core cluster may Send a core sharing request to the main processing core of the first core cluster.
  • the core sharing request may include but is not limited to: identification information, address information corresponding to the second core cluster, one or more second core clusters to be shared in the first core cluster Processing core information, etc.
  • the main processing core of the first core cluster receives the core sharing request sent by the main processing core of the second core cluster, wherein the main processing core of the second core cluster is at least one of the second core cluster. A pre-designated second processing core among the second processing cores.
  • the many-core system includes a plurality of processing cores, wherein one processing core is pre-designated as the first processing core, and the remaining processing cores are the second processing cores, and the first processing core is used for receiving data from The tasks to be processed sent by the external host, and the core cluster for processing the tasks to be processed is formed in the many-core system, and the tasks to be processed are scheduled and managed in the many-core system.
  • the external host or the first processing core When the external host or the first processing core needs to establish or assign a common task to multiple core clusters, the external host or the first processing core can select any one of the multiple core clusters as the first core cluster, and the rest As the core cluster is the second core cluster, the external host or the first processing core can first send a core sharing request to the main processing core of the first core cluster.
  • the core sharing request may include but not limited to common tasks and the identifier corresponding to the second core cluster. information, address information, etc., so that the main processing cores of the first core cluster form shared cores for processing common tasks.
  • step S1 the main processing core of the first core cluster receives the core sharing request sent by the external host or the first processing core, and the core sharing request is based on the external host or the first processing core and the first core cluster and the core sharing request. It is generated by the public tasks corresponding to the second core cluster.
  • common tasks refer to tasks that both the first core cluster and the second core cluster need to perform.
  • the first core cluster needs to perform fast Fourier transform tasks (FFT) and window function filtering tasks
  • the second core cluster needs to perform fast Fourier transform task (FFT) and frequency domain multiplication task
  • the fast Fourier transform task (FFT) is the common task corresponding to the first core cluster and the second core cluster
  • the common task can be the backbone of the neural network Complex mathematical operations (such as matrix factorization, FFT, etc.) tasks in the network.
  • step S2 after receiving the core sharing request from the main processing core of the second core cluster, the main processing core of the first core cluster, according to the core sharing request, from the first core where it is located. At least one second processing core is determined from at least one second processing core of the cluster, the determined second processing core is used as a shared core, and the at least one shared core forms a shared core array.
  • the number of shared cores may be specifically determined according to the number of second processing cores requested to be shared by the main processing cores of the second core cluster, which is not limited in this embodiment of the present disclosure.
  • step S2 after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, At least one second processing core is determined in at least one second processing core of the first core cluster, the determined second processing core is used as a shared core, and the at least one shared core forms a shared core array.
  • the number of shared cores may be determined according to the resource requirements required by the common tasks, which is not limited in the embodiments of the present disclosure, as long as the total remaining resources of the formed shared cores can meet (greater than or equal to) the required resources for the common tasks. resource requirements.
  • the resource requirement required by the common task refers to the amount of resources required to perform the common task, for example, the resources may be computing resources, storage resources, and bandwidth resources.
  • the resources may be computing resources, storage resources, and bandwidth resources.
  • For multiple core clusters that need to process common tasks by forming shared cores among multiple core clusters to process common tasks, the processing efficiency and flexibility of the tasks are improved, and multiple core clusters of the many-core system are realized at the same time.
  • the cross-cluster business between multiple core clusters satisfies the requirement that multiple core clusters need to share some processing core data.
  • the main processing core of the first core cluster selects an idle second processing core as a shared core. In some embodiments, in the case of receiving a core sharing request from the main processing core of the second core cluster, if there is no idle second processing core in the first core cluster where the second core cluster is located, the request to the second core cluster The main processing core returns a core sharing request failure message. In some embodiments, in the case of receiving a core sharing request from the external host or the first processing core, if there is no idle second processing core in the first core cluster where the user is located, the external host or the first processing core is sent to the external host or the first processing core. The core returns a core share request failure message.
  • step S2 after receiving the core sharing request from the external host or the first processing core in the many-core system, the primary processing core of the first core cluster, according to the core sharing request, from the second core At least one second processing core is determined from at least one second processing core of the cluster, and the determined second processing core serves as a shared core between the first core cluster and the second core cluster.
  • step S2 after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, according to the core sharing request, There is no available (idle) second processing core in the first core cluster, then at least one second processing core is determined from at least one second processing core in the second core cluster, and the determined second processing core is used as the first processing core.
  • determining at least one second processing core from the at least one second processing core of the second core cluster as a shared core includes: sending a core sharing request to the main processing core of the second core cluster for the first In response to the core sharing request, the main processing core of the two-core cluster determines at least one second processing core from at least one second processing core in the core cluster where it is located as a shared core.
  • first and “second” in the first core cluster and the second core cluster are only for distinguishing different core clusters, and do not refer to a particular core cluster.
  • all the core clusters have the same status, can receive the core sharing request as the first core cluster, and execute the core sharing method in response to the core sharing request, and each core cluster in all the core clusters can also be used as the second core.
  • the cluster requests core sharing from other core clusters, which is not limited in this embodiment of the present disclosure.
  • the main processing core of the first core cluster after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, according to the core sharing request, from at least one of the first core cluster where it is located. At least one second processing core is determined from one second processing core as a shared core, and at least one second processing core is determined from at least one second processing core of the second core cluster as a shared core. In other words, a part of the second processing cores can be selected from the first core cluster, and a part of the second processing cores can be selected from the second core cluster as shared cores together.
  • the main processing core of the first core cluster or the second core cluster further marks the second processing core to mark the second processing core It is shared for the management of each core in the cluster.
  • FIG. 3 is a flowchart of a core sharing method according to an embodiment of the present disclosure.
  • the core sharing method further includes:
  • Step S3 Update the core cluster list corresponding to the shared core, where the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
  • each second processing core in each cluster prestores a core cluster list corresponding to the core cluster where the second processing core is located, and the core cluster list includes but is not limited to: the core cluster corresponding to the core cluster where the second processing core is located
  • Identification information, information of each member in the cluster, the information of each member in the cluster includes but not limited to: the identification, address, location, etc. of each member.
  • the main processing core of the first core cluster adds the identification information corresponding to the second core cluster in the core cluster list of each shared core, thereby updating the core cluster list corresponding to each shared core, and updating
  • the latter list of core clusters includes identification information corresponding to the first core cluster and the second core cluster, so that the shared core can identify that subsequent jobs belong to the first core cluster or the second core cluster, and perform corresponding processing.
  • the main processing core of the first core cluster after determining the shared core, also feeds back information of the shared core to the second core cluster, the information including but not limited to the identification and address information of the shared core, so as to facilitate The processing cores in the second core cluster can access the shared core to obtain required data, or implement required services through the shared core.
  • the main processing core of the two-core cluster in the case of receiving the core sharing request sent by the external host or the first processing core, if the main processing core of the first core cluster sends the core sharing request to the main processing core of the second core cluster, the After determining the shared core, the main processing core of the two-core cluster also feeds back the information of the shared core to the first core cluster, the information including but not limited to the identification and address information of the shared core, so as to facilitate the processing in the first core cluster
  • the cores can access the shared cores to obtain the required data, or implement the required services through the shared cores.
  • FIG. 4 is a flowchart of a core sharing method provided by an embodiment of the present disclosure.
  • the core sharing method further includes: :
  • Step S4 judging whether there is available storage space in the storage area corresponding to the shared core array, if so, go to step S5 , otherwise go to step S7 .
  • step S5 is performed; otherwise, step S7 is performed.
  • the storage area corresponding to the shared core array is the storage area of all shared cores in the shared core array.
  • the preset memory capacity may be the total memory capacity required for executing common tasks and storing task data of the common tasks; it may also be executing tasks corresponding to the first core cluster and the second core cluster, and storing The total memory capacity required for the first task data and the second task data.
  • the present disclosure does not limit the specific value of the preset memory capacity.
  • Step S5 Create a first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array.
  • creating the first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array is to create the first shared storage area in the available storage space of the shared core array.
  • step S5 in response to determining that there is available storage space in the storage area corresponding to the shared core array, a first shared storage area corresponding to the first core cluster is created in the storage area corresponding to the shared core array.
  • the storage area corresponding to the shared core array in response to determining that there is available storage space in the storage area corresponding to the shared core array, and determining that the memory capacity of the available storage space is greater than or equal to the preset memory capacity, the storage area corresponding to the shared core array A first shared storage area corresponding to the first core cluster is created in the area. The first shared storage area is used to store first task data corresponding to tasks of the first core cluster.
  • Step S6 Create a second shared storage area corresponding to the second core cluster in the storage area corresponding to the shared core array, and end the process.
  • creating the second shared storage area corresponding to the second core cluster in the storage area corresponding to the shared core array is to create the second shared storage area in the available storage space of the shared core array.
  • the second shared storage area is used for storing second task data of the task corresponding to the second core cluster.
  • the method further includes: creating a general shared storage area in the storage area corresponding to the shared core array, The general shared storage area is used to carry the execution and operation process of the tasks corresponding to the first core cluster and the second core cluster respectively.
  • Step S7 Determine the idle processing cores among the processing cores that do not belong to any core cluster in the many-core system.
  • Step S8 Add at least one of the idle processing cores to the first core cluster, determine the at least one idle processing core as a shared core, add it to the shared core array, and jump to step S5.
  • step S7 in response to determining that there is no available storage space in the storage area corresponding to the shared core array, determine an idle processing core among the processing cores that do not belong to any core cluster in the many-core system. In some embodiments, in response to determining that the memory capacity of the available storage space of the shared core array is less than the preset memory capacity, determining an idle processing core among the processing cores not belonging to any core cluster in the many-core system.
  • the main processing core of the first core cluster can monitor or obtain the status of each processing core in the many-core system, so as to determine all processing cores currently available in the many-core system, that is, idle Process the nucleus.
  • step S8 adding at least one idle processing core to the first core cluster where it is located may further include: creating an identifier of the idle processing core, and adding the identifier of the idle processing core, Add information such as address and location to the core cluster list corresponding to the first core cluster where you are located to update the core cluster list corresponding to the first core cluster where you are located, and at the same time send the core cluster list corresponding to the first core cluster where you are located to the idler processing core for storage.
  • the process may further jump to step S7.
  • the determined shared core array includes one shared core, then in step S5 and step S6, create a first shared storage area corresponding to the first core cluster from the storage area of the shared core, and create The second shared storage area corresponding to the second core cluster can also create a general shared storage area for carrying the operation process of the task.
  • the determined shared core array includes multiple shared cores, wherein the first shared storage area corresponding to the first core cluster may correspond to one or more shared cores in the array, that is, the first core cluster corresponds to The first shared storage area includes one or more shared core storage areas; similarly, the second shared storage area corresponding to the second core cluster may also correspond to one or more shared cores in the array, that is, the second core cluster
  • the corresponding second shared storage area includes storage areas of one or more shared cores; similarly, the general shared storage area may also correspond to one or more shared cores, that is, the general shared storage area includes storage areas of one or more shared cores. Area. Among them, the shared kernels corresponding to different regions are different.
  • the multiple shared cores can be divided into different areas, one of which corresponds to the first core cluster and is used to store the first task data corresponding to the tasks of the first core cluster , one area corresponds to the second core cluster, and is used to store the second task data corresponding to the tasks of the second core cluster, and the other area is used as a common computing path area for the first core cluster and the second core cluster, which is used to carry the first core cluster.
  • the execution operation process of the tasks corresponding to the cluster and the second core cluster respectively.
  • FIG. 5 is a schematic structural diagram of a shared core array according to an embodiment of the disclosure.
  • the shared core array includes a plurality of shared cores
  • the storage area corresponding to the shared core array includes a first shared storage area M1 corresponding to the first core cluster, and a second shared storage area corresponding to the second core cluster.
  • the area M2, the general shared storage area M0, the first shared storage area, the second shared storage area and the general shared storage area may respectively correspond to one or more shared cores.
  • the core may be configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, that is, an operation process carrying the tasks of the first core cluster and the second core cluster.
  • the first shared storage area M1 may include a first input data area, a first output data area, and a first task configuration area, and the first input data area is configured to store the data of the first core cluster.
  • the first output data area is configured to store the first output data corresponding to the task of the first core cluster;
  • the first task configuration area is configured to store the first task corresponding to the task of the first core cluster configuration information.
  • the first shared storage area M1 corresponds to multiple shared cores
  • the first input data area, the first output data area, and the first task configuration area may correspond to one or more shared cores, respectively, and the first input data area
  • the corresponding shared core is configured to store the first input data
  • the shared core corresponding to the first output data area is configured to store the first output data
  • the shared core corresponding to the first task configuration area is configured to store the first task configuration information.
  • the second shared storage area M2 may include a second input data area, a second output data area, and a second task configuration area, and the second input data area is configured to store the data of the second core cluster.
  • the second output data area is configured to store the second output data corresponding to the task of the second core cluster;
  • the second task configuration area is configured to store the second task corresponding to the task of the second core cluster configuration information.
  • the second shared memory area M2 corresponds to multiple shared cores
  • the second input data area, the second output data area, and the second task configuration area may respectively correspond to one or more shared cores
  • the corresponding shared core is configured to store the second input data
  • the shared core corresponding to the second output data area is configured to store the second output data
  • the shared core corresponding to the second task configuration area is configured to store the second task configuration information.
  • the shared core array is correspondingly configured with a task list
  • the task list may be stored in the main processing core of the first core cluster and/or the main processing core of the second core cluster, and the shared core array may be configured according to the task list.
  • the tasks are processed in sequence, and the task list may include, but is not limited to, computing tasks, signaling tasks, switching tasks, and the like.
  • the computing task is, for example, a task for instructing to perform operations such as computation, calculation, etc.
  • the signaling task is for example a task for instructing to send the required notification, request, etc.
  • the switching task is for example, for sharing
  • the core switches from serving one core cluster to serving another core cluster instructs the task of performing operations such as buffer reset and input and output address switching.
  • the corresponding task in the task list will be cleared.
  • FIG. 6 is a block diagram of the composition of a core sharing apparatus according to an embodiment of the present disclosure.
  • an embodiment of the present disclosure provides a core sharing apparatus 300 , and the core sharing apparatus 300 is applied to a many-core system, where the many-core system includes a plurality of preconfigured core clusters, and each core cluster includes at least one second core cluster.
  • the core sharing apparatus 300 includes: a receiving module 301 and a sharing determination module 302 .
  • the receiving module 301 is configured to receive a core sharing request; the sharing determining module 302 is configured to determine at least one first core cluster from the second processing cores of the first core cluster and/or the second predetermined core cluster according to the core sharing request.
  • Two processing cores are used as shared cores between the first core cluster and the second core cluster, and at least one shared core forms a shared core array.
  • the shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to tasks of the first core cluster, and store tasks corresponding to the second core cluster of the second task data.
  • the many-core system further includes a first processing core
  • the receiving module 301 is configured to: receive a core sharing request sent by an external host or a first processing core, where the core sharing request is the external Generated by the host or the first processing core based on common tasks corresponding to the first core cluster and the second core cluster; or, receiving a core sharing request sent by the main processing core of the second core cluster,
  • the main processing core of the second core cluster is a pre-designated second processing core in at least one second processing core of the second core cluster.
  • the core sharing apparatus 300 further includes an update module (not shown in the figure), the update module is configured to update the corresponding to the shared core after the sharing determination module 302 determines at least one second processing core A core cluster list, where the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
  • the update module is configured to update the corresponding to the shared core after the sharing determination module 302 determines at least one second processing core A core cluster list, where the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
  • the core sharing apparatus 300 further includes a shared storage area creation module (not shown in the figure), and the shared storage area creation module is configured to: after the sharing determination module 302 determines the at least one second processing core, A first shared storage area corresponding to the first core cluster is created in the storage area corresponding to the shared core array, and the first shared storage area is used to store the first task data; A second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the array, and the second shared storage area is used to store the second task data.
  • a shared storage area creation module is configured to: after the sharing determination module 302 determines the at least one second processing core, A first shared storage area corresponding to the first core cluster is created in the storage area corresponding to the shared core array, and the first shared storage area is used to store the first task data; A second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the array, and the second shared storage area is used to store the second task data.
  • the core sharing apparatus 300 further includes a judging module (not shown in the figure), the judging module is used for judging the corresponding to the shared core array before the shared memory area creation module creates the first shared memory area. Whether there is available storage space in the storage area; in response to judging that there is available storage space in the storage area corresponding to the shared core array, executing the creation of the first core cluster in the storage area corresponding to the shared core array Corresponding steps of the first shared storage area.
  • a judging module is used for judging the corresponding to the shared core array before the shared memory area creation module creates the first shared memory area. Whether there is available storage space in the storage area; in response to judging that there is available storage space in the storage area corresponding to the shared core array, executing the creation of the first core cluster in the storage area corresponding to the shared core array Corresponding steps of the first shared storage area.
  • the core sharing apparatus 300 further includes a core expansion module (not shown in the figure), and the core expansion module is configured to respond to the judgment module for judging that there is no available storage space in the storage area corresponding to the shared core array, Determine an idle processing core among the processing cores that do not belong to any core cluster in the many-core system; determine at least one idle processing core as a shared core, and add it to the shared core array.
  • a core expansion module (not shown in the figure)
  • the core expansion module is configured to respond to the judgment module for judging that there is no available storage space in the storage area corresponding to the shared core array, Determine an idle processing core among the processing cores that do not belong to any core cluster in the many-core system; determine at least one idle processing core as a shared core, and add it to the shared core array.
  • the number of the shared cores is multiple, the storage area corresponding to the shared core array further includes a general shared storage area, the first shared storage area, the second shared storage area and the The general shared storage area corresponds to one or more shared cores respectively; wherein, the shared core corresponding to the first shared storage area is configured to store the first task data; the shared core corresponding to the second shared storage area is configured In order to store the second task data; the shared cores corresponding to the common shared storage area are configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively.
  • the first task data includes first input data, first output data, and first task configuration information
  • the first shared storage area includes a first input data area, a first output data area, and a first a task configuration area; wherein the shared cores in the first input data area are configured to store the first input data; the shared cores in the first output data area are configured to store the first output data ; the shared core in the first task configuration area is configured to store the first task configuration information.
  • the core sharing apparatus 300 provided by the embodiments of the present disclosure is used to implement the above-mentioned core sharing method.
  • the core sharing apparatus 300 reference may be made to the description in the above-mentioned core sharing method, which will not be repeated here.
  • An embodiment of the present disclosure also provides a processing core, where the processing core includes the above-mentioned core sharing device.
  • FIG. 7 is a block diagram of the composition of an electronic device according to an embodiment of the present disclosure.
  • an embodiment of the present disclosure provides an electronic device, the electronic device includes multiple processing cores 701 and an on-chip network 702, wherein the multiple processing cores 701 are all connected to the on-chip network 702, and the on-chip network 702 is used for interacting multiple data between cores and external data.
  • One or more instructions are stored in one or more processing cores 701, and one or more instructions are executed by one or more processing cores 701, so that one or more processing cores 701 can execute the above-mentioned core sharing method.
  • an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, wherein the computer program implements the above-mentioned core sharing method when executed by a processing core.
  • an embodiment of the present disclosure also provides a computer program product, which, when running on a computer, enables the computer to execute the above-mentioned core sharing method.
  • Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media.
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .

Abstract

The present disclosure provides a core sharing method and apparatus based on a many-core system, an electronic device, and a medium. The many-core system comprises pre-configured multiple core clusters, and each of the core clusters comprises at least one second processing core. The method comprises: receiving a core sharing request; and determining, according to the core sharing request, at least one second processing core from a first core cluster and/or a predetermined second processing core of a second core cluster to be a shared core between the first core cluster and the second core cluster, and at least one shared core constituting a shared core array, wherein the shared core array is configured to receive and execute tasks respectively corresponding to the first core cluster and the second core cluster, store first task data corresponding to the task of the first core cluster, and store second task data corresponding to the task of the second core cluster.

Description

基于众核系统的核共享方法及装置、电子设备、介质Core sharing method and device, electronic device and medium based on many-core system 技术领域technical field
本公开涉及计算机技术领域,特别涉及一种基于众核系统的核共享方法及装置、电子设备、计算机可读介质。The present disclosure relates to the field of computer technologies, and in particular, to a core sharing method and apparatus based on a many-core system, an electronic device, and a computer-readable medium.
背景技术Background technique
随着人工智能技术的发展,对数据处理速度的需求日益增加,使得众核系统的应用越来越广泛。众核系统通常具有众多核心(也称为处理核),核心是众核系统中能够独立调度、且拥有完整计算能力的最小计算单元,核心具有一定的存储、计算等资源。众核系统的核心可以分别独立运行程序指令,利用并行计算的能力,可以加快程序的运行速度,并可以提供多任务能力。With the development of artificial intelligence technology, the demand for data processing speed is increasing day by day, making many-core systems more and more widely used. A many-core system usually has many cores (also called processing cores). The core is the smallest computing unit in the many-core system that can be independently scheduled and has complete computing power. The core has certain resources such as storage and computing. The core of the many-core system can run program instructions independently, using the ability of parallel computing, can speed up the running speed of the program, and can provide multi-tasking ability.
发明内容SUMMARY OF THE INVENTION
本公开提供一种基于众核系统的核共享方法及装置、电子设备、计算机可读介质。The present disclosure provides a core sharing method and apparatus based on a many-core system, an electronic device, and a computer-readable medium.
第一方面,本公开提供了一种基于众核系统的核共享方法,所述众核系统包括预先配置的多个核心簇,每个所述核心簇包括至少一个第二处理核,所述方法包括:接收核共享请求;根据所述核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为所述第一核心簇与所述第二核心簇之间的共享核,至少一个共享核组成共享核阵列;其中,所述共享核阵列被配置为接收并执行与所述第一核心簇和所述第二核心簇分别对应的任务,存储与所述第一核心簇的任务对应的第一任务数据,以及存储与所述第二核心簇的任务对应的第二任务数据。In a first aspect, the present disclosure provides a core sharing method based on a many-core system, the many-core system includes a plurality of pre-configured core clusters, each of the core clusters includes at least one second processing core, the method Including: receiving a core sharing request; according to the core sharing request, determining at least one second processing core from the second processing cores of the first core cluster and/or the predetermined second core cluster, as the first core cluster A shared core between a core cluster and the second core cluster, at least one shared core constitutes a shared core array; wherein the shared core array is configured to receive and execute communication with the first core cluster and the second core cluster The tasks corresponding to the core clusters respectively store first task data corresponding to the tasks of the first core cluster, and store second task data corresponding to the tasks of the second core cluster.
在一些实施例中,所述众核系统还包括第一处理核,所述接收核共享请求,包括:接收外部主机或第一处理核发送的核共享请求,所述核共享请求为所述外部主机或所述第一处理核基于与所述第一核心簇和所述第二核心簇对应的公共任务而生成的;或,接收所述第二核心簇的主处理核发送的核共享请求,所述第二核心簇的主处理核为所述第二核心簇的至少一个第二处理核中预先指定的第二处理核。In some embodiments, the many-core system further includes a first processing core, and the receiving a core sharing request includes: receiving a core sharing request sent by an external host or a first processing core, where the core sharing request is the external Generated by the host or the first processing core based on common tasks corresponding to the first core cluster and the second core cluster; or, receiving a core sharing request sent by the main processing core of the second core cluster, The main processing core of the second core cluster is a pre-designated second processing core in at least one second processing core of the second core cluster.
在一些实施例中,在所述确定出至少一个第二处理核之后,所述方法还包括:更新与所述共享核对应的核心簇列表,更新后的所述核心簇列表包括与所述第一核心簇和所述第二核心簇分别对应的标识信息。In some embodiments, after the at least one second processing core is determined, the method further includes: updating a core cluster list corresponding to the shared core, where the updated core cluster list includes Identification information corresponding to a core cluster and the second core cluster respectively.
在一些实施例中,在所述确定出至少一个第二处理核之后,所述方法还包括:在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域,所述第一共享存储区域用于存储所述第一任务数据;在与所述共享核阵列对应的存储区中创建与所述第二核心簇对应的第二共享存储区域,所述第二共享存储区域用于存储所述第二任务数据。In some embodiments, after the at least one second processing core is determined, the method further includes: creating a first shared core corresponding to the first core cluster in a storage area corresponding to the shared core array a storage area, the first shared storage area is used to store the first task data; a second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the shared core array, the The second shared storage area is used to store the second task data.
在一些实施例中,在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应 的第一共享存储区域之前,所述方法还包括:判断与所述共享核阵列对应的存储区中是否存在可用存储空间;响应于判断出与所述共享核阵列对应的存储区中存在可用存储空间,执行在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域的步骤。In some embodiments, before creating the first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array, the method further includes: judging the storage area corresponding to the shared core array Whether there is available storage space in the storage area; in response to judging that there is available storage space in the storage area corresponding to the shared core array, executing the creation of the first core cluster in the storage area corresponding to the shared core array Corresponding steps of the first shared storage area.
在一些实施例中,所述判断与所述共享核阵列对应的存储区中是否存在可用存储空间之后,所述方法还包括:响应于判断出与所述共享核阵列对应的存储区中不存在可用存储空间,确定所述众核系统中不归属于任何核心簇的处理核中空闲的处理核;将至少一个所述空闲的处理核确定为所述共享核,并加入所述共享核阵列中。In some embodiments, after determining whether there is available storage space in the storage area corresponding to the shared core array, the method further includes: in response to determining that the storage area corresponding to the shared core array does not exist Available storage space, determine an idle processing core in the processing cores that do not belong to any core cluster in the many-core system; determine at least one of the idle processing cores as the shared core, and add it to the shared core array .
在一些实施例中,所述共享核的数量为多个,所述共享核阵列对应的存储区还包括通用共享存储区域,所述第一共享存储区域、所述第二共享存储区域和所述通用共享存储区域分别对应一个或多个共享核;其中,所述第一共享存储区域对应的共享核被配置为存储所述第一任务数据;所述第二共享存储区域对应的共享核被配置为存储所述第二任务数据;所述通用共享存储区域对应的共享核被配置为接收并执行分别与所述第一核心簇和所述第二核心簇对应的任务。In some embodiments, the number of the shared cores is multiple, the storage area corresponding to the shared core array further includes a general shared storage area, the first shared storage area, the second shared storage area and the The general shared storage area corresponds to one or more shared cores respectively; wherein, the shared core corresponding to the first shared storage area is configured to store the first task data; the shared core corresponding to the second shared storage area is configured In order to store the second task data; the shared cores corresponding to the common shared storage area are configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively.
在一些实施例中,所述第一任务数据包括第一输入数据、第一输出数据和第一任务配置信息,所述第一共享存储区域包括第一输入数据区域、第一输出数据区域以及第一任务配置区域;其中,所述第一输入数据区域中的共享核被配置为存储所述第一输入数据;所述第一输出数据区域中的共享核被配置为存储所述第一输出数据;所述第一任务配置区域中的共享核被配置为存储所述第一任务配置信息。In some embodiments, the first task data includes first input data, first output data, and first task configuration information, and the first shared storage area includes a first input data area, a first output data area, and a first a task configuration area; wherein the shared cores in the first input data area are configured to store the first input data; the shared cores in the first output data area are configured to store the first output data ; the shared core in the first task configuration area is configured to store the first task configuration information.
第二方面,本公开提供了一种核共享装置,该核共享装置应用于众核系统,该众核系统包括预先配置的多个核心簇,每个核心簇包括至少一个第二处理核,该核共享装置包括:接收模块,用于接收核共享请求;共享确定模块,用于根据所述核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为所述第一核心簇与所述第二核心簇之间的共享核,至少一个共享核组成共享核阵列;其中,所述共享核阵列被配置为接收并执行与所述第一核心簇和所述第二核心簇分别对应的任务,存储与所述第一核心簇的任务对应的第一任务数据,以及存储与所述第二核心簇的任务对应的第二任务数据。In a second aspect, the present disclosure provides a core sharing apparatus, which is applied to a many-core system, where the many-core system includes a plurality of preconfigured core clusters, each core cluster includes at least one second processing core, the The core sharing apparatus includes: a receiving module for receiving a core sharing request; a sharing determining module for, according to the core sharing request, from the second processing cores of the first core cluster and/or the predetermined second core cluster, determining at least one second processing core as a shared core between the first core cluster and the second core cluster, and at least one shared core forms a shared core array; wherein the shared core array is configured to receive and execute the tasks corresponding to the first core cluster and the second core cluster respectively, store the first task data corresponding to the tasks of the first core cluster, and store the tasks corresponding to the second core cluster of the second task data.
第三方面,本公开提供了一种电子设备,该电子设备包括:多个处理核;以及,片上网络,被配置为交互所述多个处理核间的数据和外部数据;其中,一个或多个所述处理核中存储有一个或多个指令,一个或多个所述指令被一个或多个所述处理核执行,以使一个或多个所述处理核能够执行上述的核共享方法。In a third aspect, the present disclosure provides an electronic device comprising: a plurality of processing cores; and an on-chip network configured to exchange data among the plurality of processing cores and external data; wherein one or more One or more instructions are stored in each of the processing cores, and the one or more instructions are executed by the one or more processing cores, so that the one or more processing cores can execute the above-mentioned core sharing method.
第四方面,本公开提供了一种计算机可读介质,其上存储有计算机程序,所述计算机程序在被处理核执行时实现上述的核共享方法。In a fourth aspect, the present disclosure provides a computer-readable medium on which a computer program is stored, the computer program implementing the above-mentioned core sharing method when executed by a processing core.
第五方面,本公开提供了计算机程序产品,所述计算机程序产品在计算机上运行时,使得计算机执行上述的核共享方法。In a fifth aspect, the present disclosure provides a computer program product that, when running on a computer, causes the computer to execute the above-mentioned core sharing method.
根据本公开的实施例,能够根据接收到的核共享请求,将一个或多个核心簇中的至 少一个第二处理核作为多个核心簇之间的共享核,多个核心簇可以共用该共享核的数据,从而实现众核系统的多个核心簇间的跨簇业务,满足多个核心簇共用一些处理核的数据的需求,提高众核系统中部分处理核的控制能力以及提高众核系统进行任务处理的灵活性。According to the embodiments of the present disclosure, at least one second processing core in one or more core clusters can be used as a shared core among multiple core clusters according to the received core sharing request, and multiple core clusters can share the shared core In order to realize the cross-cluster business between multiple core clusters in the many-core system, meet the needs of multiple core clusters sharing the data of some processing cores, improve the control ability of some processing cores in the many-core system, and improve the many-core system. Flexibility for task processing.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of drawings
附图用来提供对本公开的进一步理解,并且构成说明书的一部分,与本公开的实施例一起用于解释本公开,并不构成对本公开的限制。通过参考附图对详细示例实施例进行描述,以上和其他特征和优点对本领域技术人员将变得更加显而易见,在附图中:The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification, and together with the embodiments of the present disclosure, they are used to explain the present disclosure, and are not intended to limit the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
图1为本公开实施例提供的一种基于众核系统的核共享方法的流程图;1 is a flowchart of a core sharing method based on a many-core system according to an embodiment of the present disclosure;
图2为本公开实施例提供的一种众核系统的组成框图;FIG. 2 is a block diagram of the composition of a many-core system according to an embodiment of the present disclosure;
图3为本公开实施例提供的一种核共享方法的流程图;FIG. 3 is a flowchart of a core sharing method according to an embodiment of the present disclosure;
图4为本公开实施例提供的一种核共享方法的流程图;FIG. 4 is a flowchart of a core sharing method according to an embodiment of the present disclosure;
图5为本公开实施例中一种共享核阵列的结构示意图;FIG. 5 is a schematic structural diagram of a shared core array according to an embodiment of the disclosure;
图6为本公开实施例提供的一种核共享装置的组成框图;FIG. 6 is a block diagram of the composition of a core sharing apparatus according to an embodiment of the present disclosure;
图7为本公开实施例提供的一种电子设备的组成框图。FIG. 7 is a block diagram of the composition of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本公开,而非对本公开的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本公开相关的部分而非全部结构。The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure, but not to limit the present disclosure. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present disclosure.
为使本领域的技术人员更好地理解本公开的技术方案,以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。In order for those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, and they should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。Various embodiments of the present disclosure and various features of the embodiments may be combined with each other without conflict.
如本文所使用的,术语“和/或”包括一个或多个相关列举条目的任何和所有组合。As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
本文所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。The terminology used herein is used to describe particular embodiments only and is not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that when the terms "comprising" and/or "made of" are used in this specification, the stated features, integers, steps, operations, elements and/or components are specified to be present, but not precluded or Add one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Words like "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be construed as having meanings consistent with their meanings in the context of the related art and the present disclosure, and will not be construed as having idealized or over-formal meanings, unless expressly so limited herein.
在本公开实施例中,众核系统包括多个预先配置的核心簇,每个核心簇包括至少一个第二处理核,各核心簇分别用于执行相应的计算任务。在各核心簇执行相应任务的过程中,可能存在某些处理核的数据、参数(例如权重),同时被多个核心簇需要。作为示例,在深度学习网络中,对于骨干网络对应的处理核和分支网络对应的处理核,分支网络对应的处理核均需要利用骨干网络对应的处理核的数据进行预测处理。而分支网络对应的处理核与骨干网络对应的处理核分别位于不同的核心簇时,如何有效实现核心簇间的跨簇业务,是在众核系统的核心簇场景下亟需解决的技术问题。In the embodiment of the present disclosure, the many-core system includes a plurality of preconfigured core clusters, each core cluster includes at least one second processing core, and each core cluster is respectively used for executing corresponding computing tasks. During the process of each core cluster performing the corresponding task, there may exist data and parameters (eg weights) of some processing cores, which are required by multiple core clusters at the same time. As an example, in a deep learning network, for the processing core corresponding to the backbone network and the processing core corresponding to the branch network, the processing core corresponding to the branch network needs to use the data of the processing core corresponding to the backbone network to perform prediction processing. When the processing cores corresponding to the branch network and the backbone network are located in different core clusters, how to effectively implement cross-cluster services between core clusters is a technical problem that needs to be solved urgently in the core cluster scenario of the many-core system.
图1为本公开实施例提供的一种基于众核系统的核共享方法的流程图。FIG. 1 is a flowchart of a core sharing method based on a many-core system according to an embodiment of the present disclosure.
参照图1,本公开实施例提供一种基于众核系统的核共享方法,其中众核系统包括预先配置的多个核心簇,每个核心簇包括至少一个第二处理核,该方法可以由核共享装置来执行,该装置可以通过软件和/或硬件的方式实现,该核共享方法包括:1 , an embodiment of the present disclosure provides a core sharing method based on a many-core system, wherein the many-core system includes a plurality of pre-configured core clusters, each core cluster includes at least one second processing core, and the method can be implemented by a core To execute by sharing a device, the device can be implemented by means of software and/or hardware, and the core sharing method includes:
步骤S1、接收核共享请求。Step S1, receiving a core sharing request.
步骤S2、根据所述核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为第一核心簇与第二核心簇之间的共享核,至少一个共享核组成共享核阵列。Step S2, according to the core sharing request, determine at least one second processing core from the second processing cores of the first core cluster and/or the predetermined second core cluster, as the first core cluster and the second core cluster. Shared cores between core clusters, at least one shared core forms a shared core array.
其中,共享核阵列被配置为接收并执行与第一核心簇和第二核心簇分别对应的任务,存储与第一核心簇的任务对应的第一任务数据,以及存储与第二核心簇的任务对应的第二任务数据。其中,第一任务数据包括第一输入数据、第一输出数据以及第一任务配置信息,第二任务数据包括第二输入数据、第二输出数据以及第二任务配置信息。The shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to the tasks of the first core cluster, and store tasks corresponding to the second core cluster Corresponding second task data. The first task data includes first input data, first output data, and first task configuration information, and the second task data includes second input data, second output data, and second task configuration information.
其中,输入数据例如可以是执行任务时所需的数据,输出数据例如可以是执行任务的结果,任务配置信息为执行任务所需的配置,例如可以是内存配置、路由配置、运算顺序配置、运算时间配置、运算算子配置等信息。本公开对输入数据、输出数据、任务配置信息的具体类别不作限制。The input data can be, for example, the data required to execute the task, the output data can be, for example, the result of executing the task, and the task configuration information is the configuration required to execute the task, such as memory configuration, routing configuration, operation sequence configuration, operation Time configuration, operator configuration and other information. The present disclosure does not limit the specific categories of input data, output data, and task configuration information.
在本公开实施例中,第一核心簇为众核系统的多个核心簇中的任一核心簇,第二核心簇为众核系统中第一核心簇以外的任一核心簇,第二核心簇的数量可以是一个,也可以是多个。In the embodiment of the present disclosure, the first core cluster is any core cluster among the multiple core clusters in the many-core system, the second core cluster is any core cluster other than the first core cluster in the many-core system, and the second core cluster is any core cluster other than the first core cluster in the many-core system. The number of clusters can be one or more.
本公开实施例所提供的基于众核系统的核共享方法,在众核系统包括多个核心簇的业务场景下,对于有跨簇业务需求的多个核心簇,通过将任一个核心簇或多个核心簇中的至少一个第二处理核作为多个核心簇之间的共享核,多个核心簇可以共用该共享核的数据(例如深度学习网络中所需的参数等),从而实现了众核系统的多个核心簇间的跨簇业务,满足了多个核心簇需共用一些处理核的数据的需求,提高了众核系统中部分处理核的控制能力以及提高了众核系统进行任务处理的灵活性。In the core sharing method based on the many-core system provided by the embodiments of the present disclosure, in the business scenario where the many-core system includes multiple core clusters, for multiple core clusters that have cross-cluster business requirements, any core cluster or multiple core clusters can be used for multiple core clusters. At least one second processing core in the core clusters is used as a shared core among multiple core clusters, and multiple core clusters can share the data of the shared core (for example, parameters required in the deep learning network, etc.), thereby realizing multiple core clusters. The cross-cluster business between multiple core clusters of the core system satisfies the requirement that multiple core clusters need to share the data of some processing cores, improves the control ability of some processing cores in the many-core system, and improves the task processing of the many-core system. flexibility.
图2为本公开实施例提供的一种众核系统的组成框图,在本公开实施例中,参见图2,在每个核心簇中均具有一主处理核,该主处理核为该核心簇的至少一个第二处理核中预先指定的一第二处理核。本公开实施例的核共享方法可以应用于众核系统中任一核心簇的主处理核,即本公开实施例的核共享方法基于任一核心簇的主处理核实现,主处理核可以用于处理自身所在核心簇对应的任务,同时还可以用于进行簇内的任务分配和管理。FIG. 2 is a block diagram of the composition of a many-core system provided by an embodiment of the present disclosure. In an embodiment of the present disclosure, referring to FIG. 2 , each core cluster has a main processing core, and the main processing core is the core cluster. A pre-designated second processing core among the at least one second processing core. The core sharing method of the embodiment of the present disclosure can be applied to the main processing core of any core cluster in the many-core system, that is, the core sharing method of the embodiment of the present disclosure is implemented based on the main processing core of any core cluster, and the main processing core can be used for It handles the tasks corresponding to its own core cluster, and can also be used for task allocation and management within the cluster.
在一些实施例中,当众核系统中至少一个第二核心簇需要使用第一核心簇中的一个或多个第二处理核的数据(如参数)时,则第二核心簇的主处理核可以向第一核心簇的主处理核发送核共享请求,核共享请求中可以包括但不限于:第二核心簇对应的标识信息、地址信息、需共享第一核心簇中的一个或多个第二处理核的信息等。此种情形下,在步骤S1中,第一核心簇的主处理核接收第二核心簇的主处理核发送的核共享请求,其中第二核心簇的主处理核为第二核心簇的至少一个第二处理核中预先指定的第二处理核。In some embodiments, when at least one second core cluster in the many-core system needs to use data (eg, parameters) of one or more second processing cores in the first core cluster, the main processing core of the second core cluster may Send a core sharing request to the main processing core of the first core cluster. The core sharing request may include but is not limited to: identification information, address information corresponding to the second core cluster, one or more second core clusters to be shared in the first core cluster Processing core information, etc. In this case, in step S1, the main processing core of the first core cluster receives the core sharing request sent by the main processing core of the second core cluster, wherein the main processing core of the second core cluster is at least one of the second core cluster. A pre-designated second processing core among the second processing cores.
在一些实施例中,参见图2,众核系统包括多个处理核,其中,一处理核预先被指定为第一处理核,其余处理核为第二处理核,第一处理核用于接收来自外部主机发送的待处理任务,并在众核系统中组建用于处理待处理任务的核心簇,对待处理任务在众核系统中进行调度和管理。In some embodiments, referring to FIG. 2 , the many-core system includes a plurality of processing cores, wherein one processing core is pre-designated as the first processing core, and the remaining processing cores are the second processing cores, and the first processing core is used for receiving data from The tasks to be processed sent by the external host, and the core cluster for processing the tasks to be processed is formed in the many-core system, and the tasks to be processed are scheduled and managed in the many-core system.
当外部主机或第一处理核需要给多个核心簇建立或分配一个公共任务时,外部主机或第一处理核可以选取该多个核心簇中的任一个核心簇作为第一核心簇,而其余核心簇作为第二核心簇,外部主机或第一处理核可以先向第一核心簇的主处理核发送核共享请求,核共享请求中可以包括但不限于公共任务、第二核心簇对应的标识信息、地址信息等,以使第一核心簇的主处理核组建用于处理公共任务的共享核。When the external host or the first processing core needs to establish or assign a common task to multiple core clusters, the external host or the first processing core can select any one of the multiple core clusters as the first core cluster, and the rest As the core cluster is the second core cluster, the external host or the first processing core can first send a core sharing request to the main processing core of the first core cluster. The core sharing request may include but not limited to common tasks and the identifier corresponding to the second core cluster. information, address information, etc., so that the main processing cores of the first core cluster form shared cores for processing common tasks.
此种情形下,在步骤S1中,第一核心簇的主处理核接收外部主机或第一处理核发送的核共享请求,核共享请求为外部主机或第一处理核基于与第一核心簇和第二核心簇所对应的公共任务而生成的。In this case, in step S1, the main processing core of the first core cluster receives the core sharing request sent by the external host or the first processing core, and the core sharing request is based on the external host or the first processing core and the first core cluster and the core sharing request. It is generated by the public tasks corresponding to the second core cluster.
其中,公共任务是指第一核心簇和第二核心簇均需要执行的任务,例如第一核心簇需要执行快速傅里叶变换任务(FFT)和窗函数滤波任务,第二核心簇需要执行快速傅里叶变换任务(FFT)和频域乘法任务,则快速傅里叶变换任务(FFT)即为第一核心簇和第二核心簇所对应的公共任务,例如公共任务可以是神经网络的骨干网络中的复杂数学运算(如矩阵分解,FFT等)任务。Among them, common tasks refer to tasks that both the first core cluster and the second core cluster need to perform. For example, the first core cluster needs to perform fast Fourier transform tasks (FFT) and window function filtering tasks, and the second core cluster needs to perform fast Fourier transform task (FFT) and frequency domain multiplication task, the fast Fourier transform task (FFT) is the common task corresponding to the first core cluster and the second core cluster, for example, the common task can be the backbone of the neural network Complex mathematical operations (such as matrix factorization, FFT, etc.) tasks in the network.
在一些实施例中,在步骤S2中,第一核心簇的主处理核在接收到来自第二核心簇的主处理核的核共享请求之后,根据该核共享请求,从自身所在的第一核心簇的至少一个第二处理核中确定出至少一个第二处理核,该确定出的第二处理核作为共享核,至少一个共享核组成共享核阵列。其中,共享核的数量具体可以根据第二核心簇的主处理核请求共享的第二处理核的数量确定,本公开实施例对此不作限制。In some embodiments, in step S2, after receiving the core sharing request from the main processing core of the second core cluster, the main processing core of the first core cluster, according to the core sharing request, from the first core where it is located. At least one second processing core is determined from at least one second processing core of the cluster, the determined second processing core is used as a shared core, and the at least one shared core forms a shared core array. The number of shared cores may be specifically determined according to the number of second processing cores requested to be shared by the main processing cores of the second core cluster, which is not limited in this embodiment of the present disclosure.
通过这种方式,实现了多个核心簇间的跨簇业务,满足了多个核心簇需共用一些处 理核的数据的需求,提高了众核系统中部分处理核(如核心簇的主处理核)的控制能力以及各簇的任务处理的灵活性。In this way, cross-cluster services between multiple core clusters are realized, the data requirements of multiple core clusters sharing some processing cores are met, and some processing cores in the many-core system (such as the main processing core of the core cluster) are improved. ) and the flexibility of task processing for each cluster.
在一些实施例中,在步骤S2中,第一核心簇的主处理核在接收到来自外部主机或众核系统中的第一处理核的核共享请求之后,根据核共享请求,从自身所在的第一核心簇的至少一个第二处理核中确定出至少一个第二处理核,该确定出的第二处理核作为共享核,至少一个共享核组成共享核阵列。其中,共享核的数量可以根据公共任务所需的资源需求量确定,本公开实施例对此不作限制,只要使得组建的共享核的总剩余资源量能够满足(大于或等于)公共任务所需的资源需求量即可。In some embodiments, in step S2, after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, At least one second processing core is determined in at least one second processing core of the first core cluster, the determined second processing core is used as a shared core, and the at least one shared core forms a shared core array. The number of shared cores may be determined according to the resource requirements required by the common tasks, which is not limited in the embodiments of the present disclosure, as long as the total remaining resources of the formed shared cores can meet (greater than or equal to) the required resources for the common tasks. resource requirements.
其中,公共任务所需的资源需求量是指执行该公共任务时所需的资源量,例如资源可以是计算资源、存储资源、带宽资源。对于需要处理公共任务的多个核心簇,通过组建多个核心簇间的共享核,用于处理公共任务,从而提高了任务的处理效率和灵活性,同时实现了众核系统的多个核心簇间的跨簇业务,满足了多个核心簇需共用一些处理核的数据的需求。The resource requirement required by the common task refers to the amount of resources required to perform the common task, for example, the resources may be computing resources, storage resources, and bandwidth resources. For multiple core clusters that need to process common tasks, by forming shared cores among multiple core clusters to process common tasks, the processing efficiency and flexibility of the tasks are improved, and multiple core clusters of the many-core system are realized at the same time. The cross-cluster business between multiple core clusters satisfies the requirement that multiple core clusters need to share some processing core data.
在一些实施例中,第一核心簇的主处理核选取空闲的第二处理核作为共享核。在一些实施例中,在接收到第二核心簇的主处理核的核共享请求的情形下,若自身所在的第一核心簇中不存在空闲的第二处理核,则向第二核心簇的主处理核返回核共享请求失败消息。在一些实施例中,在接收到外部主机或第一处理核的核共享请求的情形下,若自身所在的第一核心簇中不存在空闲的第二处理核,则向外部主机或第一处理核返回核共享请求失败消息。In some embodiments, the main processing core of the first core cluster selects an idle second processing core as a shared core. In some embodiments, in the case of receiving a core sharing request from the main processing core of the second core cluster, if there is no idle second processing core in the first core cluster where the second core cluster is located, the request to the second core cluster The main processing core returns a core sharing request failure message. In some embodiments, in the case of receiving a core sharing request from the external host or the first processing core, if there is no idle second processing core in the first core cluster where the user is located, the external host or the first processing core is sent to the external host or the first processing core. The core returns a core share request failure message.
在一些实施例中,在步骤S2中,第一核心簇的主处理核在接收到来自外部主机或众核系统中的第一处理核的核共享请求之后,根据核共享请求,从第二核心簇的至少一个第二处理核中确定出至少一个第二处理核,该确定出的第二处理核作为第一核心簇和第二核心簇之间的共享核。In some embodiments, in step S2, after receiving the core sharing request from the external host or the first processing core in the many-core system, the primary processing core of the first core cluster, according to the core sharing request, from the second core At least one second processing core is determined from at least one second processing core of the cluster, and the determined second processing core serves as a shared core between the first core cluster and the second core cluster.
在一些实施例中,在步骤S2中,第一核心簇的主处理核在接收到来自外部主机或众核系统中的第一处理核的核共享请求之后,根据核共享请求,若自身所在的第一核心簇中不存在可用(空闲)的第二处理核,则从第二核心簇的至少一个第二处理核中确定出至少一个第二处理核,该确定出的第二处理核作为第一核心簇和第二核心簇之间的共享核。In some embodiments, in step S2, after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, according to the core sharing request, There is no available (idle) second processing core in the first core cluster, then at least one second processing core is determined from at least one second processing core in the second core cluster, and the determined second processing core is used as the first processing core. A shared core between a core cluster and a second core cluster.
举例来说,从第二核心簇的至少一个第二处理核中确定出至少一个第二处理核,以作为共享核,包括:向第二核心簇的主处理核发送核共享请求,以供第二核心簇的主处理核响应于核共享请求,从自身所在核心簇的至少一个第二处理核中确定出至少一个第二处理核,以作为共享核。For example, determining at least one second processing core from the at least one second processing core of the second core cluster as a shared core includes: sending a core sharing request to the main processing core of the second core cluster for the first In response to the core sharing request, the main processing core of the two-core cluster determines at least one second processing core from at least one second processing core in the core cluster where it is located as a shared core.
需要说明的是,在本公开实施例中,第一核心簇和第二核心簇中的“第一”、“第二”只是为了区分不同的核心簇,并非特指某一个核心簇,在众核系统中,所有核心簇的地位等同,均可以作为第一核心簇接收核共享请求,并响应于核共享请求执行核共享方法,所有核心簇中的每个核心簇也均可以作为第二核心簇向其他核心簇请求核共享, 本公开实施例对此不作限制。It should be noted that, in the embodiments of the present disclosure, “first” and “second” in the first core cluster and the second core cluster are only for distinguishing different core clusters, and do not refer to a particular core cluster. In the core system, all the core clusters have the same status, can receive the core sharing request as the first core cluster, and execute the core sharing method in response to the core sharing request, and each core cluster in all the core clusters can also be used as the second core. The cluster requests core sharing from other core clusters, which is not limited in this embodiment of the present disclosure.
在一些实施例中,第一核心簇的主处理核在接收到来自外部主机或众核系统中的第一处理核的核共享请求之后,根据核共享请求,从自身所在第一核心簇的至少一个第二处理核中确定出至少一个第二处理核,以作为共享核,并从第二核心簇的至少一个第二处理核中确定出至少一个第二处理核,以作为共享核。换言之,可从第一核心簇中筛选出一部分第二处理核,并从第二核心簇中筛选出一部分第二处理核,共同作为共享核。In some embodiments, after receiving the core sharing request from the external host or the first processing core in the many-core system, the main processing core of the first core cluster, according to the core sharing request, from at least one of the first core cluster where it is located. At least one second processing core is determined from one second processing core as a shared core, and at least one second processing core is determined from at least one second processing core of the second core cluster as a shared core. In other words, a part of the second processing cores can be selected from the first core cluster, and a part of the second processing cores can be selected from the second core cluster as shared cores together.
在一些实施例中,第一核心簇或第二核心簇的主处理核在确定出作为共享核的第二处理核之后,还对该第二处理核进行标记,以将该第二处理核标记为已共享,以便进行簇内各核的管理。In some embodiments, after determining the second processing core as the shared core, the main processing core of the first core cluster or the second core cluster further marks the second processing core to mark the second processing core It is shared for the management of each core in the cluster.
图3为本公开实施例提供的一种核共享方法的流程图。FIG. 3 is a flowchart of a core sharing method according to an embodiment of the present disclosure.
参照图3,为了便于进行管理,在一些实施例中,在步骤S2中确定出至少一个第二处理核之后,该核共享方法还包括:3, in order to facilitate management, in some embodiments, after the at least one second processing core is determined in step S2, the core sharing method further includes:
步骤S3、更新与共享核对应的核心簇列表,更新后的核心簇列表包括第一核心簇和第二核心簇分别对应的标识信息。Step S3: Update the core cluster list corresponding to the shared core, where the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
作为示例,在共享之前,每个簇中各第二处理核均预先存储有各自所在核心簇对应的核心簇列表,在核心簇列表中包括但不限于:该第二处理核所在核心簇对应的标识信息、簇内各成员信息,簇内各成员信息包括但不限于:各成员的标识、地址、位置等。As an example, before sharing, each second processing core in each cluster prestores a core cluster list corresponding to the core cluster where the second processing core is located, and the core cluster list includes but is not limited to: the core cluster corresponding to the core cluster where the second processing core is located Identification information, information of each member in the cluster, the information of each member in the cluster includes but not limited to: the identification, address, location, etc. of each member.
作为示例,第一核心簇的主处理核在确定出共享核之后,在各共享核的核心簇列表中添加第二核心簇对应的标识信息,从而更新各共享核分别对应的核心簇列表,更新后的核心簇列表包括第一核心簇和第二核心簇分别对应的标识信息,以便于共享核识别后续作业归属于第一核心簇或第二核心簇,并进行相应处理。As an example, after determining the shared core, the main processing core of the first core cluster adds the identification information corresponding to the second core cluster in the core cluster list of each shared core, thereby updating the core cluster list corresponding to each shared core, and updating The latter list of core clusters includes identification information corresponding to the first core cluster and the second core cluster, so that the shared core can identify that subsequent jobs belong to the first core cluster or the second core cluster, and perform corresponding processing.
在一些实施例中,第一核心簇的主处理核在确定出共享核之后,还向第二核心簇反馈共享核的信息,该信息包括但不限于共享核的标识、地址信息等,以便于第二核心簇中的处理核能够访问共享核,以获取所需的数据,或者通过共享核实现所需的业务等。In some embodiments, after determining the shared core, the main processing core of the first core cluster also feeds back information of the shared core to the second core cluster, the information including but not limited to the identification and address information of the shared core, so as to facilitate The processing cores in the second core cluster can access the shared core to obtain required data, or implement required services through the shared core.
在一些实施例中,在接收外部主机或第一处理核发送的核共享请求的情形下,若第一核心簇的主处理核将核共享请求发送给第二核心簇的主处理核,则第二核心簇的主处理核在确定出共享核之后,还向第一核心簇反馈共享核的信息,该信息包括但不限于共享核的标识、地址信息等,以便于第一核心簇中的处理核能够访问共享核,以获取所需的数据,或者通过共享核实现所需的业务等。In some embodiments, in the case of receiving the core sharing request sent by the external host or the first processing core, if the main processing core of the first core cluster sends the core sharing request to the main processing core of the second core cluster, the After determining the shared core, the main processing core of the two-core cluster also feeds back the information of the shared core to the first core cluster, the information including but not limited to the identification and address information of the shared core, so as to facilitate the processing in the first core cluster The cores can access the shared cores to obtain the required data, or implement the required services through the shared cores.
图4为本公开实施例提供的一种核共享方法的流程图。FIG. 4 is a flowchart of a core sharing method provided by an embodiment of the present disclosure.
参照图4,在一些实施例中,为了有效解决共享核对于不同核心簇的数据的写入写出冲突的问题,在步骤S2中确定出至少一个第二处理核之后,该核共享方法还包括:Referring to FIG. 4 , in some embodiments, in order to effectively solve the problem of conflict between the writing and writing of data of different core clusters by the shared core, after the at least one second processing core is determined in step S2, the core sharing method further includes: :
步骤S4、判断与共享核阵列对应的存储区中是否存在可用存储空间,若存在,则执行步骤S5,否则执行步骤S7。Step S4 , judging whether there is available storage space in the storage area corresponding to the shared core array, if so, go to step S5 , otherwise go to step S7 .
在一些实施例中,进一步地,在判断出共享核阵列对应的存储区中存在可用存储空间之后,还可以进一步判断该可用存储空间的内存容量是否大于或等于预设内存容量, 若大于或等于预设内存容量,则执行步骤S5,否则执行步骤S7。其中,共享核阵列对应的存储区为共享核阵列中所有共享核的存储区。In some embodiments, after it is determined that there is available storage space in the storage area corresponding to the shared core array, it can be further determined whether the memory capacity of the available storage space is greater than or equal to the preset memory capacity, if greater than or equal to If the memory capacity is preset, step S5 is performed; otherwise, step S7 is performed. The storage area corresponding to the shared core array is the storage area of all shared cores in the shared core array.
其中,预设内存容量可为执行公共任务并存储公共任务的任务数据所需的总内存容量;也可为执行与所述第一核心簇和所述第二核心簇分别对应的任务,以及存储第一任务数据和第二任务数据所需的总内存容量。本公开对预设内存容量的具体取值不作限制。The preset memory capacity may be the total memory capacity required for executing common tasks and storing task data of the common tasks; it may also be executing tasks corresponding to the first core cluster and the second core cluster, and storing The total memory capacity required for the first task data and the second task data. The present disclosure does not limit the specific value of the preset memory capacity.
步骤S5、在与共享核阵列对应的的存储区中创建与第一核心簇对应的第一共享存储区域。Step S5: Create a first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array.
可以理解的是,在与共享核阵列对应的的存储区中创建与第一核心簇对应的第一共享存储区域,即为在共享核阵列的可用存储空间中创建第一共享存储区域。It can be understood that creating the first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array is to create the first shared storage area in the available storage space of the shared core array.
在步骤S5中,响应于判断出与共享核阵列对应的存储区中存在可用存储空间,在与共享核阵列对应的存储区中创建与第一核心簇对应的第一共享存储区域。在一些实施例中,响应于判断出与共享核阵列对应的存储区中存在可用存储空间,且判断出该可用存储空间的内存容量大于或等于预设内存容量,则在共享核阵列对应的存储区中创建与第一核心簇对应的第一共享存储区域。其中,第一共享存储区域用于存储第一核心簇的任务对应的第一任务数据。In step S5, in response to determining that there is available storage space in the storage area corresponding to the shared core array, a first shared storage area corresponding to the first core cluster is created in the storage area corresponding to the shared core array. In some embodiments, in response to determining that there is available storage space in the storage area corresponding to the shared core array, and determining that the memory capacity of the available storage space is greater than or equal to the preset memory capacity, the storage area corresponding to the shared core array A first shared storage area corresponding to the first core cluster is created in the area. The first shared storage area is used to store first task data corresponding to tasks of the first core cluster.
步骤S6、在共享核阵列对应的存储区中创建与第二核心簇对应的第二共享存储区域,并结束流程。Step S6: Create a second shared storage area corresponding to the second core cluster in the storage area corresponding to the shared core array, and end the process.
可以理解的是,在与共享核阵列对应的存储区中创建与第二核心簇对应的第二共享存储区域,即为在共享核阵列的可用存储空间中创建第二共享存储区域。其中,第二共享存储区域用于存储第二核心簇对应的任务的第二任务数据。It can be understood that creating the second shared storage area corresponding to the second core cluster in the storage area corresponding to the shared core array is to create the second shared storage area in the available storage space of the shared core array. The second shared storage area is used for storing second task data of the task corresponding to the second core cluster.
在一些实施例中,在与共享核阵列对应的存储区中创建与第二核心簇对应的第二共享存储区域之后,还包括:在与共享核阵列对应的存储区中创建通用共享存储区域,通用共享存储区域用于承载第一核心簇和第二核心簇分别对应的任务的执行运算过程。In some embodiments, after creating the second shared storage area corresponding to the second core cluster in the storage area corresponding to the shared core array, the method further includes: creating a general shared storage area in the storage area corresponding to the shared core array, The general shared storage area is used to carry the execution and operation process of the tasks corresponding to the first core cluster and the second core cluster respectively.
步骤S7、确定众核系统中不归属于任何核心簇的处理核中空闲的处理核。Step S7: Determine the idle processing cores among the processing cores that do not belong to any core cluster in the many-core system.
步骤S8、将至少一个该空闲的处理核添加至第一核心簇,并将该至少一个空闲的处理核确定为共享核,并加入共享核阵列,并跳转至步骤S5。Step S8: Add at least one of the idle processing cores to the first core cluster, determine the at least one idle processing core as a shared core, add it to the shared core array, and jump to step S5.
在步骤S7中,响应于判断出与共享核阵列对应的存储区中不存在可用存储空间,确定众核系统中不归属于任何核心簇的处理核中空闲的处理核。在一些实施例中,响应于判断出共享核阵列的可用存储空间的内存容量小于预设内存容量,确定众核系统中不归属于任何核心簇的处理核中空闲的处理核。In step S7, in response to determining that there is no available storage space in the storage area corresponding to the shared core array, determine an idle processing core among the processing cores that do not belong to any core cluster in the many-core system. In some embodiments, in response to determining that the memory capacity of the available storage space of the shared core array is less than the preset memory capacity, determining an idle processing core among the processing cores not belonging to any core cluster in the many-core system.
在一些实施例中,在步骤S7中,第一核心簇的主处理核可以监控或获取众核系统中各处理核的状态,从而可以确定众核系统中当前可用的所有处理核,即空闲的处理核。In some embodiments, in step S7, the main processing core of the first core cluster can monitor or obtain the status of each processing core in the many-core system, so as to determine all processing cores currently available in the many-core system, that is, idle Process the nucleus.
在一些实施例中,在步骤S8中,将至少一个空闲的处理核添加至自身所在的第一核心簇可以进一步包括:创建该空闲的处理核的标识,并将该空闲的处理核的标识、地址及位置等信息添加至自身所在第一核心簇对应的核心簇列表,以更新自身所在第一核心簇对应的核心簇列表,同时将自身所在第一核心簇对应的核心簇列表发送给该空闲的 处理核进行存储。In some embodiments, in step S8, adding at least one idle processing core to the first core cluster where it is located may further include: creating an identifier of the idle processing core, and adding the identifier of the idle processing core, Add information such as address and location to the core cluster list corresponding to the first core cluster where you are located to update the core cluster list corresponding to the first core cluster where you are located, and at the same time send the core cluster list corresponding to the first core cluster where you are located to the idler processing core for storage.
在一些实施例中,在接收到核共享请求之后,若自身所在的第一核心簇中不存在空闲的第二处理核,则还可以进一步跳转至步骤S7。In some embodiments, after receiving the core sharing request, if there is no idle second processing core in the first core cluster where the user is located, the process may further jump to step S7.
在一些实施例中,确定出的共享核阵列包括一个共享核,则在步骤S5、步骤S6中,从该共享核的存储区中创建与第一核心簇对应的第一共享存储区域,并创建与第二核心簇对应的第二共享存储区域,同时还可以创建用于承载任务的运算过程的通用共享存储区域。In some embodiments, the determined shared core array includes one shared core, then in step S5 and step S6, create a first shared storage area corresponding to the first core cluster from the storage area of the shared core, and create The second shared storage area corresponding to the second core cluster can also create a general shared storage area for carrying the operation process of the task.
在一些实施例中,确定出的共享核阵列包括多个共享核,其中,第一核心簇对应的第一共享存储区域可以对应阵列中的一个或多个共享核,也即第一核心簇对应的第一共享存储区域包括一个或多个共享核的存储区;同理,第二核心簇对应的第二共享存储区域也可以对应阵列中的一个或多个共享核,也即第二核心簇对应的第二共享存储区域包括一个或多个共享核的存储区;同理,通用共享存储区域也可以对应一个或多个共享核,也即通用共享存储区域包括一个或多个共享核的存储区。其中,不同区域对应的共享核不同。In some embodiments, the determined shared core array includes multiple shared cores, wherein the first shared storage area corresponding to the first core cluster may correspond to one or more shared cores in the array, that is, the first core cluster corresponds to The first shared storage area includes one or more shared core storage areas; similarly, the second shared storage area corresponding to the second core cluster may also correspond to one or more shared cores in the array, that is, the second core cluster The corresponding second shared storage area includes storage areas of one or more shared cores; similarly, the general shared storage area may also correspond to one or more shared cores, that is, the general shared storage area includes storage areas of one or more shared cores. Area. Among them, the shared kernels corresponding to different regions are different.
换言之,在共享核阵列包括多个共享核的情形下,可以将多个共享核分成不同的区域,其中一个区域对应第一核心簇,用于存储第一核心簇的任务对应的第一任务数据,一个区域对应第二核心簇,用于存储第二核心簇的任务对应的第二任务数据,另一个区域作为第一核心簇和第二核心簇通用的计算通路区域,用于承载第一核心簇和第二核心簇分别对应的任务的执行运算过程。In other words, in the case where the shared core array includes multiple shared cores, the multiple shared cores can be divided into different areas, one of which corresponds to the first core cluster and is used to store the first task data corresponding to the tasks of the first core cluster , one area corresponds to the second core cluster, and is used to store the second task data corresponding to the tasks of the second core cluster, and the other area is used as a common computing path area for the first core cluster and the second core cluster, which is used to carry the first core cluster. The execution operation process of the tasks corresponding to the cluster and the second core cluster respectively.
图5为本公开实施例中一种共享核阵列的结构示意图。参见图5,在一些实施例中,共享核阵列包括多个共享核,共享核阵列对应的存储区包括第一核心簇对应的第一共享存储区域M1、第二核心簇对应的第二共享存储区域M2、以及通用共享存储区域M0,第一共享存储区域、第二共享存储区域和通用共享存储区域可以分别对应一个或多个共享核。其中,第一共享存储区域M1对应的共享核可以被配置为存储第一核心簇的任务对应的第一任务数据,包括第一输入数据、第一输出数据以及第一任务配置信息;第二共享存储区域M2对应的共享核可以被配置为存储第二核心簇的任务对应的第二任务数据,包括第二输入数据、第二输出数据以及第二任务配置信息;通用共享存储区域M0对应的共享核可以被配置为接收并执行第一核心簇和第二核心簇分别对应的任务,也即承载第一核心簇和第二核心簇的任务的运算过程。FIG. 5 is a schematic structural diagram of a shared core array according to an embodiment of the disclosure. Referring to FIG. 5 , in some embodiments, the shared core array includes a plurality of shared cores, and the storage area corresponding to the shared core array includes a first shared storage area M1 corresponding to the first core cluster, and a second shared storage area corresponding to the second core cluster. The area M2, the general shared storage area M0, the first shared storage area, the second shared storage area and the general shared storage area may respectively correspond to one or more shared cores. The shared core corresponding to the first shared storage area M1 may be configured to store first task data corresponding to tasks of the first core cluster, including first input data, first output data, and first task configuration information; the second shared The shared core corresponding to the storage area M2 may be configured to store the second task data corresponding to the tasks of the second core cluster, including the second input data, the second output data and the second task configuration information; the shared core corresponding to the general shared storage area M0 The core may be configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, that is, an operation process carrying the tasks of the first core cluster and the second core cluster.
在一些实施例中,参照图5,第一共享存储区域M1可以包括第一输入数据区域、第一输出数据区域以及第一任务配置区域,第一输入数据区域被配置为存储第一核心簇的任务对应的第一输入数据;第一输出数据区域被配置为存储第一核心簇的任务对应的第一输出数据;第一任务配置区域被配置为存储第一核心簇的任务对应的第一任务配置信息。In some embodiments, referring to FIG. 5 , the first shared storage area M1 may include a first input data area, a first output data area, and a first task configuration area, and the first input data area is configured to store the data of the first core cluster. the first input data corresponding to the task; the first output data area is configured to store the first output data corresponding to the task of the first core cluster; the first task configuration area is configured to store the first task corresponding to the task of the first core cluster configuration information.
在一些实施例中,第一共享存储区域M1对应多个共享核,第一输入数据区域、第一输出数据区域以及第一任务配置区域可以分别对应一个或多个共享核,第一输入数据 区域对应的共享核被配置为存储第一输入数据,第一输出数据区域对应的共享核被配置为存储第一输出数据,第一任务配置区域对应的共享核被配置为存储第一任务配置信息。In some embodiments, the first shared storage area M1 corresponds to multiple shared cores, the first input data area, the first output data area, and the first task configuration area may correspond to one or more shared cores, respectively, and the first input data area The corresponding shared core is configured to store the first input data, the shared core corresponding to the first output data area is configured to store the first output data, and the shared core corresponding to the first task configuration area is configured to store the first task configuration information.
在一些实施例中,参照图5,第二共享存储区域M2可以包括第二输入数据区域、第二输出数据区域以及第二任务配置区域,第二输入数据区域被配置为存储第二核心簇的任务对应的第二输入数据;第二输出数据区域被配置为存储第二核心簇的任务对应的第二输出数据;第二任务配置区域被配置为存储第二核心簇的任务对应的第二任务配置信息。In some embodiments, referring to FIG. 5 , the second shared storage area M2 may include a second input data area, a second output data area, and a second task configuration area, and the second input data area is configured to store the data of the second core cluster. the second input data corresponding to the task; the second output data area is configured to store the second output data corresponding to the task of the second core cluster; the second task configuration area is configured to store the second task corresponding to the task of the second core cluster configuration information.
在一些实施例中,第二共享存储区域M2对应多个共享核,第二输入数据区域、第二输出数据区域以及第二任务配置区域可以分别对应一个或多个共享核,第二输入数据区域对应的共享核被配置为存储第二输入数据,第二输出数据区域对应的共享核被配置为存储第二输出数据,第二任务配置区域对应的共享核被配置为存储第二任务配置信息。In some embodiments, the second shared memory area M2 corresponds to multiple shared cores, the second input data area, the second output data area, and the second task configuration area may respectively correspond to one or more shared cores, and the second input data area The corresponding shared core is configured to store the second input data, the shared core corresponding to the second output data area is configured to store the second output data, and the shared core corresponding to the second task configuration area is configured to store the second task configuration information.
在一些实施例中,共享核阵列对应配置有任务列表,该任务列表可以存储于第一核心簇的主处理核和/或第二核心簇的主处理核,共享核阵列可以按照任务列表中的任务顺序进行任务的处理,任务列表中可以包括但不限于:计算任务、信令任务、切换任务等。其中,计算任务例如是用于指示进行运算、计算等操作的任务,信令任务例如是用于指示向对应的核心簇发送所需的通知、请求等的任务,切换任务例如是用于在共享核从服务于一个核心簇切换至服务于另一个核心簇的情形下,指示进行缓冲区重置以及输入输出地址切换等操作的任务。在任务处理完成后,任务列表中相应的任务将被清除。In some embodiments, the shared core array is correspondingly configured with a task list, the task list may be stored in the main processing core of the first core cluster and/or the main processing core of the second core cluster, and the shared core array may be configured according to the task list. The tasks are processed in sequence, and the task list may include, but is not limited to, computing tasks, signaling tasks, switching tasks, and the like. Among them, the computing task is, for example, a task for instructing to perform operations such as computation, calculation, etc., the signaling task is for example a task for instructing to send the required notification, request, etc. to the corresponding core cluster, and the switching task is for example, for sharing When the core switches from serving one core cluster to serving another core cluster, instructs the task of performing operations such as buffer reset and input and output address switching. After the task is processed, the corresponding task in the task list will be cleared.
图6为本公开实施例提供的一种核共享装置的组成框图。FIG. 6 is a block diagram of the composition of a core sharing apparatus according to an embodiment of the present disclosure.
参照图6,本公开实施例提供了一种核共享装置300,该核共享装置300应用于众核系统,该众核系统包括预先配置的多个核心簇,每个核心簇包括至少一个第二处理核,该核共享装置300包括:接收模块301和共享确定模块302。Referring to FIG. 6 , an embodiment of the present disclosure provides a core sharing apparatus 300 , and the core sharing apparatus 300 is applied to a many-core system, where the many-core system includes a plurality of preconfigured core clusters, and each core cluster includes at least one second core cluster. Processing cores, the core sharing apparatus 300 includes: a receiving module 301 and a sharing determination module 302 .
其中,接收模块301用于接收核共享请求;共享确定模块302用于根据核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为该第一核心簇与第二核心簇间的共享核,至少一个共享核组成共享核阵列。其中,共享核阵列被配置为接收并执行该第一核心簇和该第二核心簇分别对应的任务,存储第一核心簇的任务对应的第一任务数据,以及存储第二核心簇的任务对应的第二任务数据。The receiving module 301 is configured to receive a core sharing request; the sharing determining module 302 is configured to determine at least one first core cluster from the second processing cores of the first core cluster and/or the second predetermined core cluster according to the core sharing request. Two processing cores are used as shared cores between the first core cluster and the second core cluster, and at least one shared core forms a shared core array. The shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to tasks of the first core cluster, and store tasks corresponding to the second core cluster of the second task data.
在一些实施例中,所述众核系统还包括第一处理核,所述接收模块301,用于:接收外部主机或第一处理核发送的核共享请求,所述核共享请求为所述外部主机或所述第一处理核基于与所述第一核心簇和所述第二核心簇对应的公共任务而生成的;或,接收所述第二核心簇的主处理核发送的核共享请求,所述第二核心簇的主处理核为所述第二核心簇的至少一个第二处理核中预先指定的第二处理核。In some embodiments, the many-core system further includes a first processing core, and the receiving module 301 is configured to: receive a core sharing request sent by an external host or a first processing core, where the core sharing request is the external Generated by the host or the first processing core based on common tasks corresponding to the first core cluster and the second core cluster; or, receiving a core sharing request sent by the main processing core of the second core cluster, The main processing core of the second core cluster is a pre-designated second processing core in at least one second processing core of the second core cluster.
在一些实施例中,该核共享装置300还包括更新模块(图中未示出),更新模块用于在共享确定模块302确定出至少一个第二处理核之后,更新与所述共享核对应的核心簇列表,更新后的所述核心簇列表包括与所述第一核心簇和所述第二核心簇分别对应的标识信息。In some embodiments, the core sharing apparatus 300 further includes an update module (not shown in the figure), the update module is configured to update the corresponding to the shared core after the sharing determination module 302 determines at least one second processing core A core cluster list, where the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
在一些实施例中,该核共享装置300还包括共享存储区创建模块(图中未示出),共享存储区创建模块用于:在共享确定模块302确定出至少一个第二处理核之后,在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域,所述第一共享存储区域用于存储所述第一任务数据;在与所述共享核阵列对应的存储区中创建与所述第二核心簇对应的第二共享存储区域,所述第二共享存储区域用于存储所述第二任务数据。In some embodiments, the core sharing apparatus 300 further includes a shared storage area creation module (not shown in the figure), and the shared storage area creation module is configured to: after the sharing determination module 302 determines the at least one second processing core, A first shared storage area corresponding to the first core cluster is created in the storage area corresponding to the shared core array, and the first shared storage area is used to store the first task data; A second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the array, and the second shared storage area is used to store the second task data.
在一些实施例中,该核共享装置300还包括判断模块(图中未示出),判断模块用于在共享存储区创建模块创建第一共享存储区域之前,判断与所述共享核阵列对应的存储区中是否存在可用存储空间;响应于判断出与所述共享核阵列对应的存储区中存在可用存储空间,执行在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域的步骤。In some embodiments, the core sharing apparatus 300 further includes a judging module (not shown in the figure), the judging module is used for judging the corresponding to the shared core array before the shared memory area creation module creates the first shared memory area. Whether there is available storage space in the storage area; in response to judging that there is available storage space in the storage area corresponding to the shared core array, executing the creation of the first core cluster in the storage area corresponding to the shared core array Corresponding steps of the first shared storage area.
在一些实施例中,该核共享装置300还包括核扩充模块(图中未示出),核扩充模块用于响应于判断模块判断出与共享核阵列对应的存储区中不存在可用存储空间,确定众核系统中不归属于任何核心簇的处理核中空闲的处理核;将至少一个空闲的处理核确定为共享核,并加入所述共享核阵列中。In some embodiments, the core sharing apparatus 300 further includes a core expansion module (not shown in the figure), and the core expansion module is configured to respond to the judgment module for judging that there is no available storage space in the storage area corresponding to the shared core array, Determine an idle processing core among the processing cores that do not belong to any core cluster in the many-core system; determine at least one idle processing core as a shared core, and add it to the shared core array.
在一些实施例中,所述共享核的数量为多个,所述共享核阵列对应的存储区还包括通用共享存储区域,所述第一共享存储区域、所述第二共享存储区域和所述通用共享存储区域分别对应一个或多个共享核;其中,所述第一共享存储区域对应的共享核被配置为存储所述第一任务数据;所述第二共享存储区域对应的共享核被配置为存储所述第二任务数据;所述通用共享存储区域对应的共享核被配置为接收并执行分别与所述第一核心簇和所述第二核心簇对应的任务。In some embodiments, the number of the shared cores is multiple, the storage area corresponding to the shared core array further includes a general shared storage area, the first shared storage area, the second shared storage area and the The general shared storage area corresponds to one or more shared cores respectively; wherein, the shared core corresponding to the first shared storage area is configured to store the first task data; the shared core corresponding to the second shared storage area is configured In order to store the second task data; the shared cores corresponding to the common shared storage area are configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively.
在一些实施例中,所述第一任务数据包括第一输入数据、第一输出数据和第一任务配置信息,所述第一共享存储区域包括第一输入数据区域、第一输出数据区域以及第一任务配置区域;其中,所述第一输入数据区域中的共享核被配置为存储所述第一输入数据;所述第一输出数据区域中的共享核被配置为存储所述第一输出数据;所述第一任务配置区域中的共享核被配置为存储所述第一任务配置信息。In some embodiments, the first task data includes first input data, first output data, and first task configuration information, and the first shared storage area includes a first input data area, a first output data area, and a first a task configuration area; wherein the shared cores in the first input data area are configured to store the first input data; the shared cores in the first output data area are configured to store the first output data ; the shared core in the first task configuration area is configured to store the first task configuration information.
此外,本公开实施例所提供的核共享装置300,用于实现上述的核共享方法,关于该核共享装置300的其他描述可参见上述核共享方法中的描述,此处不再赘述。In addition, the core sharing apparatus 300 provided by the embodiments of the present disclosure is used to implement the above-mentioned core sharing method. For other descriptions of the core sharing apparatus 300, reference may be made to the description in the above-mentioned core sharing method, which will not be repeated here.
本公开实施例还提供了一种处理核,该处理核包括上述的核共享装置。An embodiment of the present disclosure also provides a processing core, where the processing core includes the above-mentioned core sharing device.
图7为本公开实施例提供的一种电子设备的组成框图。FIG. 7 is a block diagram of the composition of an electronic device according to an embodiment of the present disclosure.
参照图7,本公开实施例提供了一种电子设备,该电子设备包括多个处理核701以及片上网络702,其中,多个处理核701均与片上网络702连接,片上网络702用于交互多个处理核间的数据和外部数据。7, an embodiment of the present disclosure provides an electronic device, the electronic device includes multiple processing cores 701 and an on-chip network 702, wherein the multiple processing cores 701 are all connected to the on-chip network 702, and the on-chip network 702 is used for interacting multiple data between cores and external data.
其中,一个或多个处理核701中存储有一个或多个指令,一个或多个指令被一个或多个处理核701执行,以使一个或多个处理核701能够执行上述的核共享方法。One or more instructions are stored in one or more processing cores 701, and one or more instructions are executed by one or more processing cores 701, so that one or more processing cores 701 can execute the above-mentioned core sharing method.
此外,本公开实施例还提供了一种计算机可读介质,其上存储有计算机程序,其中, 所述计算机程序在被处理核执行时实现上述的核共享方法。In addition, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, wherein the computer program implements the above-mentioned core sharing method when executed by a processing core.
此外,本公开实施例还提供了一种计算机程序产品,所述计算机程序产品在计算机上运行时,使得计算机执行上述的核共享方法。In addition, an embodiment of the present disclosure also provides a computer program product, which, when running on a computer, enables the computer to execute the above-mentioned core sharing method.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, functional modules/units in the systems, and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .
本文已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其他实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should only be construed in a general descriptive sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments, unless expressly stated otherwise. Features and/or elements are used in combination. Accordingly, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the scope of the present disclosure as set forth in the appended claims.

Claims (12)

  1. 一种基于众核系统的核共享方法,所述众核系统包括预先配置的多个核心簇,每个所述核心簇包括至少一个第二处理核,所述方法包括:A core sharing method based on a many-core system, the many-core system comprising a plurality of pre-configured core clusters, each of the core clusters comprising at least one second processing core, the method comprising:
    接收核共享请求;receive a core sharing request;
    根据所述核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为所述第一核心簇与所述第二核心簇之间的共享核,至少一个共享核组成共享核阵列;According to the core sharing request, at least one second processing core is determined from the second processing cores of the first core cluster and/or the predetermined second core cluster, as the first core cluster and the second core cluster. Shared cores between two core clusters, at least one shared core forms a shared core array;
    其中,所述共享核阵列被配置为接收并执行与所述第一核心簇和所述第二核心簇分别对应的任务,存储与所述第一核心簇的任务对应的第一任务数据,以及存储与所述第二核心簇的任务对应的第二任务数据。wherein the shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to the tasks of the first core cluster, and Second task data corresponding to the tasks of the second core cluster is stored.
  2. 根据权利要求1所述的核共享方法,其中,所述众核系统还包括第一处理核,所述接收核共享请求,包括:The core sharing method according to claim 1, wherein the many-core system further comprises a first processing core, and the receiving a core sharing request comprises:
    接收外部主机或第一处理核发送的核共享请求,所述核共享请求为所述外部主机或所述第一处理核基于与所述第一核心簇和所述第二核心簇对应的公共任务而生成的;或接收所述第二核心簇的主处理核发送的核共享请求,所述第二核心簇的主处理核为所述第二核心簇的至少一个第二处理核中预先指定的第二处理核。Receive a core sharing request sent by an external host or a first processing core, where the core sharing request is based on a common task corresponding to the first core cluster and the second core cluster by the external host or the first processing core or receive a core sharing request sent by the main processing core of the second core cluster, where the main processing core of the second core cluster is a pre-designated one of at least one second processing core of the second core cluster The second processing core.
  3. 根据权利要求1所述的核共享方法,其中,在所述确定出至少一个第二处理核之后,所述方法还包括:The core sharing method according to claim 1, wherein after the at least one second processing core is determined, the method further comprises:
    更新与所述共享核对应的核心簇列表,更新后的所述核心簇列表包括与所述第一核心簇和所述第二核心簇分别对应的标识信息。A core cluster list corresponding to the shared core is updated, and the updated core cluster list includes identification information corresponding to the first core cluster and the second core cluster respectively.
  4. 根据权利要求1所述的核共享方法,其中,在所述确定出至少一个第二处理核之后,所述方法还包括:The core sharing method according to claim 1, wherein after the at least one second processing core is determined, the method further comprises:
    在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域,所述第一共享存储区域用于存储所述第一任务数据;creating a first shared storage area corresponding to the first core cluster in a storage area corresponding to the shared core array, where the first shared storage area is used to store the first task data;
    在与所述共享核阵列对应的存储区中创建与所述第二核心簇对应的第二共享存储区域,所述第二共享存储区域用于存储所述第二任务数据。A second shared storage area corresponding to the second core cluster is created in the storage area corresponding to the shared core array, where the second shared storage area is used for storing the second task data.
  5. 根据权利要求4所述的核共享方法,其中,在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域之前,所述方法还包括:The core sharing method according to claim 4, wherein before creating a first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array, the method further comprises:
    判断与所述共享核阵列对应的存储区中是否存在可用存储空间;judging whether there is available storage space in the storage area corresponding to the shared core array;
    响应于判断出与所述共享核阵列对应的存储区中存在可用存储空间,执行在与所述共享核阵列对应的存储区中创建与所述第一核心簇对应的第一共享存储区域的步骤。In response to determining that there is available storage space in the storage area corresponding to the shared core array, a step of creating a first shared storage area corresponding to the first core cluster in the storage area corresponding to the shared core array is performed .
  6. 根据权利要求5所述的核共享方法,其中,所述判断与所述共享核阵列对应的存储区中是否存在可用存储空间之后,所述方法还包括:The core sharing method according to claim 5, wherein after judging whether there is available storage space in the storage area corresponding to the shared core array, the method further comprises:
    响应于判断出与所述共享核阵列对应的存储区中不存在可用存储空间,确定所述众核系统中不归属于任何核心簇的处理核中空闲的处理核;In response to judging that there is no available storage space in the storage area corresponding to the shared core array, determining an idle processing core in the processing cores that do not belong to any core cluster in the many-core system;
    将至少一个所述空闲的处理核确定为所述共享核,并加入所述共享核阵列中。At least one of the idle processing cores is determined as the shared core, and added to the shared core array.
  7. 根据权利要求4-6中任一项所述的核共享方法,其中,所述共享核的数量为多个,所述共享核阵列对应的存储区还包括通用共享存储区域,所述第一共享存储区域、所述第二共享存储区域和所述通用共享存储区域分别对应一个或多个共享核;The core sharing method according to any one of claims 4-6, wherein the number of the shared cores is multiple, the storage area corresponding to the shared core array further includes a general shared storage area, and the first shared core The storage area, the second shared storage area and the general shared storage area respectively correspond to one or more shared cores;
    其中,所述第一共享存储区域对应的共享核被配置为存储所述第一任务数据;Wherein, the shared core corresponding to the first shared storage area is configured to store the first task data;
    所述第二共享存储区域对应的共享核被配置为存储所述第二任务数据;The shared core corresponding to the second shared storage area is configured to store the second task data;
    所述通用共享存储区域对应的共享核被配置为接收并执行分别与所述第一核心簇和所述第二核心簇对应的任务。The shared cores corresponding to the common shared storage area are configured to receive and execute tasks corresponding to the first core cluster and the second core cluster, respectively.
  8. 根据权利要求7所述的核共享方法,其中,所述第一任务数据包括第一输入数据、第一输出数据和第一任务配置信息,所述第一共享存储区域包括第一输入数据区域、第一输出数据区域以及第一任务配置区域;The core sharing method according to claim 7, wherein the first task data includes first input data, first output data and first task configuration information, and the first shared storage area includes a first input data area, a first output data area and a first task configuration area;
    其中,所述第一输入数据区域中的共享核被配置为存储所述第一输入数据;所述第一输出数据区域中的共享核被配置为存储所述第一输出数据;所述第一任务配置区域中的共享核被配置为存储所述第一任务配置信息。Wherein, the shared core in the first input data area is configured to store the first input data; the shared core in the first output data area is configured to store the first output data; the first The shared core in the task configuration area is configured to store the first task configuration information.
  9. 一种核共享装置,该核共享装置应用于众核系统,该众核系统包括预先配置的多个核心簇,每个核心簇包括至少一个第二处理核,该核共享装置包括:A core sharing device, the core sharing device is applied to a many-core system, the many-core system includes a plurality of pre-configured core clusters, each core cluster includes at least one second processing core, and the core sharing device includes:
    接收模块,用于接收核共享请求;a receiving module for receiving a core sharing request;
    共享确定模块,用于根据所述核共享请求,从第一核心簇和/或预先确定的第二核心簇的第二处理核中,确定出至少一个第二处理核,以作为所述第一核心簇与所述第二核心簇之间的共享核,至少一个共享核组成共享核阵列;A sharing determination module, configured to determine at least one second processing core from the second processing cores of the first core cluster and/or the predetermined second core cluster according to the core sharing request, as the first core cluster shared cores between the core cluster and the second core cluster, at least one shared core forms a shared core array;
    其中,所述共享核阵列被配置为接收并执行与所述第一核心簇和所述第二核心簇分别对应的任务,存储与所述第一核心簇的任务对应的第一任务数据,以及存储与所述第二核心簇的任务对应的第二任务数据。wherein the shared core array is configured to receive and execute tasks corresponding to the first core cluster and the second core cluster respectively, store first task data corresponding to the tasks of the first core cluster, and Second task data corresponding to the tasks of the second core cluster is stored.
  10. 一种电子设备,包括:An electronic device comprising:
    多个处理核;以及multiple processing cores; and
    片上网络,被配置为交互所述多个处理核间的数据和外部数据;an on-chip network configured to exchange data and external data among the plurality of processing cores;
    一个或多个所述处理核中存储有一个或多个指令,一个或多个所述指令被一个或多 个所述处理核执行,以使一个或多个所述处理核能够执行权利要求1-8中任一项所述的核共享方法。One or more of said processing cores store one or more instructions, and one or more of said instructions are executed by one or more of said processing cores to enable one or more of said processing cores to execute claim 1 The core sharing method of any one of -8.
  11. 一种计算机可读介质,其上存储有计算机程序,其中,所述计算机程序在被处理核执行时实现如权利要求1-8中任一项所述的核共享方法。A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processing core, implements the core sharing method according to any one of claims 1-8.
  12. 一种计算机程序产品,所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1-8中任一项所述的核共享方法。A computer program product, when running on a computer, causes the computer to execute the core sharing method according to any one of claims 1-8.
PCT/CN2021/132357 2020-11-24 2021-11-23 Core sharing method and apparatus based on many-core system, electronic device, and medium WO2022111456A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011330876.4 2020-11-24
CN202011330876.4A CN114546493A (en) 2020-11-24 2020-11-24 Core sharing method and device, processing core, electronic device and medium

Publications (1)

Publication Number Publication Date
WO2022111456A1 true WO2022111456A1 (en) 2022-06-02

Family

ID=81660579

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/132357 WO2022111456A1 (en) 2020-11-24 2021-11-23 Core sharing method and apparatus based on many-core system, electronic device, and medium

Country Status (2)

Country Link
CN (1) CN114546493A (en)
WO (1) WO2022111456A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319610A (en) * 2023-05-23 2023-06-23 南京芯驰半导体科技有限公司 Data transmission method, device, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472448B (en) * 2023-12-28 2024-03-26 山东省计算中心(国家超级计算济南中心) Parallel acceleration method, device and medium for secondary core cluster of Shenwei many-core processor

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622208A (en) * 2011-01-27 2012-08-01 中兴通讯股份有限公司 Multi-core reconfigurable processor cluster and reconfiguration method thereof
US20140006714A1 (en) * 2012-06-29 2014-01-02 Naveen Cherukuri Scalable coherence for multi-core processors
CN105988970A (en) * 2015-02-12 2016-10-05 华为技术有限公司 Processor of shared storage data, and chip
CN110865968A (en) * 2019-04-17 2020-03-06 成都海光集成电路设计有限公司 Multi-core processing device and data transmission method between cores thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622208A (en) * 2011-01-27 2012-08-01 中兴通讯股份有限公司 Multi-core reconfigurable processor cluster and reconfiguration method thereof
US20140006714A1 (en) * 2012-06-29 2014-01-02 Naveen Cherukuri Scalable coherence for multi-core processors
CN105988970A (en) * 2015-02-12 2016-10-05 华为技术有限公司 Processor of shared storage data, and chip
CN110865968A (en) * 2019-04-17 2020-03-06 成都海光集成电路设计有限公司 Multi-core processing device and data transmission method between cores thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116319610A (en) * 2023-05-23 2023-06-23 南京芯驰半导体科技有限公司 Data transmission method, device, electronic equipment and storage medium
CN116319610B (en) * 2023-05-23 2023-08-29 南京芯驰半导体科技有限公司 Data transmission method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114546493A (en) 2022-05-27

Similar Documents

Publication Publication Date Title
US10360199B2 (en) Partitioning and rebalancing data storage
EP3281359B1 (en) Application driven and adaptive unified resource management for data centers with multi-resource schedulable unit (mrsu)
US20230376347A1 (en) Task allocation method, apparatus, storage medium, and electronic device
US10572290B2 (en) Method and apparatus for allocating a physical resource to a virtual machine
CN108337109B (en) Resource allocation method and device and resource allocation system
CN105979007B (en) Method and device for accelerating resource processing and network function virtualization system
US8645745B2 (en) Distributed job scheduling in a multi-nodal environment
WO2022111456A1 (en) Core sharing method and apparatus based on many-core system, electronic device, and medium
CN109729106B (en) Method, system and computer program product for processing computing tasks
CN109886693B (en) Consensus realization method, device, equipment and medium for block chain system
US20190065544A1 (en) System and method for collaborative sharing of database information
US10831716B2 (en) Method and apparatus for configuring relevant parameters of MapReduce applications
WO2020042612A1 (en) Method and device for storing and reading a message, server, and storage medium
EP3370179A1 (en) Method and system for distributing floating licenses for real-time services
CN111542809A (en) Managing virtual network functions
CN110389825B (en) Method, apparatus and computer program product for managing dedicated processing resources
JP2023545985A (en) Managing task flows in edge computing environments
WO2021013185A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
US20230082903A1 (en) Autonomic application service framework
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
CN110928693B (en) Computing equipment and resource allocation method
CN114546630A (en) Task processing method and distribution method, device, electronic equipment and medium
CN107615872A (en) A kind of method, apparatus and system for discharging connection
US11768704B2 (en) Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling
US11558301B2 (en) Method, device, and computer program product for accessing application system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21896957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.09.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21896957

Country of ref document: EP

Kind code of ref document: A1