Task scheduling method and device
By reordering the order of tasks in the queue to be dispatched and inserting tasks according to the cache status, the problem of low cache hit rate of new tasks in computing devices is solved, and data access efficiency is improved.
Patent Information
- Application Number
- CN202210118739.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-08
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2042-02-08
AI Technical Summary
In computing devices with compute and storage separation architectures, the cache hit rate of the new tasks that are first run is low, and as the data set required for the task grows, the limited cache capacity of the cache system reduces the cache hit rate, resulting in data access Efficiency is limited.
By querying the cache status of the data required for the task in the computing device, reorder the order of tasks in the queue to be dispatched, determine the cache status of the target data, and determine the insertion position of the task based on the status, and reasonably arrange the execution order of the task. , to improve the cache hit rate and multiplex rate.
When the overall cache capacity is limited, the cache hit rate and multiplexing rate are improved, thereby improving data access efficiency.
Smart Images

Figure CN114579269B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a task scheduling method and device. Background Art
[0002] In order to solve the problem of limited data access speed in computing devices with a separate computing and storage architecture, deploying a cache system in the computing device is one of the solutions to the above problem. By deploying a cache system in a computing device, low-latency, high-bandwidth data access services can be provided for tasks submitted to the computing device. However, for new tasks that are run for the first time, the problem of low cache hit rate still exists. In addition, as the data set required for task calculations becomes larger and larger, the limited cache capacity of the cache system also limits the scope of cached data, further reducing the cache hit rate. Summary of the invention
[0003] In view of this, one or more embodiments of the present specification provide a task scheduling method and device.
[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a task scheduling method is proposed, including:
[0006] Determine target data accessed by the received new task and a cache state corresponding to the target data;
[0007] Determine the insertion position of the new task in the queue to be scheduled based on the cache state;
[0008] Insert the new task into the queue to be scheduled according to the insertion position.
[0009] According to a second aspect of one or more embodiments of this specification, a task scheduling device is provided, including:
[0010] a target data determining unit, configured to determine target data accessed by the received new task, and a cache status of the target data;
[0011] An insertion position determining unit, configured to determine an insertion position of the new task in the queue to be scheduled based on the cache state;
[0012] The first new task inserting unit is used to insert the new task into the queue to be scheduled according to the insertion position.
[0013] According to a third aspect of one or more embodiments of this specification, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0014] According to a fourth aspect of one or more embodiments of the present specification, there is provided an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method described in the first aspect are implemented.
[0015] According to a fifth aspect of one or more embodiments of this specification, a deep learning training job scheduling method is proposed, including:
[0016] Determine target data accessed by the received new job and a cache status of the target data;
[0017] Determine the insertion position of the new job in the queue to be scheduled based on the cache state;
[0018] The new job is inserted into the queue to be scheduled according to the insertion position.
[0019] In the technical solution provided in this specification, the order of the task in the queue to be scheduled is reordered by querying the cache status of the data required for the task in the computing device, and the execution order of each task is reasonably arranged. Under the premise that the overall cache capacity is limited, the cache hit rate and cache reuse rate are improved, thereby improving data access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram of the architecture of a task scheduling system provided by an exemplary embodiment of this specification;
[0021] Figure 2 is a flowchart of a task scheduling method provided by an exemplary embodiment of this specification;
[0022] Figure 3 is a schematic diagram of the structure of a scheduler provided by an exemplary embodiment of this specification;
[0023] Figure 4 is a flowchart of a deep learning training job scheduling method provided by an exemplary embodiment of this specification;
[0024] Figure 5 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of this specification;
[0025] Figure 6 is a schematic diagram of a task scheduling device provided by an exemplary embodiment of this specification;
[0026] Figure 7 It is a schematic diagram of another task scheduling device provided by an exemplary embodiment of this specification. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0028] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0029] In order to improve the hit rate of the cache stored in the cache system deployed in the computing device, this specification proposes a task scheduling method, which reorders the order of new tasks in the queue to be scheduled according to the cache status of the data required for the new tasks in the computing device, reasonably arranges the execution order of each task, and improves the cache hit rate and cache reuse rate under the premise that the overall cache capacity is limited.
[0030] Figure 1 This is a schematic diagram of the architecture of a task scheduling system shown in this specification. Figure 1 As shown, it may include a computing unit 11, a cache unit 12, a storage unit 13, a scheduling unit 14, a network 15 and an electronic device 16.
[0031] The computing unit 11 may be a physical server including an independent host, or the computing unit 11 may be a virtual server carried by a host cluster, and the cache unit 12, storage unit 13, and scheduling unit 14 are similar to the computing unit 11. Moreover, the above-mentioned units may be in the same physical device or in different physical devices, or one part of them may be in one physical device and the other part may be in another physical device or several physical devices. Alternatively, at least one of the above-mentioned four units may be a virtual server carried by a host cluster, and the rest may be physical servers in the same physical device or in different physical devices, and data may be transmitted between the virtual servers and the physical servers via the network 15. Of course, the above-mentioned four units may all be virtual servers carried by a host cluster, and data may be transmitted between the virtual servers via the network 15, and the above-mentioned computing units may be in the same computing cluster or in different computing clusters. During the operation, the computing unit 11 may be configured with a computing device, which may be implemented in software and / or hardware to run the new task submitted by the scheduling unit 11; the cache unit 12 may be configured with a task cache device, which may be implemented in software and / or hardware to retrieve the data required to read the task from the storage unit for pre-caching, thereby providing efficient data access services for the computing unit 11; the storage unit 13 may be configured with a data storage device, which may be implemented in software and / or hardware to store the data required for calculation; the scheduling unit 14 may be configured with a task scheduling device, which may be implemented in software and / or hardware to schedule the submitted new tasks, so that the computing unit 12 calculates the tasks in the order arranged by the scheduling unit 11.
[0032] The electronic device 16 refers to a type of electronic device that can be used by the user. In fact, the user can obviously also use electronic devices such as the following types: mobile phones, tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. During operation, the electronic device can be used by the user to submit tasks, the scheduling unit 14 receives the tasks submitted by the user, and reasonably schedules the tasks in the queue to be scheduled based on the solution of this specification, and the computing unit 11 executes the tasks in the queue to be scheduled in sequence.
[0033] The network 15 for interaction between the electronic device 16 and the scheduling unit 14 may include various types of wired or wireless networks. In one embodiment, the network 15 may include a public switched telephone network (PSTN) and the Internet.
[0034] Figure 2 is a flowchart of a task scheduling method provided by an exemplary embodiment of this specification, and the task scheduling method may include the following steps:
[0035] S201, determining target data accessed by a received new task and a cache status of the target data.
[0036] In an exemplary embodiment of the present specification, the above-mentioned task scheduling method can be applied to a scheduler in a Kubernetes computing cluster.
[0037] Kubernetes is an open source container automation operation and maintenance platform that can be used to simply and efficiently manage and control a computing cluster composed of multiple computers. In a Kubernetes computing cluster, each computer constitutes a computing node, where a computing node is the smallest unit of computing resources in a Kubernetes computing cluster. Multiple computing nodes constitute a computing cluster, which can achieve powerful computing functions.
[0038] As a computing cluster management platform, Kubernetes can intelligently assign specific computing nodes for tasks. When the computing nodes in the computing cluster change, such as any computing node is added or deleted, Kubernetes, as an automated management platform, will automatically reallocate the computing nodes of the task without manually assigning the task. Since the task is not run on a specific computing node, it may be transferred to other computing nodes at any time as computing nodes are added or deleted, and other computing nodes will execute the task. Therefore, the task data cannot be saved in the file system of a node in the computing cluster. In order to store data permanently, kubernetes provides data storage devices, such as PersistentVolumes (persistent volumes, PV for short), which are mounted in the computing cluster to store data permanently and are not bound to specific nodes, thus avoiding the problem of data loss caused by the addition and deletion of computing nodes. The above-mentioned architecture of separation of computing and storage leads to limited data access efficiency of tasks running in the Kubernetes computing cluster.
[0039] In order to improve data access efficiency, it is a common solution to deploy a cache system in a Kubernetes computing cluster. However, in a Kubernetes computing cluster with a cache system, when a new task is run for the first time, the problem of low cache hit rate still exists. In addition, as the data sets required to process tasks with a certain degree of complexity become larger and larger, the limited cache capacity of the Kubernetes computing cluster further reduces the cache hit rate.
[0040] In an exemplary embodiment of this specification, Figure 3 As shown, step S201 is performed by the cache manager 312 (Cache manager) of the scheduler in the Kubernetes computing cluster. Specifically, this step can be performed by the status collector 3121 (Status Collector) in the cache manager 312.
[0041] In an exemplary embodiment of the present specification, the target data directory accessed by the received new task is determined, which can be obtained through a historical task information set. A data directory having a mapping relationship with the new task is searched in the historical task information set as the target data directory, wherein the historical task information set stores the mapping relationship between the historical tasks and the historical data directories accessed by the historical tasks. Since the historical task information set stores the mapping relationship between the historical tasks and the historical data directories accessed by the historical tasks, when a historical task identical to the new task is found in the historical task information set, the target data directory that the new task will access can be predicted through the historical data directory having a mapping relationship with the historical task stored in the historical task information set, and the historical data directory is used as the predicted target data directory that the new task will access, and the target data under the target data directory is used as the predicted data that the new task will read during operation.
[0042] In an exemplary embodiment of the present specification, searching for a data directory in a historical task information set that has a mapping relationship with a new task as a target data directory can be performed through the meta information contained in the new task. The search process may include: obtaining the meta information contained in the new task; searching in the historical task information set based on the meta information contained in the new task, wherein the mapping relationship stored in the historical task information set is established based on the historical meta information of the historical task and the historical data directory accessed by the historical meta information; if historical meta information that matches the meta information of the new task is retrieved in the historical task information set, the historical data directory corresponding to the historical meta information is determined as the target data directory of the new task.
[0043] In an exemplary embodiment of the present specification, the above-mentioned meta information may be a combination of one or more information such as an image of a new task, a startup command, etc., and the present specification does not impose any specific limitation on this.
[0044] In an exemplary embodiment of the present specification, the historical task information set may be stored in an independent historical task information set component in the scheduler.
[0045] In an exemplary embodiment of the present specification, the historical access frequency of the historical data directory stored in the above historical task information set is not less than the preset frequency threshold. When a new task needs to access the data in a subdirectory under the data source directory of the new task, the scheduler needs to make a directory-level fine-grained prediction of the data to be accessed by the task. Therefore, when a task is started, the cache manager queries the access frequency of each data directory in the data cache system during the life cycle of the task, that is, the entire operation process of the task. When the access frequency of a data directory increases to a preset value, it is determined that the task will read the data in the corresponding data directory. After the task is completed, the cache manager can insert the meta information of the task and the read data directory as a historical record into the historical task information set for predicting the data directory to be accessed by the new task submitted in the future, so as to cache the data pointed to by the data directory in advance, improve the efficiency of data access, and then improve the efficiency of calculation. Therefore, the access frequency of the historical data directory stored in the historical task information set reaches the preset value. The above preset value can be determined according to the actual access frequency of the data directory, or it can be set manually, and this specification does not make specific restrictions on this.
[0046] In an exemplary embodiment of the present specification, the target data directory can also be obtained from the data source information included in the new task. When the data source information includes a data source directory, the data source directory can be determined as the target data directory.
[0047] After determining the target data directory accessed by the received new task, the cache state corresponding to the target data under the target data directory is determined according to the target data directory.
[0048] In an exemplary embodiment of the present specification, determining the cache status corresponding to the target data under the target data directory may be performed by a cache manager, specifically, may be determined by a status collector in the cache manager.
[0049] Of course, the technical solution provided in this specification is not limited to being implemented on the scheduler in the Kubernetes computing cluster, and can be implemented in any scheduler that meets the operating conditions. For example, in an exemplary embodiment of this specification, the task scheduling method provided in this specification is applied to the scheduler of a computing device, and the storage device corresponding to the computing device is respectively in different physical devices and transmits data to each other through the network. The computing device is configured with a data cache system, which can cache the data in the storage device in the computing device in advance, so that the computing device can directly read the cached data cached locally during the calculation process, thereby improving the efficiency of the calculation. In addition to the specific implementation form of the storage device and the computing device and the location of the data cache system, the specific scheduling process in this embodiment can refer to the specific scheduling process in the Kubernetes computing cluster, which will not be repeated here.
[0050] In an exemplary embodiment of the present specification, the task scheduling method provided in the present specification can also be applied to a scheduling unit, which is located in the same physical device as the computing unit and the storage unit responsible for storing data, and the physical device is also configured with a cache unit, which is responsible for caching the data required to be read by the computing unit from the storage unit. The specific scheduling process in this embodiment can also refer to the specific scheduling process in the Kubernetes computing cluster.
[0051] In fact, the task scheduling method provided in this specification can be applied to the scheduler in any computing device that is deployed with a data cache system and adopts a computing and storage separation architecture. As for whether the computing unit, storage unit, scheduler, and data cache system in the computing device are specifically carried by a computing cluster or implemented by a physical device; whether they are in the same computing cluster or physical device or in different computing clusters or physical devices, this application does not make specific restrictions.
[0052] S202: Determine an insertion position of the new task in the queue to be scheduled based on the cache status.
[0053] The insertion position of the new task to be inserted into the queue is determined by the target data directory determined in step S201 and the cache status of the target data pointed to by the target data directory. There are two cache statuses of the target data of the new task, one is that the target data is not completely cached, and the other is that the target data is completely cached, and the two cache statuses correspond to different insertion positions.
[0054] If the target data under the target data directory of the above-mentioned new task is not completely cached, the insertion position of the new task is determined to be an adjacent position of at least one task in the queue to be scheduled that has the same target data directory as the new task; if the target data under the target data directory of the new task is completely cached, the insertion position of the new task is determined to be the head of the queue to be scheduled.
[0055] For example, Figure 3 As shown, there are five tasks to be scheduled in the queue 311 to be scheduled in the following order: Job 4, Job 5, Job 6, Job 7, and Job 8. During the scheduling process, the scheduler will take out the task from the head of the queue to be scheduled and run it. Assume that in the queue 311 to be scheduled, Job 5, Job 6, and Job 7 access the same data directory as the new task. For example, Job 5, Job 6, and Job 7 are deep learning training jobs that are submitted multiple times by the user due to hyperparameter tuning during the deep learning training process. Although each job has been modified to a certain extent compared to the original job, these jobs will access the same data set. In this case, when the new task is also a deep learning training job after hyperparameter tuning based on the same original job, the new task accesses the same target data directory as Job 5, Job 6, and Job 7, then the insertion position of the new task is determined to be adjacent to any of Job 5, Job 6, and Job 7, that is, the insertion position can be between Job 4 and Job 5, between Job 5 and Job 6, between Job 6 and Job 7, and can also be between Job 7 and Job 8.
[0056] When the target data of the new task is not completely cached, the tasks accessing the same target data directory are arranged together. Since the tasks in the queue to be scheduled 311 are run in sequence, when a group of tasks accessing the same target data directory are run, the data cache system 322 only needs to cache the target data once to ensure that all tasks in the group meet the running conditions. There is no need to cache the same target data repeatedly, thereby achieving efficient reuse of the cache.
[0057] If the target data of the new task has been completely cached, it proves that the computing device now has all the running conditions for the new task, and the target data pointed to by the newly applied target data directory has been cached in the data cache system 322. Therefore, the insertion position of the new task is determined to be the head of the queue to be scheduled 311. After completing the execution of the previous task, the scheduler 31 can directly take out the new task inserted at the head of the queue to be scheduled 311 for execution without repeated caching.
[0058] After the insertion position of the new task is determined, the new task may be inserted into the queue to be scheduled 311 according to the insertion position.
[0059] S203: Insert the new task into the queue to be scheduled according to the insertion position.
[0060] For example, Figure 3 In the queue to be scheduled 311 shown, if it is determined that the insertion position of the new task is between Job 5 and Job 6, the new queue to be scheduled generated after the new task is inserted into the queue to be scheduled 311 is: Job 4, Job 5, new task, Job 6, Job 7, Job 8.
[0061] In an exemplary embodiment of the present specification, if the target data directory of the new task cannot be determined, the new task is inserted into the tail of the queue to be scheduled 311. For example, the target data directory is not included in the data source information, or the historical data directory with a mapping relationship with the new task cannot be found from the historical task information set, which proves that the target data corresponding to the target data directory of the new task may not be cached in the data cache system 322. In other words, it proves that the data cache system 322 does not include reusable cache resources, so data pre-caching is required before the new task can be calculated. The new task needs to be inserted into the tail of the queue to be cached, waiting for the scheduler to take out the task according to the arrangement order of the tasks in the queue to be scheduled, pre-cache and run it.
[0062] In an exemplary embodiment of the present specification, the above-mentioned task scheduling method can be applied to the scheduling of deep learning training jobs.
[0063] In recent years, deep learning-related technologies have developed rapidly in various fields. Containerization technology and container orchestration technology represented by Kubernetes have simplified the process of application deployment and operation and maintenance, and provided the abstraction and sharing capabilities of computing resources in large-scale clusters. These capabilities are consistent with the needs of development stages such as deep learning training and model deployment, so running deep learning training programs on Kubernetes has become a reasonable choice.
[0064] Deep learning mainly includes two processes: training and reasoning. Among them, the training process is a typical data-driven operation, which is essentially learning expert experience from data to solve computer cognitive problems. In order to improve the accuracy of deep learning methods, training jobs often need to access a large amount of data to obtain stronger generalization capabilities. However, cloud computing currently adopts an architecture that separates computing and storage. This architecture limits the data access efficiency of deep learning jobs running in Kubernetes clusters, and the computing resources allocated to the jobs waste a lot of time waiting for data IO, resulting in low utilization of overall computing resources. It is common practice to deploy a data cache system in a Kubernetes cluster. However, when a deep learning training job is run in a Kubernetes computing cluster for the first time, cache misses will also occur. In addition, as the data sets required for deep learning training become larger and larger, the limited cache capacity of the Kubernetes computing cluster further reduces the cache hit rate.
[0065] In order to solve the problem of low cache hit rate, the technical solution in this specification is applied to the scheduling of deep learning training jobs. In this exemplary embodiment, the computing device is a Kubernetes computing cluster, and the scheduler adapted by the Kubernetes computing cluster is as follows: Figure 3 As shown, the scheduler 31 includes a queue to be scheduled 311, a cache manager 312, and a job history information set 313. The cache manager 312 includes a packet status collector 3121 and a data prefetcher 3122. The Kubernetes computing cluster (computing device 32) includes a running queue 321 and a data cache system 322 deployed in the computing device. Figure 4 As shown in the figure, the specific deep learning training job scheduling process is as follows:
[0066] S401, determining target data accessed by a received new job and a cache status of the target data.
[0067] When a user submits a new job to the scheduler 31, the scheduler 31 searches for a data directory that has a mapping relationship with the new job in the historical job information set 313 as the target data directory of the new job, wherein the historical job information set 313 stores the mapping relationship between the historical jobs and the historical data directories accessed by the historical jobs. Alternatively, if the new job contains data source information, the target data directory can also be obtained from the data source information.
[0068] The target data directory of the new job is determined by the state collector 3121 in the cache manager 312, and the cache state of the target data corresponding to the target data directory of the new job is confirmed. Specifically, the state collector 3121 in the cache manager 312 obtains the cache state of the target data by accessing the data cache system 322 in the Kubernetes computing cluster.
[0069] like Figure 3 As shown, assuming that for a new job 1 whose target data directory is the same as Job 4 and Job 5, the scheduler 31 searches the historical job information set 313 for a data directory that has a mapping relationship with the new job 1 as the target data directory of the new job 1, and obtains the cache status of the target data corresponding to the target data directory of the new job 1 through the status collector 3121. The target data of the new job 1 is not completely cached. After determining the cache status of the target data,
[0070] S402: Determine an insertion position of the new job in the queue to be scheduled based on the cache status.
[0071] Through step S401, it can be determined that the insertion position of new job 1 is adjacent to the job having the same target data directory as new job 1, namely, Job 4 or Job 5, which can be before Job 4, between Job 4 and Job 5, or after Job 5.
[0072] S403: insert the new job into the queue to be scheduled according to the insertion position.
[0073] Insert the new job 1 into any insertion position to complete the scheduling of the new job 1.
[0074] In an exemplary embodiment of this specification, it is assumed that new job 1 is inserted after Job 5. At this time, when there are available computing resources in the Kubernetes computing cluster, the deep learning training job in the running queue 321 in the Kubernetes computing cluster is calculated. Figure 3As shown, Job 2 in the running queue 321 has just finished running, so that there are remaining computing resources in the Kubernetes computing cluster, then the scheduler 31 takes out Job 3 from the queue to be scheduled 311 in the scheduler 31 and runs it in the running queue 321 in the Kubernetes computing cluster. Select the next deep learning training job to be scheduled - Job 4, the cache manager 312 in the scheduler 31 queries whether the data that Job 4 needs to read has been cached in the data cache system 322 in the Kubernetes computing cluster. If the data that Job 4 needs to read has been cached, it proves that Job 4 is in a state that can be run at any time, then the scheduling is completed, and the scheduler 31 is waiting to take Job 4 out of the queue to be scheduled and run it in the running queue 321. If the data that Job 4 needs to read is not completely cached, the data prefetcher 3122 in the cache manager 312 prefetches the data that Job 4 needs to read into the data cache system 322, and after all the caching is completed, the scheduler 31 will take Job 4 out of the queue to be scheduled and run it in the running queue 321. When Job 3 in the running queue 321 has been completed, Job 4, whose data cache has been pre-fetched into the data cache system 322, is taken out and run in the running queue 321. At this time, since the target data directory of Job 4, Job 5 and the new job 1 inserted after Job 5 is the same, the data that Job 4 needs to read is the target data. Since the target data has been cached in the data cache system 322, when Job 4 is completed, it is no longer necessary to re-cache the data that Job 5 needs to read, and the cache data corresponding to Job 4 in the data cache system 322 can be directly reused. The scheduling process for the new job 1 after Job 5 is the same as that of Job 5.
[0075] In an exemplary embodiment of the present specification, when a user submits a new job 2 to the scheduler 31, whose target data pointed to by a target data directory has been completely cached, the scheduler 31 searches the historical job information set 313 for a data directory that has a mapping relationship with the above-mentioned new job as the target data directory. The state collector 3121 in the cache manager 312 is used to determine the target data directory of the new job 2, and to confirm the cache status of the target data corresponding to the target data directory of the new job. Specifically, the state collector 3121 obtains the cache status of the target data by accessing the data cache system 322 in the Kubernetes computing cluster. Since the cache status of the target data of the new job 2 is completely cached, the insertion position of the new job 2 is determined to be the head of the queue to be scheduled 311. Assuming that the queue to be scheduled 311 is as follows: Figure 3As shown, it is determined that the insertion position of the new job 2 is before Job 4. Since the target data of the new job 2 has been completely cached at this time, it is proved that the new job 2 does not need to cache the target data in the data cache system through the data prefetcher 3122, so it can be directly taken out to the running queue 321 for running. The new job 2 is inserted into the head of the queue to be scheduled 311, that is, before Job 4. When there are idle computing resources in the Kubernetes computing cluster, the new job 2 can be directly taken out of the running queue 321 for computing.
[0076] In an exemplary embodiment of the present specification, when a user submits a new job 3 that cannot find the corresponding target data directory in the historical job information set, it proves that the data to be read by the new job 3 has not been cached in the data cache system 322, so the new job 3 is inserted into the tail of the queue 311 to be scheduled, that is, after Job 8, and the job before the new job 3's turn is taken out of the running queue 321 for execution, and then the data prefetcher 3122 caches the data to be read by the new job 3 in the data cache system 322, thereby completing the preparation before the new job 3 is taken out for execution.
[0077] Figure 5 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this specification. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508 and a non-volatile memory 510. Of course, it may also include hardware required for other functions. The processor 502 reads the corresponding computer program from the non-volatile memory 510 into the memory 508 and then runs it, forming a task scheduling device at the logical level. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0078] Corresponding to the above method embodiment, this specification also provides a task scheduling device.
[0079] Please refer to Figure 6 , a task scheduling device may include:
[0080] A target data determining unit 601 is used to determine the target data accessed by the received new task and the cache status of the target data;
[0081] An insertion position determining unit 602, configured to determine an insertion position of the new task in the queue to be scheduled based on the cache state;
[0082] The first new task inserting unit 603 is used to insert the new task into the queue to be scheduled according to the insertion position.
[0083] Optionally, the target data determination unit 601 may be specifically configured to:
[0084] A data directory having a mapping relationship with the new task is searched in the historical task information set as the target data directory, and the data under the target data directory is the target data, wherein the historical task information set stores the mapping relationship between the historical tasks and the historical data directories accessed by the historical tasks.
[0085] Optionally, the target data determination unit 601 may also be specifically configured to:
[0086] Obtaining meta information contained in the new task;
[0087] Searching the historical task information set based on the meta information contained in the new task, wherein the mapping relationship stored in the historical task information set is established based on the historical meta information of the historical task and the historical data directory accessed by the historical meta information;
[0088] If historical meta information that matches the meta information of the new task is retrieved from the historical task information set, the historical data directory corresponding to the historical meta information is determined as the target data directory.
[0089] Optionally, the historical access frequency of the historical data directory stored in the historical task information set in the target data determination unit 601 is not less than a preset frequency threshold.
[0090] Optionally, the new task includes data source information, and the target data determination unit 601 may be specifically used to:
[0091] A target data directory is obtained from the data source information, and the data under the target data directory is the target data.
[0092] Optionally, the insertion position determining unit 602 may be specifically configured to:
[0093] If the target data is not completely cached, determining the insertion position to be an adjacent position of at least one task in the queue to be scheduled that has the same target data as the new task;
[0094] If the target data has been completely cached, the insertion position is determined to be the head of the queue to be scheduled.
[0095] Optionally, the task scheduling device may further include:
[0096] The second new task inserting unit 604 is configured to insert the new task into the tail of the queue to be scheduled if the target data cannot be determined.
[0097] Please refer to Figure 7 , this specification also provides a scheduling device for deep learning training jobs, which may include:
[0098] A new job target data determining unit 701 is used to determine the target data accessed by the received new job and the cache status of the target data;
[0099] A new job insertion position determining unit 702, configured to determine an insertion position of the new job in the queue to be scheduled based on the cache state;
[0100] The first new job inserting unit 703 is used to insert the new job into the queue to be scheduled according to the insertion position.
[0101] Optionally, the new operation target data determining unit 701 may be specifically used for:
[0102] A data directory having a mapping relationship with the new job is searched in the historical job information set as a target data directory, and the data under the target data directory is the target data, wherein the historical job information set stores a mapping relationship between historical jobs and historical data directories accessed by the historical jobs.
[0103] Optionally, the new operation target data determining unit 701 may also be specifically used for:
[0104] Obtaining meta information contained in the new job;
[0105] Searching the historical job information set based on the meta information contained in the new job, wherein the mapping relationship stored in the historical job information set is established based on the historical meta information of the historical job and the historical data directory accessed by the historical meta information;
[0106] If historical meta information that matches the meta information of the new job is retrieved from the historical job information set, the historical data directory corresponding to the historical meta information is determined as the target data directory.
[0107] Optionally, the historical access frequency of the historical data directory stored in the historical job information set in the new job target data determination unit 701 is not less than a preset frequency threshold.
[0108] Optionally, the new job includes data source information, and the new job target data determination unit 701 may be specifically used to:
[0109] A target data directory is obtained from the data source information, and the data under the target data directory is the target data.
[0110] Optionally, the new job insertion position determining unit 702 may be specifically configured to:
[0111] If the target data is not completely cached, determining the insertion position to be an adjacent position of at least one job in the queue to be scheduled that has the same target data as the new job;
[0112] If the target data has been completely cached, the insertion position is determined to be the head of the queue to be scheduled.
[0113] Optionally, the deep learning training job scheduling device may further include:
[0114] The second new job inserting unit 704 is configured to insert the new job into the tail of the queue to be scheduled if the target data cannot be determined.
[0115] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0116] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0117] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0118] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0119] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0120] In one or more embodiments of the present specification, the term "includes", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0121] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0122] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0123] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A task scheduling method, characterized in that: include: Determining target data accessed by the received new task and a cache status of the target data; Determine the insertion position of the new task in the queue to be scheduled based on the cache state; wherein, if the target data is not completely cached, determine the insertion position to be an adjacent position of at least one task in the queue to be scheduled that has the same target data as the new task; if the target data is completely cached, determine the insertion position to be the head of the queue to be scheduled; Insert the new task into the queue to be scheduled according to the insertion position.
2. The method according to claim 1, characterized in that The determining of the target data accessed by the received new task includes: A data directory having a mapping relationship with the new task is searched in the historical task information set as the target data directory, and the data under the target data directory is the target data, wherein the historical task information set stores the mapping relationship between the historical tasks and the historical data directories accessed by the historical tasks.
3. The method according to claim 2, characterized in that The step of searching the historical task information set for a data directory having a mapping relationship with the new task as the target data directory includes: Obtaining meta information contained in the new task; Searching the historical task information set based on the meta information contained in the new task, wherein the mapping relationship stored in the historical task information set is established based on the historical meta information of the historical task and the historical data directory accessed by the historical meta information; If historical meta information that matches the meta information of the new task is retrieved from the historical task information set, the historical data directory corresponding to the historical meta information is determined as the target data directory.
4. The method according to claim 2, characterized in that The historical access frequency of the historical data directory stored in the historical task information set is not less than a preset frequency threshold.
5. The method according to claim 1, characterized in that The new task includes data source information, and determining the target data accessed by the received new task includes: A target data directory is obtained from the data source information, and the data under the target data directory is the target data.
6. The method according to claim 1, characterized in that Also includes: If the target data cannot be determined, the new task is inserted into the tail of the queue to be scheduled.
7. A deep learning training job scheduling method, characterized in that: include: Determine target data accessed by the received new job and a cache status of the target data; Determine the insertion position of the new job in the queue to be scheduled based on the cache state; wherein, if the target data is not completely cached, determine the insertion position to be an adjacent position of at least one job in the queue to be scheduled that has the same target data as the new job; if the target data is completely cached, determine the insertion position to be the head of the queue to be scheduled; The new job is inserted into the queue to be scheduled according to the insertion position.
8. A task scheduling device, characterized in that: include: a target data determining unit, configured to determine target data accessed by the received new task, and a cache status of the target data; an insertion position determining unit, configured to determine an insertion position of the new task in the queue to be scheduled based on the cache state; wherein, if the target data is not completely cached, the insertion position is determined to be an adjacent position of at least one task in the queue to be scheduled that has the same target data as the new task; and if the target data is completely cached, the insertion position is determined to be the head of the queue to be scheduled; The first new task inserting unit is used to insert the new task into the queue to be scheduled according to the insertion position.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
