Information processing method, information processing device, and electronic device
By dynamically adjusting the number of processor cores, the system lag issue caused by excessive resource consumption by the inference model was resolved, improving system efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2026-01-31
- Publication Date
- 2026-06-12
Smart Images

Figure CN122195635A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to an information processing method, an information processing device, and an electronic device. Background Technology
[0002] Currently, in order to improve inference speed, inference models often consume too many processor cores, resulting in excessive processor resource usage. This leads to slow system response and lag when users are performing other operations. Current technology lacks an effective way to reduce processor resource consumption while ensuring that model inference speed remains within an acceptable range, thus impacting user experience. Summary of the Invention
[0003] This application provides an information processing method, an information processing device, and an electronic device.
[0004] On one hand, embodiments of this application provide an information processing method, including:
[0005] Based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; In response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed.
[0006] Optionally, the method further includes: Based on the target inference task and the attribute information of the target model, determine the first number of processor cores currently used by the target model; The attribute information of the target model represents the inference type, historical inference speed, and processor utilization data of the target model.
[0007] Optionally, determining the first number of processor cores currently used by the target model based on the target inference task and the attribute information of the target model includes: Determine the target power mode corresponding to the target model; In response to the target power mode being the first mode, a first number of processor cores currently used by the target model is determined from a first processor core preset table. The first processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the first mode. or, In response to the target power mode being the second mode, a first number of processor cores currently used by the target model is determined from the second processor core preset table. The second processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the second mode. The first mode consumes more power than the second mode, and the data processing capability of the processor core in the first mode is higher than that in the second mode.
[0008] Optionally, allocating a second number of processor cores to the target model includes: Based on the comparison between the inference speed required for the target inference task and the first inference speed, a second number of processor cores for the target model is determined; The number of processor cores used by the target model is adjusted from the first number to the second number.
[0009] Optionally, determining the second number of processor cores of the target model based on the comparison between the inference speed required for the target inference task and the first inference speed includes: If the first inference speed is lower than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be greater than the first quantity; If the first inference speed is higher than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be less than the first quantity.
[0010] Optionally, the method further includes: During the process of adjusting the number of processor cores currently used by the target model, it is determined whether the current processor utilization rate of the target model is within the preset processor utilization rate range; In response to the target model's current processor utilization rate being outside the preset processor utilization rate range, the number of processor cores used by the target model is reduced so that the processor utilization rate is within the preset processor utilization rate range.
[0011] Optionally, the method further includes: The number of adjustments is counted during the process of adjusting the number of processor cores; The target count value corresponding to the number of adjustments to the number of processor cores is compared with the preset adjustment number threshold to obtain the corresponding adjustment number comparison result; Based on the comparison results of the number of adjustments, the number of target processor cores of the target model is determined.
[0012] Optionally, determining the target processor core count of the target model based on the comparison results of the number of adjustments includes: In response to the fact that the number of adjustments has not exceeded the adjustment number threshold, and the inference speed achieved by the target model after the current allocation of processor cores meets the processing requirements, the current allocation of processor cores is determined as the number of processor cores used by the target model. In response to the number of adjustments exceeding the adjustment threshold, the adjustment of the number of processor cores is stopped, and the number of processor cores allocated in the most recent adjustment is determined as the number of processor cores used by the target model.
[0013] On the other hand, embodiments of this application also provide an information processing apparatus, including: The acquisition module is used to determine the first inference speed corresponding to the first number of processor cores currently used by the target model. The processing module is configured to, in response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, allocate a second number of processor cores to the target model and determine a second inference speed corresponding to the second number of processor cores, wherein the second number is different from the first number and the second inference speed is different from the first inference speed.
[0014] In another aspect, embodiments of this application also provide an electronic device, including: A memory for storing an executable program; a processor for executing the executable program to perform the following steps: Based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; In response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed. Attached Figure Description
[0015] Figure 1 This is a flowchart of an information processing method according to an embodiment of this application; Figure 2 Examples of embodiments of this application Figure 1 A flowchart of one embodiment of step S200; Figure 3 Examples of embodiments of this application Figure 2 A flowchart of one embodiment of step S210; Figure 4 This is another flowchart of the information processing method according to an embodiment of this application; Figure 5 This is another flowchart of the information processing method according to an embodiment of this application; Figure 6 Examples of embodiments of this application Figure 5 A flowchart of one embodiment of step S700; Figure 7 This is a schematic diagram of the structure of the information processing device according to an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0016] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0017] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0018] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0019] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0020] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.
[0021] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0022] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0023] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0024] Figure 1 A flowchart of an information processing method according to an embodiment of this application is shown. An information processing method provided by an embodiment of this application, such as… Figure 1 As shown, it includes: S100, based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; The information processing method of this embodiment is applied to electronic devices configured with a target model and multiple processor cores, such as laptops and mobile terminals. A processor core can be an independent physical computing unit within a central processing unit (CPU) capable of reading and executing program instructions. The target model can be a language model, image model, or other commonly used models in electronic devices. First, a first number of processor cores can be allocated to the target model. The target model is then controlled to use these first number of processor cores to execute the target inference task, and a first inference speed corresponding to the first number of processor cores is determined, which is the processing efficiency of the target model using the first number of processor cores to execute the target inference task. For example, the target model is initially configured with 4 processor cores; the target model is controlled to use these 4 cores for image processing tasks; and its processing efficiency is monitored. The calculated average processing speed is 50 milliseconds for processing a single image; this speed is the first inference speed corresponding to the first number (4 processor cores).
[0025] S200, in response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores are allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed.
[0026] In this embodiment, after the target model executes the target inference task using a first number of processor cores, it monitors whether the first inference speed meets the processing requirements of the target model in executing the target inference task. In response to the first inference speed not meeting the processing requirements of the target model in executing the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed. Specifically, if the current first inference speed cannot meet the processing requirements of the target model in executing the target inference task, the number of processor cores used by the target model can be adjusted to the second number, allowing the target model to utilize the second number of processor cores and execute the target inference task at the second inference speed.
[0027] For example, configuring the target model with 4 processor cores to perform image processing tasks, the calculated first inference speed is 50 milliseconds per image. The image processing task requires an inference speed of no less than 30 milliseconds per image. Comparing the first inference speed of 50 milliseconds per image with the threshold of 30 milliseconds per image, it can be determined that the first inference speed is slower than the required inference speed for the image processing task, thus the first inference speed does not meet the processing requirements. In response to the above judgment result, a second number of processor cores can be allocated to the target model. To improve image recognition performance, the number of processor cores can be increased from 4 to 6. The target model uses these 6 cores to perform the same image processing task again, and the calculated second inference speed is 25 milliseconds per image. Comparing the second inference speed of 25 milliseconds per image with the threshold of 30 milliseconds per image, it can be determined that the second inference speed is faster than the required inference speed for the image processing task, thus the second inference speed meets the processing requirements. The target model can utilize the second number of processor cores to perform image processing tasks at the second inference speed.
[0028] This application dynamically adjusts the number of processor cores used by the target model through the above method, constraining the model inference task to run on a reasonable number of cores, which can meet the model performance requirements, while maintaining the CPU utilization rate within a range that is good for the overall system operation. This makes full use of processor resources, ensures that the operating system interface response, background services and other user applications can obtain sufficient computing resources, eliminates the overall system lag and operation delay caused by model inference, and improves the user experience.
[0029] In one embodiment of this application, the method further includes: Based on the target inference task and the attribute information of the target model, determine the first number of processor cores currently used by the target model; The attribute information of the target model represents the inference type, historical inference speed, and processor utilization data of the target model.
[0030] In this embodiment, when allocating a first number of processor cores to the target model, the first number of processor cores currently used by the target model can be determined based on the target inference task and the attribute information of the target model. First, the target inference task that the target model needs to perform can be identified; for example, the target inference task could be frame-by-frame object detection of a real-time video stream; this task defines processing requirements that require low latency and high inference speed to maintain smooth video playback. The target model's pre-stored or historically accumulated attribute information is read and analyzed. The target model's attribute information may include inference type, historical inference speed, and historical processor utilization data.
[0031] For example, attribute information indicates that the target model is a real-time image classification model based on convolutional neural networks. The database records historical inference speed data of the target model performing the same task multiple times under different operating conditions. When allocated with 2 processor cores, the average processing speed is 120 milliseconds / frame; when allocated with 4 processor cores, it is 55 milliseconds / frame; and when allocated with 6 processor cores, it is 33 milliseconds / frame. The database also records CPU utilization rates under different numbers of cores: when using 2 processor cores, the CPU utilization rate is 25%; when using 4 processor cores, the CPU utilization rate is 45%; and when using 6 processor cores, the CPU utilization rate is 70%. Based on the inference type, historical inference speed, and historical processor utilization rate data, the initial configuration of the target model can balance efficiency and resource conservation. For example, setting the initial CPU utilization rate close to but not exceeding 40% allows allocating 4 processor cores as the initial configuration for the target model.
[0032] In one embodiment of this application, determining the first number of processor cores currently used by the target model based on the target inference task and the attribute information of the target model includes: Determine the target power mode corresponding to the target model; In response to the target power mode being the first mode, a first number of processor cores currently used by the target model is determined from a first processor core preset table. The first processor core preset table is obtained based on the historical inference speed and processor utilization rate corresponding to the inference operations performed by the target model in the first mode. or, In response to the target power mode being the second mode, a first number of processor cores currently used by the target model is determined from the second processor core preset table. The second processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the second mode. The first mode consumes more power than the second mode, and the data processing capability of the processor core in the first mode is higher than that in the second mode.
[0033] In this embodiment, before determining the first number of processor cores currently used by the target model based on the target inference task and the attribute information of the target model, the target power mode currently running on the electronic device is detected and determined. The power mode can be a system mode set by the operating system to balance performance and power consumption. For example, on a laptop, when a power adapter is connected, the system is usually set to high-performance mode or plug-in mode; when using battery power, to extend battery life, the system is usually set to power-saving mode or battery mode.
[0034] If the target power mode corresponding to the target model is the first mode, the first number of processor cores currently used by the target model is determined from the first processor core preset table. The first mode can be a high-performance mode. In high-performance mode, the processor can run at a higher frequency and voltage, consuming more energy but with stronger data processing capabilities. In the first mode, the system uses the first processor core preset table established for the first mode. The first processor core preset table can be a data mapping table, whose entries are generated based on historical data collected from the target model's previous operation in the first mode. Each record can contain: processor core type, such as P-Core (Performance Core), number of processor cores, historical average inference speed, and corresponding historical average processor utilization. For example, combining the current real-time video stream object detection task (requiring ≤40 milliseconds / frame) and resource control strategy (such as initial expected utilization <50%), querying the first processor core preset table can determine that 2 P-Core performance cores are allocated, the historical inference speed of 40 milliseconds can meet the requirements, and the historical CPU utilization of 30% is low; therefore, the first number can be determined from the first processor core preset table as 2 P-Core performance cores.
[0035] If the target power mode corresponding to the target model is the second mode, the first number of processor cores currently used by the target model is determined from the second processor core preset table. The second mode can be an energy-saving mode. In energy-saving mode, processor frequency and voltage need to be limited, resulting in significantly reduced energy consumption and a corresponding reduction in data processing capability. In the second mode, the system uses the second processor core preset table established for the second mode. The second processor core preset table can be a data mapping table, whose entries are generated based on historical data collected from previous runs of the target model in the second mode. Each record can include: processor core type, such as E-Core (Efficient Core) and P-Core (Performance Core), number of processor cores, historical average inference speed, and corresponding historical average processor utilization. In the second mode, E-Core (Efficient Core) energy-saving cores can be scheduled first, or the activity of P-Core performance cores can be limited. For example, combining the current real-time video stream object detection task (requiring ≤40 milliseconds / frame) and resource control strategies (such as initial expected utilization rate <40%), by querying the second processor core preset table, it can be determined that 2 E-Core energy efficiency cores and 1 P-Core performance core are allocated. The historical inference speed of 45 milliseconds can meet the requirements, and the historical CPU utilization rate of 25% is low. Therefore, the first quantity can be determined from the second processor core preset table as 2 E-Core energy efficiency cores and 1 P-Core performance core.
[0036] In one embodiment of this application, such as Figure 2 As shown, allocating a second number of processor cores to the target model includes: S210, based on the comparison result between the inference speed required for the target inference task and the first inference speed, determine the second number of processor cores of the target model; S220, adjust the number of processor cores used by the target model from the first number to the second number.
[0037] In this embodiment, the inference speed required for the target inference task is compared with a first inference speed. Based on the comparison result, a second number of processor cores for the target model is determined. The inference speed required for the target inference task can be represented by a specific threshold. By comparing the inference speed required for the target inference task with the current first inference speed, it can be determined whether the current first inference speed can reach the inference speed required for the target inference task, thereby determining whether to adjust the number of processor cores currently used by the target model. After determining the second number of processor cores for the target model based on the comparison result of the inference speed required for the target inference task and the first inference speed, the number of processor cores used by the target model is adjusted from the first number to the second number.
[0038] For example, configuring the target model with 4 processor cores to perform image processing tasks yields a first inference speed of 50 milliseconds per image. The target inference task requires an inference speed of 30 milliseconds per image. Comparing the first inference speed of 50 milliseconds per image with the target inference task's required inference speed of 30 milliseconds per image, it can be determined that the target inference task's required inference speed is faster than the first inference speed. Based on the difference between the target inference task's required inference speed and the first inference speed, the number of additional processor cores needed for the target model can be determined. Since the current first inference speed is slow, 2 more processor cores can be added. That is, it can be determined that the target model uses 6 processor cores. The target model can utilize 6 processor cores to perform image processing tasks at a second inference speed.
[0039] In one embodiment of this application, such as Figure 3 As shown, determining the second number of processor cores for the target model based on a comparison between the inference speed required for the target inference task and the first inference speed includes: S2101, if the first inference speed is lower than the inference speed threshold corresponding to the processing requirements of the target model to perform the target inference task, determine that the second quantity is greater than the first quantity; In this embodiment, the inference speed required for the target inference task is compared with the first inference speed. After obtaining the comparison result, if the first inference speed is lower than the inference speed threshold corresponding to the processing requirements of the target model for executing the target inference task, it is determined that the second number is greater than the first number. That is, the current first inference speed is too slow and cannot meet the processing requirements of the target inference task, so it is necessary to increase the number of processor cores to improve computing power and accelerate inference. It is determined that the adjusted second number of processor cores needs to be greater than the current first number of processor cores. For example, if the target model is performing an image processing task, the target model is initially allocated 4 processor cores, the first inference speed is 50 milliseconds / image, and the task requires an inference speed threshold of 30 milliseconds / image. The first inference speed is slower than the inference speed threshold, indicating that the first inference speed is lower than the inference performance requirement. In this case, it is necessary to improve computing power to accelerate inference. It is determined that the adjusted number of processor cores needs to be greater than the current number of processor cores, and the adjusted second number of processor cores is determined to be 6.
[0040] S2102, if the first inference speed is higher than the inference speed threshold corresponding to the processing requirements of the target model to perform the target inference task, determine that the second quantity is less than the first quantity.
[0041] In this embodiment, the inference speed required for the target inference task is compared with the first inference speed. After obtaining the comparison result, if the first inference speed is higher than the inference speed threshold corresponding to the processing requirements of the target model for executing the target inference task, it is determined that the second number is less than the first number. That is, the resources currently allocated to the target model may be excessive, and some computing resources can be released to other processes in the system while ensuring that the inference speed still meets the requirements. It is determined that the adjusted second number of processor cores needs to be less than the current first number of processor cores. For example, if the target model is performing an image processing task, and the target model is initially allocated 6 processor cores, the first inference speed is 20 milliseconds / image, and the inference speed threshold required by the task is 30 milliseconds / image, the first inference speed is faster than the inference speed threshold, indicating that the first inference speed is higher than the inference performance requirement. In this case, resource consumption can be reduced while meeting the inference requirements, and the number of processor cores used by the target model can be reduced. The adjusted second number of processor cores is determined to be 4.
[0042] In one embodiment of this application, such as Figure 4 As shown, the method further includes: S300, during the process of adjusting the number of processor cores currently used by the target model, determine whether the current processor utilization rate of the target model is within the preset processor utilization rate range; S400, in response to the target model's current processor utilization rate being outside the preset processor utilization rate range, reduce the number of processor cores used by the target model so that the processor utilization rate is within the preset processor utilization rate range.
[0043] In this embodiment, during the adjustment of the number of processor cores, the current processor utilization rate of the target model is monitored to determine whether it is within a preset processor utilization rate range. The processor utilization rate of the target model can be the percentage of total CPU time used by the processor cores of the target model's processes or threads, reflecting the intensity of the target model's consumption of computing resources. The electronic device can be pre-configured with a preset processor utilization rate range, such as 30% to 50%. The preset processor utilization rate range can be a reasonable resource consumption range. Based on the preset processor utilization rate range, the performance of the target model can be guaranteed without excessively affecting other system tasks or causing overall system lag.
[0044] If the target model's current processor utilization rate is outside the preset range, it indicates that the target model is using too many processor cores. The number of processor cores allocated to the target model can be reduced. For example, if the target model uses 6 processor cores to perform an image processing task, with a second inference speed of 25 milliseconds per image, and its processor utilization rate is detected as 65%; the preset processor utilization rate range is 30%-50%. Since the target model's current processor utilization rate is outside the preset range, the number of processor cores used by the target model needs to be reduced. Specifically, the number of processor cores used by the target model can be reduced from 6 to 5, bringing the target model's processor utilization rate within the preset range.
[0045] In one embodiment of this application, such as Figure 5 As shown, the method further includes: S500, during the process of adjusting the number of processor cores, the number of adjustments is counted; S600, compare the target count value corresponding to the number of times the number of processor cores is adjusted with the preset number of times threshold to obtain the corresponding number of times comparison result; S700, based on the comparison results of the number of adjustments, determine the number of target processor cores of the target model.
[0046] In this embodiment, the number of adjustments is counted during the process of adjusting the number of processor cores used by the target model. When an operation to change the number of processor cores used by the target model is performed, both increasing and decreasing the number of cores are considered as one adjustment, and the value of a pre-set counter is incremented by 1. For example, the initial value of the counter is 0. Adjusting the number of processor cores used by the target model from 4 to 6 is the first adjustment, and the value of the counter is 1. Then, due to high CPU utilization, the number of processor cores used by the target model is reduced from 6 to 5, which is the second adjustment, and the value of the counter becomes 2.
[0047] A preset adjustment threshold is established, representing the maximum number of attempts the system is allowed to make to find the optimal configuration for the current task. For example, the adjustment threshold can be set to 10. For each adjustment operation on the number of processor cores, the current number of adjustments is compared with the preset adjustment threshold to obtain the corresponding adjustment comparison result. Based on the adjustment comparison result, the target number of processor cores for the target model is determined. If the current adjustment count is less than the preset adjustment threshold, and the current configuration of processor cores does not meet the speed requirements and utilization range of the target model, the next round of performance monitoring and adjustment will continue to guide the search for a better processor core configuration. If the current adjustment count is less than the preset adjustment threshold, and a processor core configuration that simultaneously meets the inference speed requirements and processor utilization range is obtained, the current number of processor cores can be determined as the target number of processor cores. If the current adjustment count is greater than the preset adjustment threshold, regardless of whether the current configuration meets the inference speed requirements and processor utilization range, further adjustment attempts need to be stopped; and the number of processor cores set in the last executed adjustment operation is determined as the target number of processor cores.
[0048] In one embodiment of this application, such as Figure 6 As shown, determining the target processor core count of the target model based on the comparison results of the number of adjustments includes: S710, in response to the fact that the number of adjustments has not exceeded the adjustment number threshold, and the inference speed achieved by the target model after the current allocation of the number of processor cores meets the processing requirements, the current allocation of the number of processor cores is determined as the number of processor cores used by the target model. S720, in response to the number of adjustments exceeding the adjustment number threshold, stop adjusting the number of processor cores, and determine the number of processor cores allocated in the most recent adjustment as the number of processor cores used by the target model.
[0049] In this embodiment, the target count value corresponding to the number of adjustments to the number of processor cores is compared with a preset adjustment count threshold. After obtaining the corresponding adjustment count comparison result, the target number of processor cores for the target model is determined based on the adjustment count comparison result. If the number of adjustments does not exceed the adjustment count threshold, and the inference speed achieved by the target model after the current allocation of processor cores meets the processing requirements, it indicates that the optimization process for the number of processor cores has reached an acceptable configuration, and no further adjustments are needed. The currently allocated number of processor cores is then determined as the number of processor cores used by the target model. For example, if the current number of adjustments is 3, which does not exceed the preset adjustment count threshold of 10, the inference speed achieved by the target model under the current allocation of processor cores meets the processing requirements of the task. After 3 adjustments, the number of processor cores is adjusted from 4 to 6, and then from 6 to 5. When the target model uses 5 processor cores to execute the task, the inference speed is 28 milliseconds / frame, which meets the processing requirements of less than 30 milliseconds / frame. Therefore, 5 processor cores can be determined as the number of processor cores used by the target model.
[0050] If the number of adjustments exceeds the adjustment threshold, it indicates that a configuration that simultaneously satisfies all conditions has not been found through multiple adjustments, and the maximum allowed number of adjustment attempts has been exceeded. In this case, adjustments to the number of processor cores must be stopped, and the number of processor cores allocated in the most recent adjustment should be determined as the number of processor cores used by the target model. This prevents infinite loop adjustments and avoids continuous performance fluctuations and resource waste. For example, if the current adjustment count is 5, and the preset adjustment threshold is 5, after 5 adjustments, the number of processor cores is successively adjusted from 2 to 4, from 4 to 6, from 6 to 5, from 5 to 4, and from 4 to 3. Since the adjustment count has reached the preset threshold, regardless of whether the inference speed of the target model using 3 processor cores after the 5th adjustment meets the requirements, the adjustment operation will be forcibly stopped, and the 3 processor cores after the 5th adjustment will be determined as the number of processor cores used by the target model. This situation may mean that the target model will perform tasks at an inference speed slightly lower than the ideal inference speed.
[0051] Based on the same inventive concept, the second aspect of this application also provides an information processing device corresponding to the information processing method. Since the principle of the information processing device in this application for solving the problem is similar to that of the information processing method described above, the implementation of the information processing device can refer to the implementation of the method, and the repeated parts will not be described again.
[0052] Figure 7 A schematic diagram of the structure of the information processing apparatus provided in an embodiment of this application is shown, including: The acquisition module is used to determine the first inference speed corresponding to the first number of processor cores currently used by the target model. The processing module is configured to, in response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, allocate a second number of processor cores to the target model and determine a second inference speed corresponding to the second number of processor cores, wherein the second number is different from the first number and the second inference speed is different from the first inference speed.
[0053] In one embodiment of this application, the acquisition module is further configured as follows: Based on the target inference task and the attribute information of the target model, determine the first number of processor cores currently used by the target model; The attribute information of the target model represents the inference type, historical inference speed, and processor utilization data of the target model.
[0054] In one embodiment of this application, the acquisition module is further configured as follows: Determine the target power mode corresponding to the target model; In response to the target power mode being the first mode, a first number of processor cores currently used by the target model is determined from a first processor core preset table. The first processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the first mode. or, In response to the target power mode being the second mode, a first number of processor cores currently used by the target model is determined from the second processor core preset table. The second processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the second mode. The first mode consumes more power than the second mode, and the data processing capability of the processor core in the first mode is higher than that in the second mode.
[0055] In one embodiment of this application, the processing module is further configured as follows: Based on the comparison between the inference speed required for the target inference task and the first inference speed, a second number of processor cores for the target model is determined; The number of processor cores used by the target model is adjusted from the first number to the second number.
[0056] In one embodiment of this application, the processing module is further configured as follows: If the first inference speed is lower than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be greater than the first quantity; If the first inference speed is higher than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be less than the first quantity.
[0057] In one embodiment of this application, the processing module is further configured as follows: During the process of adjusting the number of processor cores currently used by the target model, it is determined whether the current processor utilization rate of the target model is within the preset processor utilization rate range; In response to the target model's current processor utilization rate being outside the preset processor utilization rate range, the number of processor cores used by the target model is reduced so that the processor utilization rate is within the preset processor utilization rate range.
[0058] In one embodiment of this application, the processing module is further configured as follows: The number of adjustments is counted during the process of adjusting the number of processor cores; The target count value corresponding to the number of adjustments to the number of processor cores is compared with the preset adjustment number threshold to obtain the corresponding adjustment number comparison result; Based on the comparison results of the number of adjustments, the number of target processor cores of the target model is determined.
[0059] In one embodiment of this application, the processing module is further configured as follows: In response to the fact that the number of adjustments has not exceeded the adjustment number threshold, and the inference speed achieved by the target model after the current allocation of processor cores meets the processing requirements, the current allocation of processor cores is determined as the number of processor cores used by the target model. In response to the number of adjustments exceeding the adjustment threshold, the adjustment of the number of processor cores is stopped, and the number of processor cores allocated in the most recent adjustment is determined as the number of processor cores used by the target model.
[0060] Based on the same inventive concept, such as Figure 8 As shown, this embodiment also includes an electronic device, comprising: Memory, used to store executable programs; A processor is configured to execute the executable program to perform the following steps: Based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; In response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed.
[0061] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. An information processing method, comprising: Based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; In response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed.
2. The method according to claim 1, further comprising: Based on the target inference task and the attribute information of the target model, determine the first number of processor cores currently used by the target model; The attribute information of the target model represents the inference type, historical inference speed, and processor utilization data of the target model.
3. The method according to claim 2, wherein determining the first number of processor cores currently used by the target model based on the target inference task and the attribute information of the target model includes: Determine the target power mode corresponding to the target model; In response to the target power mode being the first mode, a first number of processor cores currently used by the target model is determined from a first processor core preset table. The first processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the first mode. or, In response to the target power mode being the second mode, a first number of processor cores currently used by the target model is determined from the second processor core preset table. The second processor core preset table is obtained based on the historical inference speed and processor utilization corresponding to the inference operations performed by the target model in the second mode. The first mode consumes more power than the second mode, and the data processing capability of the processor core in the first mode is higher than that in the second mode.
4. The method according to claim 1, wherein allocating a second number of processor cores to the target model comprises: Based on the comparison between the inference speed required for the target inference task and the first inference speed, a second number of processor cores for the target model is determined; The number of processor cores used by the target model is adjusted from the first number to the second number.
5. The method according to claim 4, wherein determining the second number of processor cores of the target model based on a comparison between the inference speed required for the target inference task and the first inference speed comprises: If the first inference speed is lower than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be greater than the first quantity; If the first inference speed is higher than the inference speed threshold corresponding to the processing requirements of the target model in performing the target inference task, then the second quantity is determined to be less than the first quantity.
6. The method according to claim 1, further comprising: During the process of adjusting the number of processor cores currently used by the target model, it is determined whether the current processor utilization rate of the target model is within the preset processor utilization rate range; In response to the target model's current processor utilization rate being outside the preset processor utilization rate range, the number of processor cores used by the target model is reduced so that the processor utilization rate is within the preset processor utilization rate range.
7. The method according to claim 1, further comprising: The number of adjustments is counted during the process of adjusting the number of processor cores; The target count value corresponding to the number of adjustments to the number of processor cores is compared with the preset adjustment number threshold to obtain the corresponding adjustment number comparison result; Based on the comparison results of the number of adjustments, the number of target processor cores of the target model is determined.
8. The method according to claim 7, wherein determining the number of target processor cores of the target model based on the comparison result of the number of adjustments includes: In response to the fact that the number of adjustments has not exceeded the adjustment number threshold, and the inference speed achieved by the target model after the current allocation of processor cores meets the processing requirements, the current allocation of processor cores is determined as the number of processor cores used by the target model. In response to the number of adjustments exceeding the adjustment threshold, the adjustment of the number of processor cores is stopped, and the number of processor cores allocated in the most recent adjustment is determined as the number of processor cores used by the target model.
9. An information processing apparatus, comprising: The acquisition module is used to determine the first inference speed corresponding to the first number of processor cores currently used by the target model. The processing module is configured to, in response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, allocate a second number of processor cores to the target model and determine a second inference speed corresponding to the second number of processor cores, wherein the second number is different from the first number and the second inference speed is different from the first inference speed.
10. An electronic device, comprising: Memory, used to store executable programs; A processor is configured to execute the executable program to perform the following steps: Based on the first number of processor cores currently used by the target model, determine the first inference speed corresponding to the first number of processor cores; In response to the first inference speed not meeting the processing requirements of the target model to perform the target inference task, a second number of processor cores is allocated to the target model, and a second inference speed corresponding to the second number of processor cores is determined. The second number is different from the first number, and the second inference speed is different from the first inference speed.