Task execution method, device, equipment, and medium
By using a profile to map equipment types to preferred GPU child threads, the method optimizes task execution times in GPU-equipped devices, addressing inefficiencies in determining thread counts for diverse equipment types and achieving up to 70% performance improvement.
Patent Information
- Application Number
- JP2024535833
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-12-15
- Filing Date
- 2022-12-07
- Publication Date
- 2025-01-23
- Estimated Expiration
- 2042-12-07
AI Technical Summary
Existing methods for determining the number of GPU child threads for various equipment types are inefficient and costly, leading to suboptimal task execution times due to the lack of a tailored approach for each type of equipment, especially in scenarios involving GPUs in mobile terminals and desktop terminals.
A method and device that utilize a profile to map equipment types to the preferred number of GPU child threads based on a representative equipment type, determining the target equipment type, and executing tasks with the suitable number of threads for that type, thereby optimizing task execution time.
This approach significantly reduces task execution time by employing a tailored number of GPU child threads, improving task execution effectiveness by up to 70% compared to using default threads, and is more feasible and cost-effective than determining threads for each equipment type individually.
Smart Images

Figure 2025501722000001_ABST
Abstract
Description
[Technical field]
[0001] This application is based on and claims priority from a Chinese application having application number 202111539442.X and filing date December 15, 2021, the entire disclosure of which is incorporated herein by reference.
[0002] The present disclosure relates to the field of computer technology, and in particular to a task execution method, device, equipment, and medium. [Background technology]
[0003] Various devices, such as mobile terminals and desktop terminals, are equipped with GPUs (Graphics Processing Units). In some scenarios, a parameter required to perform a specific task, such as image rendering, is the number of GPU child threads. The number of GPU child threads, also called local work size, specifically refers to the number of corresponding child threads in the same warp. Summary of the Invention
[0004] An embodiment of the present disclosure provides a task execution method applied to a target equipment in which a GPU is configured, the method including: obtaining a profile in response to receiving an execution command for a specified task, the specified task being a task executed based on a GPU; the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, the suitable number of GPU child threads being the number of GPU child threads adopted when a representative equipment of the equipment type takes the shortest time to execute the specified task based on its GPU; determining a target equipment type to which the target equipment belongs based on the profile; and executing the specified task by adopting the suitable number of GPU child threads corresponding to the target equipment type.
[0005] In some embodiments, the profile records equipment identifiers of multiple types of equipment corresponding to each of the equipment types, and the step of determining a target equipment type to which the target equipment belongs based on the profile includes searching for an equipment type in the profile that corresponds to the equipment identifier of the target equipment, and setting the searched equipment type as the target equipment type to which the target equipment belongs.
[0006] In some embodiments, a classification method for the equipment type is recorded in the profile, the classification method including classification according to a GPU manufacturer name or classification according to a GPU model number, and the step of determining a target equipment type to which the target equipment belongs based on the profile includes determining a target equipment type to which the target equipment belongs based on the classification method for the equipment type recorded in the profile and GPU information of the target equipment.
[0007] In some embodiments, the GPU information includes a GPU manufacturer name or a GPU model number.
[0008] In some embodiments, all equipment corresponding to each equipment type has a certain GPU commonality, and the GPU commonality corresponding to different equipment types is different.
[0009] In some embodiments, the profile is generated by obtaining GPU information for multiple types of equipment, all of which are equipment equipped with a GPU; classifying the multiple types of equipment into multiple equipment types based on the GPU information, with each equipment type corresponding to multiple types of equipment; selecting, for each equipment type, one type of representative equipment from all equipment corresponding to the equipment type, obtaining a suitable number of GPU child threads corresponding to the representative equipment of the equipment type, and setting the suitable number of GPU child threads as the suitable number of GPU child threads corresponding to the equipment type; and generating a profile based on a mapping relationship between each type of equipment type and the suitable number of GPU child threads.
[0010] In some embodiments, the step of obtaining a suitable number of GPU child threads corresponding to representative equipment of the equipment type includes obtaining a plurality of candidate numbers of GPU child threads; for each of the candidate numbers of GPU child threads, setting the number of candidate GPU child threads as a parameter of a specified OpenCL program, obtaining the time required for representative equipment of the equipment type to execute the specified task using the specified OpenCL program; and setting the corresponding number of candidate GPU child threads having the shortest required time as the suitable number of GPU child threads corresponding to representative equipment of the equipment type.
[0011] In some embodiments, the GPU information includes a GPU manufacturer name, and the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple manufacturer types based on a GPU manufacturer name of each type of equipment, and all equipment corresponding to each manufacturer type has the same manufacturer name.
[0012] In some embodiments, the GPU information includes a GPU model number, and the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple GPU model types based on a GPU model number of each type of equipment, and all equipment corresponding to each GPU model type has the same GPU model number.
[0013] In some embodiments, the step of selecting one type of representative equipment from all equipment corresponding to the equipment type includes obtaining index data for each piece of equipment corresponding to the equipment type based on a predetermined quantitative indicator, the quantitative indicator including market coverage and / or equipment performance, and selecting one type of representative equipment from all equipment corresponding to the equipment type based on the index data for each piece of equipment.
[0014] In some embodiments, selecting one type of representative equipment from all equipment corresponding to the equipment type based on the index data of each equipment includes selecting the most typical equipment of all equipment in the equipment type as the representative equipment by comparing the index data of each equipment.
[0015] In some embodiments, the step of selecting one type of representative equipment from all equipment corresponding to the equipment type based on the index data of each piece of equipment includes determining an intermediate value of the index data of all equipment corresponding to the equipment type based on the index data of each piece of equipment, selecting equipment from all equipment corresponding to the equipment type whose index data is closest to the intermediate value, and setting the selected equipment as representative equipment for the equipment type.
[0016] An embodiment of the present disclosure provides a task execution device applied to a target equipment in which a GPU is configured, the device including: a file acquisition module for acquiring a profile in response to receiving an execution command for a specified task, the specified task being a task executed based on a GPU, the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, the suitable number of GPU child threads being the number of GPU child threads adopted when a representative equipment of the equipment type takes the shortest time to execute the specified task based on its GPU; a type determination module for determining a target equipment type to which the target equipment belongs based on the profile; and a task execution module for executing the specified task by adopting a suitable number of GPU child threads corresponding to the target equipment type.
[0017] An embodiment of the present disclosure further provides an electronic device including a processor and a memory for storing instructions executable by the processor, the processor being configured to read the executable instructions from the memory and execute the instructions to realize a task execution method according to an embodiment of the present disclosure.
[0018] An embodiment of the present disclosure further provides a computer-readable storage medium having stored thereon a computer program for executing a task execution method according to an embodiment of the present disclosure.
[0019] An embodiment of the present disclosure further provides a computer program comprising instructions that, when executed by a processor, cause the processor to perform a task execution method according to an embodiment of the present disclosure.
[0020] It should be understood that the contents described in this section are not intended to identify key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily apparent from the following specification. [Brief description of the drawings]
[0021] The drawings herein, which are incorporated in and constitute a part of this specification, illustrate preferred embodiments of the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
[0022] In order to more clearly describe the technical solutions in the embodiments or prior art of the present disclosure, the following briefly introduces drawings that need to be used in the description of the embodiments or prior art. Obviously, a person skilled in the art can obtain other drawings based on these drawings without creative efforts.
[0023] [Figure 1] 1 is a schematic diagram illustrating a flow of a task execution method according to an embodiment of the present disclosure. [Diagram 2] 1 is a schematic diagram illustrating a flow of a profile generation method according to an embodiment of the present disclosure. [Diagram 3] 1 is a schematic diagram illustrating a flow of a profile generation method according to an embodiment of the present disclosure. [Figure 4] 1 is a schematic diagram illustrating a configuration of a task execution device according to an embodiment of the present disclosure. [Diagram 5] FIG. 2 is a schematic configuration diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0024] In order to make the above objects, features and advantages of the present disclosure more clearly understandable, the following further describes the aspects of the present disclosure. It should be noted that, unless contradictory, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0025] In order to fully understand the present disclosure, many specific details are described in the following description, but the present disclosure may be embodied in other forms different from those described herein. Apparently, the embodiments in the specification are only some embodiments of the present disclosure, but not all embodiments.
[0026] The inventors of the present disclosure have found through research that the number of GPU child threads affects the task execution effect, for example, the time required to complete a task. In addition, the number of types of equipment equipped with GPUs on the market is very large, and taking mobile phones as an example, there are thousands of them. In the related art, it is difficult to determine the appropriate number of GPU child threads for each type of equipment at great cost. Therefore, simply adopting a unified default number of GPU child threads for each equipment to execute a task does not result in good task execution effect.
[0027] Specifically, the inventors of the present disclosure have found through research that the number of GPU child threads (i.e., local work size) affects the effect of the GPU executing a specified task such as image rendering. The number of GPU child threads is also a core parameter of OpenCL (Open Computing Language). GPUs are specialized in executing highly threaded parallel processing tasks. Meanwhile, OpenCL belongs to a general-purpose parallel computing language and widely supports multiple types of equipment in which GPUs are arranged, such as mobile terminal equipment and desktop terminal equipment. In other words, OpenCL can widely support different types of GPUs, and the number of GPU child threads has a relatively large effect on the performance of OpenCL, for example, it may affect the performance by 10% to 70%. The performance impact is mainly manifested by the task execution effect being affected. Specifically, this task execution effect is mainly the task execution time required, for example, an inappropriate number of GPU child threads directly increases the time required to adopt OpenCL to execute a specified task. Therefore, it may be necessary to find a suitable number of GPU child threads for each type of equipment. However, there are many types of devices equipped with GPUs on the market, and there are hundreds of thousands of model numbers for mobile phones alone, so it is unrealistic and requires a huge amount of effort to obtain an appropriate number of GPU child threads for each type of device.The method adopted in the related technology simply adopts a default number of GPU child threads that is unified for many devices to execute tasks, and there is a need to improve the task execution efficiency.
[0028] Therefore, the embodiments of the present disclosure provide a task execution method, device, equipment and medium, which will be described in detail below for ease of understanding.
[0029] Moreover, the shortcomings in the related art are also the result of the Applicant's practice and intensive research, and therefore the process of discovering the above shortcomings and the solutions proposed below in the embodiments of the present application should both be regarded as the Applicant's contributions to the present application.
[0030] 1 is a schematic diagram showing a flow of a task execution method according to an embodiment of the present disclosure. The method is applied to a target device in which a GPU is arranged. For example, the target device is a mobile terminal such as a mobile phone, a computer, etc. As shown in FIG. 1, the method mainly includes the following steps S102 to S106.
[0031] In step S102, in response to receiving an execution command for a specified task, a profile is acquired. The specified task is a task executed based on a GPU. The profile includes a mapping relationship between an equipment type and a suitable number of GPU child threads, and the suitable number of GPU child threads is the number of GPU child threads adopted when one type of representative equipment in the equipment type requires the shortest time to execute the specified task based on its GPU. Here, the equipment type is the type to which the equipment belongs.
[0032] The designated task may be, for example, an image rendering task. In one specific example, in consideration of the high versatility of OpenCL to GPUs, the designated task may be a task executed by adopting an OpenCL program. The embodiment of the present disclosure is not limited to a specific designated task. Exemplarily, any task executed based on OpenCL may be the designated task. An instruction to execute the designated task may be directly initiated by a user, or may be automatically initiated when necessary by a system / platform related to the designated task.
[0033] In some embodiments, the target equipment may obtain the profile in a specified manner. When downloading the profile in a specified manner, the target equipment may automatically download the profile when performing a specified task according to user settings, may prompt the user to download the profile by himself, or may directly import the profile into the target equipment and store the profile in a specified location according to the user settings. Based on the above description, the target equipment may directly read the profile from the specified location when receiving a command to perform a specified task. In some other embodiments, the target equipment downloads the profile in the above specified manner after receiving a command to perform a specified task.
[0034] The profile may be generated in advance and mainly includes a mapping relationship (also called a correspondence relationship) between equipment types and the preferred number of GPU child threads. Specifically, the profile includes a plurality of types of equipment types, each of which corresponds to one preferred number of GPU child threads. In the embodiment of the present disclosure, a plurality of types of equipment in which GPUs are arranged can be classified into a plurality of equipment types, each of which corresponds to a plurality of types of equipment, and all equipment corresponding to each equipment type has a certain GPU commonality, and the GPU commonality corresponding to different equipment types is different. In some embodiments, the profile includes a mapping relationship between the equipment type and the preferred number of GPU child threads, and further includes an equipment identifier of all equipment in each equipment type. In some other embodiments, the profile includes a mapping relationship between the equipment type and the preferred number of GPU child threads, and further includes a classification method of the equipment type, for example, a classification according to a GPU manufacturer to obtain a plurality of equipment types, each of which corresponds to a GPU manufacturer name, and a classification according to a GPU model number to obtain a plurality of equipment types, each of which corresponds to a GPU model number.
[0035] In the above profile, the suitable number of GPU child threads corresponding to each equipment type is the number of GPU child threads adopted when one type of representative equipment in the equipment type takes the shortest time to execute a specified task based on its GPU (i.e., the GPU of the representative equipment), and the suitable number of GPU child threads corresponding to the representative equipment is the suitable number of GPU child threads corresponding to the equipment type, that is, the suitable number of GPU child threads corresponding to all equipment in the equipment type. Considering that there are a large number of types of equipment in which existing GPUs are arranged, and the cost required to determine a more suitable number of GPU child threads corresponding to each type of equipment is enormous, the profile according to the embodiment of the present disclosure classifies multiple types of equipment into multiple types, selects one representative equipment for each type, and only determines the suitable number of GPU child threads corresponding to the representative equipment, and the suitable number of GPU child threads corresponding to the representative equipment is the suitable number of GPU child threads corresponding to the equipment type, which is more convenient, executable, and can be realized at low cost.
[0036] In some embodiments, the representative equipment corresponding to an equipment type may be the most typical equipment among all the equipment in the equipment type. For example, the intermediate equipment in each equipment type may be the representative equipment. In practical applications, the representative equipment corresponding to each equipment type may be manually designated, or the equipment information of all the equipment in each equipment type may be acquired, and the equipment that meets a predetermined rule may be automatically selected from among them by comparing the equipment information, and the selected equipment is the representative equipment. The predetermined rule may be set according to needs. For example, among all the equipment in the equipment type, the equipment whose GPU performance parameter is in the middle is set as the representative equipment. In some embodiments, the representative equipment may be made to execute a predetermined OpenCL program to traverse multiple types of GPU child thread numbers (for example, all possible thread numbers that can be enumerated), find the GPU child thread number that requires the least time, and the found thread number may be set as the suitable GPU child thread number for the representative equipment.
[0037] In step S104, a target equipment type to which the target equipment belongs is determined based on the profile.
[0038] In some embodiments, the profile records equipment identifiers of multiple types of equipment corresponding to each equipment type. In this case, the profile may be searched for an equipment type corresponding to the equipment identifier of the target equipment, and the searched equipment type may be set as the target equipment type to which the target equipment belongs. For example, the profile records three equipment types (types A, B, and C, respectively), and records equipment identifiers a1, a2, a3 to a85 belonging to type A, equipment identifiers b1, b2, b3 to b70 belonging to type B, and equipment identifiers c1, c2, c3 to c121 belonging to type C. When the equipment identifier of the target equipment is b35, the corresponding equipment type is type B.
[0039] In some other embodiments, the profile records a classification method of equipment types. The classification method includes classification according to GPU manufacturer name or classification according to GPU model number. In this case, the target equipment type to which the target equipment belongs may be determined based on the classification method of equipment types recorded in the profile and the GPU information of the target equipment. For example, the profile records three equipment types classified according to GPU manufacturer names, where type A corresponds to manufacturer A, type B corresponds to manufacturer B, and type C corresponds to manufacturer C. On the other hand, if the GPU information of the target equipment indicates that the manufacturer of the target equipment is A, the equipment type corresponding to the target equipment is type A.
[0040] All of the above are illustrative and should not be considered as limiting.
[0041] In step S106, a suitable number of GPU child threads corresponding to the target equipment type is adopted to execute the designated task.
[0042] As can be seen, since equipment of the same equipment type generally has a certain commonality, the time required for the target equipment to adopt the suitable number of GPU child threads corresponding to the representative equipment of the equipment type to execute the task is generally short.Compared with adopting the default number of GPU child threads, the above method is easy to implement and can effectively improve the task execution effect.
[0043] Thus far, a task execution method according to some embodiments of the present disclosure is provided. In this method, a target equipment in which a GPU is arranged acquires a profile in response to receiving an execution command for a designated task, the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, and the suitable number of GPU child threads is the number of GPU child threads adopted when a representative equipment of one type of equipment type takes the shortest time to execute the designated task based on its GPU. Then, a target equipment type to which the target equipment belongs is determined based on the profile, and the suitable number of GPU child threads corresponding to the target equipment type are adopted to execute the designated task. According to the above method, when executing the designated task, a profile in which a mapping relationship between an equipment type and a suitable number of GPU child threads is recorded is acquired, and the suitable number of GPU child threads corresponding to the target equipment type to which the target equipment belongs can be adopted to execute the designated task. The suitable number of GPU child threads corresponding to the target equipment type is the number of GPU child threads adopted when a representative equipment of the equipment type takes the shortest time to execute the designated task. Since equipment of the same equipment type usually has a certain commonality, the time required for the target equipment to execute a task by adopting a suitable number of GPU child threads corresponding to the representative equipment of the equipment type is usually short. Compared with adopting the default number of GPU child threads, the above method is easy to implement and can effectively improve the task execution effect. Based on the above description, the embodiment of the present disclosure further provides a profile generation method. FIG. 2 is a schematic diagram showing the flow of the profile generation method according to the embodiment of the present disclosure. The method includes the following steps S202 to S208.
[0044] In step S202, GPU information of multiple types of equipment is obtained, all of which are equipment equipped with GPUs.
[0045] In practical applications, the number of types of the above equipment may be set according to needs, and no limitation is imposed here. For example, based on mainstream equipment such as mobile phones and computers currently in the market, GPU information corresponding to various equipment models circulating in the market within a specified period (e.g., the last 5 years) of such mainstream equipment may be obtained, or GPU information of all knowable various equipment currently existing in the network or market may be obtained. In some embodiments, the GPU information includes a GPU manufacturer name or a GPU model number. Examples of GPU manufacturer names include Qualcomm, mali, powerVR, etc., and examples of GPU models include mali G77, mali G76, adreno510, etc.
[0046] In step S204, the multiple types of equipment are classified into multiple equipment types based on the GPU information, and each equipment type corresponds to multiple types of equipment.
[0047] Since GPU information is associated with each piece of equipment, the equipment can be divided into multiple types based on the GPU information, and multiple types of equipment are associated with each type, and all equipment associated with each type has a certain degree of GPU commonality, and the commonality associated with different types is different. For example, in some embodiments, there are multiple types of equipment, and each type of equipment is equipped with a GPU, but the number of current GPU manufacturers is so small that it can be counted on one's fingers, and the GPUs adopted in many pieces of equipment are all manufactured by the same manufacturer. Therefore, multiple types of equipment can be divided into multiple types based on the GPU manufacturer. Also, for example, the number of existing GPU model numbers is far less than the types of equipment, and the GPU model numbers adopted in some pieces of equipment are the same. For this reason, multiple types of equipment can be divided into multiple types based on the GPU model number.
[0048] In step S206, for each equipment type, one type of representative equipment is selected from all equipment corresponding to the equipment type, and a suitable number of GPU child threads corresponding to the representative equipment of the equipment type is obtained, and the suitable number of GPU child threads is set as the suitable number of GPU child threads corresponding to the equipment type. In other words, the suitable number of GPU child threads corresponding to the representative equipment of the equipment type is set as the suitable number of GPU child threads for all equipment corresponding to the equipment type. Here, the suitable number of GPU child threads is the number of GPU child threads adopted when the time required for the GPU of the representative equipment to execute the specified task is the shortest. Since the task execution effect is mainly reflected in the task required time, the embodiment of the present disclosure can determine whether the number of GPU child threads is suitable based on the time required to execute the specified task. In some embodiments, all possible numbers of GPU child threads may be enumerated, and the representative equipment may employ each of the possible GPU child thread numbers one by one to execute the designated task to determine the time required for each number of GPU child threads, and the number of GPU child threads requiring the shortest time may be determined as the preferred number of GPU child threads for the representative equipment, which may in fact be referred to as the optimal number of GPU child threads for the representative equipment.
[0049] The above steps are classified according to the GPU information of each device, and all the corresponding devices of each type actually have a certain GPU commonality, for example, the types are classified according to GPU manufacturers or types are classified according to GPU model numbers, and the GPUs of all the devices of the same type are actually not very different, and mostly only some characteristics of the GPU are changed or improved, and most of the characteristics are the same. Therefore, the suitable number of GPU child threads of a representative device of each type is also, to a certain extent, the relatively suitable number of GPU child threads of other devices of the same type. Although it is not necessarily optimal, it is closer to the GPU characteristics of the device itself than the unified default number of GPU child threads, so the task execution effect is better, and the time required is usually less than the time required by the unified default number of GPU child threads.
[0050] In step S208, a profile is generated based on the mapping relationship between each type of equipment and the appropriate number of GPU child threads. Specifically, the mapping relationship (correspondence) between each type of equipment and the appropriate number of GPU child threads may be recorded in one file, and the file may be used as the profile.
[0051] In practical applications, the profile may be distributed through a network or other methods, and when each device employs a GPU to perform a specific task that requires a number of GPU child threads, the device may obtain the profile through a network download, data import, or other methods, and then query the suitable number of GPU child threads corresponding to the device from the profile. In some embodiments, the profile may be one large file, in which the suitable number of GPU child threads corresponding to each type and the device identifier (device model number) corresponding to each type are recorded, and the suitable number of GPU child threads corresponding to all devices of the same type are all the same. In other embodiments, the profile may include multiple sub-files, in which the suitable number of GPU child threads corresponding to one type and the device identifier of the type are recorded. After obtaining the profile, the target device can directly search the suitable number of GPU child threads corresponding to it from the profile based on its own identifier. Since multiple types of existing devices can all obtain the suitable number of GPU child threads corresponding to themselves through the profile, the profile has multi-device compatibility, and each device can realize automatic device adaptation by reading the profile.
[0052] The above-mentioned profile generating method according to the embodiment of the present disclosure performs classification according to GPU information, and the equipment corresponding to each classified type usually has a certain GPU commonality. Therefore, the number of GPU child threads adopted when the time required for the representative equipment to execute a specified task is the shortest (the preferred number of GPU child threads of the representative equipment) can be the preferred number of GPU child threads of other equipment in the same type, that is, the preferred number of GPU child threads corresponding to each type of equipment can be obtained. Compared with the case where the default number of GPU child threads is uniformly adopted as in the related art, the above method according to the embodiment of the present disclosure can easily and quickly obtain the preferred number of GPU child threads corresponding to each type of equipment and record it in the profile, which contributes to improving the task execution effect of each subsequent equipment. In addition, since the embodiment of the present disclosure obtains the preferred number of GPU child threads of the representative equipment for each type, it is more feasible and less costly than the method of obtaining the preferred number of GPU child threads for each of a large number of equipment.
[0053] The embodiment of the present disclosure has been described in which multiple types of equipment are classified into multiple equipment types based on GPU information. The equipment types may be manufacturer types or GPU model types, and may be realized by referring to the following (1) and (2).
[0054] (1) When the GPU information is the name of a GPU manufacturer, the multiple types of equipment are divided into multiple manufacturer types based on the GPU manufacturer name of each type of equipment, and all equipment corresponding to each manufacturer type has the same manufacturer name. For example, taking the Android (registered trademark) camp of mobile terminals as an example, it can be mainly divided into three major manufacturers, namely, Qualcomm, Mali, and PowerVR. As can be seen, since there are only a few existing GPU manufacturers, multiple types of equipment can be roughly divided into multiple manufacturer types, for example, all equipment using GPUs made by Qualcomm belongs to the Qualcomm type, and all equipment using GPUs made by Mali belongs to the Mali type, etc.
[0055] That is, in some embodiments, the GPU information includes a GPU manufacturer name, and the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple manufacturer types based on a GPU manufacturer name of each type of equipment, and all equipment corresponding to each manufacturer type has the same manufacturer name.
[0056] (2) When the GPU information is a GPU model number, multiple types of equipment are divided into multiple GPU model number types based on the GPU model number of each type of equipment, and all equipment corresponding to each GPU model number type has the same GPU model number. As can be understood, there are many existing equipment, and most of the equipment all use the same GPU model number, so it is possible to finely divide multiple types of equipment into multiple GPU model number types.
[0057] That is, in some embodiments, the GPU information includes a GPU model number, and the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple GPU model types based on the GPU model number of each type of equipment, and all equipment corresponding to each GPU model type has the same GPU model number.
[0058] As can be seen, the above (1) is a coarse-grained classification method. For example, there are mainly three or four mainstream manufacturers, so the number of classification types is so small that it can be counted on one's fingers. The above (2) is a fine-grained classification method. For example, there are about 50 mainstream GPU model numbers, so the number of classification types is relatively large, but it is still far smaller than the number of equipment that can be counted in a thousand. In practical applications, the above (1) or (2) can be flexibly selected according to needs. For example, if the requirement for the time required for a GPU to perform a specified task is not high, the above (1) can be simply adopted. If the requirement for the task time is high, the above (2) can be adopted for classification. The above is merely an illustrative explanation and should not be considered as a limitation. In practical applications, it is also possible to further classify according to the series type of the same GPU manufacturer based on GPU information, for example, into mali5 series type, mali6 series type, etc.
[0059] After dividing the equipment into a plurality of equipment types, one type of representative equipment may be selected for each equipment type from among all the equipment corresponding to the equipment type. For example, this may be achieved by referring to the following steps 1 and 2.
[0060] In step 1, index data of each equipment corresponding to the equipment type is obtained based on a predetermined metric indicator, and the metric indicator includes market coverage and / or equipment performance. Market coverage is also called market share and can be obtained by a network statistical method. In some embodiments, equipment performance can be reflected by the time it takes for equipment to perform a task. For example, when performing the same task, the shorter the time, the better the equipment performance. In practical applications, each equipment is openly used in the market, and the equipment performance is also a public parameter, so that the performance of each equipment can be easily and directly obtained by a network method.
[0061] In step 2, one type of representative equipment is selected from all the equipment corresponding to the equipment type based on the index data of each equipment.
[0062] By collating the index data of each equipment, the most typical equipment can be found and set as the representative equipment, that is, the most typical equipment among all the equipment in the equipment type can be set as the representative equipment. In some implementations, the medium equipment in each type can be set as the representative equipment. In this case, the median value of the index data of all the equipment corresponding to the type can be determined based on the index data of each equipment, and the equipment whose index data is closest to the median value can be selected from all the equipment corresponding to the type, and the selected equipment can be set as the representative equipment of the type. The equipment whose index data is the median value (or closest to the median value) is the medium equipment. As can be understood, the medium equipment of each type usually has the general characteristics of the type, and in the type, whether it is a low-grade equipment or a high-grade equipment, both are close to the GPU performance of the medium equipment to some extent. Therefore, the medium equipment can be selected to objectively represent all the equipment in the type, and the suitable number of GPU child threads of the medium equipment can be set as the suitable number of GPU child threads corresponding to other equipment in the same type.
[0063] Furthermore, the embodiment of the present disclosure provides a specific embodiment for acquiring a suitable number of GPU child threads corresponding to the representative equipment of the equipment type, and includes the following steps a to c.
[0064] In step a, a number of candidate GPU child thread numbers are obtained. In some embodiments, the number of candidate GPU child thread numbers may be determined based on an enumeration method, that is, the possible GPU child thread numbers may be enumerated by enumerating all of them.
[0065] In step b, for each number of candidate GPU child threads, the number of candidate GPU child threads is set as a parameter of a predetermined OpenCL program, and the time required for the representative equipment of the equipment type to adopt the predetermined OpenCL program to execute the designated task is obtained. Since OpenCL widely supports GPUs, the designated task can be executed by adopting the predetermined OpenCL program. The number of GPU child threads is a parameter required by the OpenCL program, specifically, a kernel function parameter of OpenCL, and directly affects the performance (required time) of the OpenCL program to execute the task. Therefore, all of the equipment in the embodiment of the present disclosure can adopt a predetermined OpenCL program to execute the designated task. In practical application, a predetermined timing method is adopted to determine the time required to execute the designated task, and for example, the clGetEventProfilingInfo function may be adopted to measure the time.
[0066] In step c, the number of corresponding candidate GPU child threads with the shortest required time is determined as the number of suitable GPU child threads corresponding to the representative equipment of the equipment type.
[0067] The corresponding candidate GPU child thread number with the shortest required time is actually the optimal GPU child thread number corresponding to the representative device. That is, compared with other candidate GPU child thread numbers, it has the best task execution effect. In addition, in practical applications, the GPU child thread number is a kernel function parameter of OpenCL, and since there can be multiple types of kernel functions, a suitable GPU child thread number corresponding to each type of kernel function can be determined one by one. That is, the above steps a to c are performed for each type of kernel function, and the finally obtained suitable GPU child thread number of the representative device includes the suitable GPU child thread numbers corresponding to the multiple kernel functions.
[0068] Based on the above description, the embodiment of the present disclosure further provides a profile generating method. Figure 3 is a schematic diagram showing a flow of the profile generating method according to the embodiment of the present disclosure. The method mainly includes the following steps S302 to S310.
[0069] In step S302, GPU information of multiple types of equipment is acquired. All of the equipment is equipped with a GPU. If the GPU information is a GPU manufacturer name, step S304 is executed, and if the GPU information is a GPU model number, step S306 is executed.
[0070] In step S304, the multiple types of equipment are classified into multiple manufacturer types based on the GPU manufacturer name of each type of equipment.
[0071] In step S306, the multiple types of equipment are classified into multiple GPU model number types based on the GPU model number of each type of equipment.
[0072] In step S308, for each type, one type of representative equipment is selected from all equipment corresponding to that type, a suitable number of GPU child threads corresponding to the representative equipment of that type is obtained, and the suitable number of GPU child threads is set as the suitable number of GPU child threads for all equipment corresponding to that type.
[0073] In step S310, the mapping relationship between each type of equipment and the suitable number of GPU child threads is stored in a profile. In this way, the profile can be directly provided to the target equipment that executes the designated task later, and the GPU of the target equipment can execute the designated task according to the suitable number of GPU child threads recorded in the profile.
[0074] In practical applications, either one of steps S304 and S306 may be selected and executed, or both may be executed, and two profiles may be generated for different types, one being a coarse-grained profile classified according to the manufacturer, and the other being a fine-grained profile classified according to the GPU model number. Then, the device may determine which profile to adopt the preferred number of GPU child threads based on the time needs required to execute the task. For example, when the time requirement is not high, the preferred number of GPU child threads in the coarse-grained profile may be adopted, and when the time requirement is high, the preferred number of GPU child threads in the fine-grained profile may be adopted.
[0075] The above steps in FIG. 3 proposed by the embodiments of the present disclosure and their beneficial effects may be realized with reference to the above related content, so they will not be further described here.
[0076] Also, in practical applications, the GPU is a chip in a graphics card, and in some embodiments, the GPU model number may be directly equivalent to the graphics card model number. Therefore, in the above-mentioned method according to the embodiment of the present disclosure, the GPU model number may be the graphics card model number, such as Adreno graphics card, Mali graphics card, powerVR graphics card, AMD graphics card, intel graphics card and AMD graphics card, Nvidia graphics card, etc. OpenCL can widely support different types of GPUs, and it can also be said that OpenCL widely supports different types of graphics cards.
[0077] As described above, in the task execution method according to the embodiment of the present disclosure, the target equipment in which the GPU is arranged can acquire a profile in which a mapping relationship between the equipment type and the suitable number of GPU child threads is recorded when executing a specified task, and can execute the specified task by adopting the suitable number of GPU child threads corresponding to the target equipment type to which the target equipment belongs. The suitable number of GPU child threads corresponding to the target equipment type is the number of GPU child threads adopted when the time required for the representative equipment of the equipment type to execute the specified task is the shortest. Since equipment of the same equipment type usually has a certain commonality, the time required for the target equipment to execute a task by adopting the suitable number of GPU child threads corresponding to the representative equipment of the equipment type is usually short. Therefore, compared with the case of adopting the default number of GPU child threads, the above method can be easily realized and can effectively improve the task execution effect.
[0078] The above method is well suited for OpenCL-related scenarios (where the number of GPU child threads needs to be used), and can effectively improve the performance of tasks executed based on OpenCL. According to studies, a performance gain of 10% to 70% can be achieved.
[0079] Corresponding to the task execution method according to the embodiment of the present disclosure, the embodiment of the present disclosure provides a task execution device, which is applied to a target device in which a GPU is arranged. Referring to the configuration diagram of the task execution device shown in Figure 4, the task execution device includes a file acquisition module 402, a classification determination module 404, and a task execution module 406.
[0080] The file acquisition module 402 is for acquiring a profile in response to receiving an execution command for a specified task, the specified task being a task executed based on a GPU, the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, the suitable number of GPU child threads being the number of GPU child threads adopted when one type of representative equipment in the equipment type takes the shortest time to execute the specified task based on its GPU.
[0081] The type determination module 404 is for determining a target equipment type to which the target equipment belongs based on the profile.
[0082] The task execution module 406 is for employing a suitable number of GPU child threads corresponding to the target equipment type to execute the designated task.
[0083] The above-mentioned device according to the embodiment of the present disclosure can obtain a profile in which a mapping relationship between equipment types and suitable GPU child thread numbers is recorded when executing a specified task, and can adopt a suitable GPU child thread number corresponding to a target equipment type to which a target equipment belongs to execute the specified task. The suitable GPU child thread number corresponding to a target equipment type is the number of GPU child threads adopted when the time required for a representative equipment of the equipment type to execute a specified task is the shortest. Since equipment of the same equipment type usually has a certain commonality, the time required for the target equipment to execute a task by adopting a suitable GPU child thread number corresponding to a representative equipment of the equipment type is usually short. Compared with the case of adopting a default GPU child thread number, the above method can be easily implemented and can effectively improve the task execution effect.
[0084] In some embodiments, the profile records equipment identifiers of multiple types of equipment corresponding to each of the equipment types, and the type determination module specifically searches the profile for an equipment type that corresponds to the equipment identifier of the target equipment, and sets the searched equipment type as the target equipment type to which the target equipment belongs.
[0085] In some embodiments, the profile records a classification method for the equipment type, the classification method including classification according to a GPU manufacturer name or classification according to a GPU model number, and the type determination module is specifically for determining a target equipment type to which the target equipment belongs based on the classification method for the equipment type recorded in the profile and GPU information of the target equipment.
[0086] In some embodiments, the GPU information includes a GPU manufacturer name or a GPU model number.
[0087] In some embodiments, all equipment corresponding to each equipment type has a certain GPU commonality, and the GPU commonality corresponding to different equipment types is different.
[0088] In some embodiments, the device further includes a file generation module used for obtaining GPU information for multiple types of equipment, each of which is equipped with a GPU; classifying the multiple types of equipment into multiple equipment types based on the GPU information, with each equipment type corresponding to multiple types of equipment; selecting, for each equipment type, one type of representative equipment from all equipment corresponding to the equipment type, obtaining a suitable number of GPU child threads corresponding to the representative equipment of the equipment type, and setting the suitable number of GPU child threads as the suitable number of GPU child threads corresponding to the equipment type; and generating a profile based on a mapping relationship between each type of equipment type and the suitable number of GPU child threads.
[0089] In some embodiments, the file generation module is specifically used for obtaining a number of candidate GPU child threads, for each of the number of candidate GPU child threads, setting the number of candidate GPU child threads as a parameter of a predetermined OpenCL program, obtaining a time required for a representative equipment of the equipment type to execute the specified task by adopting the predetermined OpenCL program, and setting the number of candidate GPU child threads corresponding to the shortest required time as a suitable number of GPU child threads corresponding to the representative equipment of the equipment type. In some embodiments, the GPU information includes a GPU manufacturer name. The file generation module is used to classify the multiple types of equipment into multiple manufacturer types based on the GPU manufacturer name of each type of equipment, and all equipment corresponding to each manufacturer type has the same manufacturer name.
[0090] In some embodiments, the GPU information includes a GPU model number, and the file generation module is for classifying the multiple types of equipment into multiple GPU model types based on the GPU model number of each type of equipment, where all corresponding equipment of each GPU model type has the same GPU model number.
[0091] In some embodiments, the GPU information includes a GPU manufacturer name or a GPU model number, and the file generation module is specifically used for, if the GPU information is a GPU manufacturer name, classifying the multiple types of equipment into multiple manufacturer types based on the GPU manufacturer name of each type of equipment, where all equipment corresponding to each manufacturer type has the same manufacturer name, and, if the GPU information is a GPU model number, classifying the multiple types of equipment into multiple GPU model number types based on the GPU model number of each type of equipment, where all equipment corresponding to each GPU model number type has the same GPU model number.
[0092] In some embodiments, the file generation module is specifically used for obtaining index data for each piece of equipment corresponding to the equipment type based on predetermined quantitative indicators, the quantitative indicators including market coverage and / or equipment performance, and for selecting one type of representative equipment from all pieces of equipment corresponding to the equipment type based on the index data for each piece of equipment.
[0093] In some embodiments, the file generation module is configured to collate index data for each piece of equipment to determine the most representative equipment among all equipment of the equipment type.
[0094] In some embodiments, the file generation module is specifically used to determine an intermediate value of the index data of all equipment corresponding to the equipment type based on the index data of each equipment, select equipment whose index data is closest to the intermediate value from all equipment corresponding to the equipment type, and set the selected equipment as representative equipment for the equipment type.
[0095] The task execution device according to the embodiments of the present disclosure can execute the task execution method according to any embodiment of the present disclosure, and has beneficial effects with the functional modules corresponding to the execution of the method.
[0096] In order to make it clear to those skilled in the art, for convenience and conciseness of description, the specific operating processes of the above-described apparatus embodiments can be referred to the corresponding processes in the corresponding method embodiments, and will not be further described herein.
[0097] An embodiment of the present disclosure further provides an electronic device including a memory for storing processor-executable instructions, and a processor for reading the executable instructions from the memory and executing the instructions to realize the above task execution method.
[0098] 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 5, the electronic device 500 includes one or more processors 501 and a memory 502.
[0099] The processor 501 may be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities, and may control other components in the electronic device 500 to perform desired functions.
[0100] The memory 502 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache). The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored in the computer-readable storage medium, and the processor 501 may execute the program instructions to realize the method of performing the tasks of the embodiments of the present disclosure described above and / or other desired functions. The computer-readable storage medium may further store various contents, such as, for example, an input signal, a signal component, a noise component, etc.
[0101] In one example, electronic equipment 500 may further include input devices 503 and output devices 504, these components being interconnected by a bus system and / or other form of connection (not shown).
[0102] The input device 503 may further include, for example, a keyboard, a mouse, and the like.
[0103] The output device 504 can output various information including the determined distance information, direction information, etc. The output device 504 may include, for example, a display, a speaker, a printer, a communication network, and a remote output facility connected thereto.
[0104] Of course, for the sake of simplicity, Fig. 5 only shows some of the components related to the present disclosure in the electronic device 500, and omits components such as buses, input / output interfaces, etc. However, according to specific application situations, the electronic device 500 may further include any other suitable components.
[0105] In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product that includes computer program instructions that, when executed by a processor, cause the processor to perform a method for performing tasks according to embodiments of the present disclosure.
[0106] The computer program product may include program code written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as general procedural programming languages such as "C" or similar programming languages, for performing operations of the disclosed embodiments. The program code may run entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0107] Additionally, an embodiment of the present disclosure may be a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform a task execution method according to an embodiment of the present disclosure.
[0108] The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. The readable storage medium may include, as more specific examples (non-exhaustive list), an electrical connection having one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0109] An embodiment of the present disclosure further provides a computer program product including a computer program or instructions that, when executed by a processor, causes the computer program to implement the method for performing tasks in an embodiment of the present disclosure.
[0110] An embodiment of the present disclosure further provides a computer program comprising instructions that, when executed by a processor, cause the processor to perform a task execution method in an embodiment of the present disclosure.
[0111] It should be noted that, in this specification, relational terms such as "first" and "second" are used solely for the purpose of distinguishing one entity or operation from another entity or operation, and do not require or imply that such an actual relationship or sequence exists between these entities or operations. Furthermore, the terms "comprise", "include", or any other variation thereof, indicate a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a series of elements includes not only those elements, but also other elements not expressly stated or elements inherent in such process, method, article, or apparatus. Absent more limitations, an element limited by "comprises a..." does not exclude the inclusion of other identical elements in the process, method, article, or apparatus that includes the element.
[0112] The above are merely specific embodiments of the present disclosure, and are used to enable those skilled in the art to understand or realize the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to these embodiments herein, but has the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task execution method applied to a target device having a graphics processing unit (GPU), comprising: acquiring a profile in response to receiving an execution command for a designated task, the designated task being a task executed based on a GPU, the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, the suitable number of GPU child threads being a number of GPU child threads that is adopted when a representative equipment of one type in the equipment type requires the shortest time to execute the designated task based on its GPU; determining a target equipment type to which the target equipment belongs based on the profile; employing a suitable number of GPU child threads corresponding to the target equipment type to execute the specified task.
2. In the profile, equipment identifiers of a plurality of types of equipment corresponding to each of the equipment types are recorded, The step of determining a target equipment type to which the target equipment belongs based on the profile includes: The task execution method according to claim 1 , further comprising: searching the profile for an equipment type corresponding to an equipment identifier of the target equipment; and determining the retrieved equipment type as the target equipment type to which the target equipment belongs.
3. A classification method of the equipment type is recorded in the profile, and the classification method includes a classification according to a GPU manufacturer name or a classification according to a GPU model number, The step of determining a target equipment type to which the target equipment belongs based on the profile includes: The task execution method according to claim 1 , further comprising: determining a target equipment type to which the target equipment belongs based on a classification method of the equipment type recorded in the profile and GPU information of the target equipment.
4. The task execution method according to claim 3 , wherein the GPU information includes a GPU manufacturer name or a GPU model number.
5. The method of claim 1 , wherein all equipment corresponding to each equipment type has a certain GPU commonality, and the GPU commonality corresponding to different equipment types is different.
6. The profile may include: Acquiring GPU information of a plurality of types of equipment, each of which is equipped with a GPU; The plurality of types of equipment are classified into a plurality of equipment types based on the GPU information, and each equipment type corresponds to a plurality of types of equipment; selecting, for each equipment type, one type of representative equipment from all equipment corresponding to the equipment type, obtaining a suitable number of GPU child threads corresponding to the representative equipment of the equipment type, and setting the suitable number of GPU child threads as the suitable number of GPU child threads corresponding to the equipment type; Generating a profile based on a mapping relationship between each type of equipment and a suitable number of GPU child threads; The task execution method according to any one of claims 1 to 5, wherein the task execution method is generated by:
7. The step of acquiring a suitable number of GPU child threads corresponding to the representative equipment of the equipment type includes: Obtaining a number of candidate GPU child threads; For each number of the candidate GPU child threads, the number of the candidate GPU child threads is set as a parameter of a predetermined open computing language OpenCL program, and a time required for a representative equipment of the equipment type to employ the predetermined OpenCL program to execute the designated task is acquired; The task execution method according to claim 6 , further comprising: determining the number of corresponding candidate GPU child threads having the shortest required time as the suitable number of GPU child threads corresponding to the representative equipment of the equipment type.
8. The GPU information includes a GPU manufacturer name, 7. The task execution method according to claim 6, wherein the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple manufacturer types based on a GPU manufacturer name of each type of equipment, and all equipment corresponding to each manufacturer type has the same manufacturer name.
9. The GPU information includes a GPU model number, 7. The task execution method according to claim 6, wherein the step of classifying the multiple types of equipment into multiple equipment types based on the GPU information includes classifying the multiple types of equipment into multiple GPU model number types based on a GPU model number of each type of equipment, and all equipment corresponding to each GPU model number type has the same GPU model number.
10. The step of selecting one type of representative equipment from all the equipment corresponding to the equipment type includes: Acquiring index data for each facility corresponding to the facility type based on a predetermined quantitative indicator, the quantitative indicator including market coverage and / or facility performance; The task execution method according to claim 6 , further comprising: selecting one type of representative equipment from all the equipment corresponding to the equipment type based on the index data of each piece of equipment.
11. The task execution method according to claim 10, wherein selecting one type of representative equipment from all equipment corresponding to the equipment type based on the index data of each piece of equipment includes selecting the most typical equipment of all equipment in the equipment type as the representative equipment by comparing the index data of each piece of equipment.
12. The step of selecting one type of representative equipment from all the equipment corresponding to the equipment type based on the index data of each equipment includes: determining an intermediate value of the index data of all the pieces of equipment corresponding to the equipment type based on the index data of each piece of equipment; The task execution method according to claim 10, further comprising: selecting, from all equipment corresponding to the equipment type, equipment whose index data is closest to the median value, and setting the selected equipment as representative equipment of the equipment type.
13. A task execution device applied to a target device in which a GPU is arranged, a file acquisition module for acquiring a profile in response to receiving an execution command for a designated task, the designated task being a task executed based on a GPU, the profile including a mapping relationship between an equipment type and a suitable number of GPU child threads, the suitable number of GPU child threads being the number of GPU child threads employed when a representative equipment of one type in the equipment type requires the shortest time to execute the designated task based on its GPU; a type determination module for determining a target equipment type to which the target equipment belongs based on the profile; a task execution module for employing a suitable number of GPU child threads corresponding to the target equipment type to execute the specified task.
14. A processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the task execution method of any one of claims 1 to 5.
15. A computer-readable storage medium storing a computer program for executing the task execution method according to any one of claims 1 to 5.
16. A computer program comprising instructions which, when executed by a processor, cause the processor to perform the task execution method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing system, host processor and user terminal device thereof, and computer program and data processing method therefor
JP2009259195A
Information processing system, information processing method and information processor
JP2012003618A
Image processor, image processing method, and program
JP2016131579A
Resource management apparatus, resource management system, resource management method, and program
JP2021052365A
Feedback-driven tuning for efficient parallel execution
US20140019984A1