|
| 1 | +# Disk IO Aware Scheduling |
| 2 | + |
| 3 | +<!-- toc --> |
| 4 | +- [Summary](#summary) |
| 5 | +- [Motivation](#motivation) |
| 6 | +- [Design Consideration](#design-consideration) |
| 7 | + - [Goals](#goals) |
| 8 | + - [Non-Goals](#non-goals) |
| 9 | +- [Proposal](#proposal) |
| 10 | +- [Design Details](#design-details) |
| 11 | + - [NodeResourcesFitPlus](#noderesourcesfitplus) |
| 12 | + - [ScarceResourceAvoidance](#scarceresourceavoidance) |
| 13 | + - [Test Plan](#test-plan) |
| 14 | + - [Graduation Criteria](#graduation-criteria) |
| 15 | + - [Alpha](#alpha) |
| 16 | + - [Beta](#beta) |
| 17 | +- [Implementation History](#implementation-history) |
| 18 | +<!-- /toc --> |
| 19 | + |
| 20 | + |
| 21 | +## Summary |
| 22 | + |
| 23 | +The NodeResourcesFit plug-in of native k8s can only adopt a type of strategy for all resources, such as MostRequestedPriority and LeastRequestedPriority. However, in industrial practice, this design does not apply to some scenarios. For example: In AI scenarios, businesses that apply for GPUs prefer to occupy the entire GPU machine first to prevent GPU fragmentation; businesses that apply for CPU & MEM are prioritized and dispersed to non-GPU machines to prevent excessive consumption of CPU & MEM on GPU machines, resulting in real tasks of applying for GPUs. Pending due to insufficient non-GPU resources |
| 24 | +. Therefore, two plugins are extended to solve this common problem. |
| 25 | + |
| 26 | +## Motivation |
| 27 | +case: |
| 28 | +- GPU tasks take priority over the entire GPU |
| 29 | +- CPU&MEM tasks are distributed to the CPU machine first |
| 30 | + |
| 31 | +## Design Consideration |
| 32 | + |
| 33 | +- The solution is more versatile, not limited to AI clusters or CPU clusters, and not limited to common CPU resources or extended GPU resources. |
| 34 | + |
| 35 | +- Different resource policies can be configured for different cluster types and prioritized in the form of weights. |
| 36 | + |
| 37 | +- Easy to expand |
| 38 | + |
| 39 | +### Goals |
| 40 | + |
| 41 | +- Different types of resources can be configured with different strategies to prioritize them in the form of weights |
| 42 | + |
| 43 | +- Prevent pods that have not applied for scarce resources from being scheduled to nodes with scarce resources. |
| 44 | + |
| 45 | +### Non-Goals |
| 46 | + |
| 47 | +- None. |
| 48 | + |
| 49 | +## Proposal |
| 50 | + |
| 51 | +Extend two plug-ins to meet the above needs |
| 52 | + |
| 53 | +- NodeResourcesFitPlus |
| 54 | +- ScarceResourceAvoidance |
| 55 | + |
| 56 | +## Design Details |
| 57 | + |
| 58 | +### NodeResourcesFitPlus |
| 59 | + |
| 60 | +config: |
| 61 | +``` |
| 62 | +resources: |
| 63 | + nvidia.com/gpu: |
| 64 | + type: MostAllocated |
| 65 | + weight: 2 |
| 66 | + cpu: |
| 67 | + type: LeastAllocated |
| 68 | + weight: 1 |
| 69 | + memory: |
| 70 | + type: LeastAllocated |
| 71 | + weight: 1 |
| 72 | +``` |
| 73 | +config description: |
| 74 | +<p align="center"><img src="images/img1.png" title="Key components" width="600" class="center"/></p> |
| 75 | + |
| 76 | +node score: |
| 77 | +``` |
| 78 | +finalScoreNode = [(weight1 * resource1) + (weight2 * resource2) + … + (weightN* resourceN)] /(weight1+weight2+ … +weightN) |
| 79 | +``` |
| 80 | + |
| 81 | +### ScarceResourceAvoidance |
| 82 | +config: |
| 83 | +``` |
| 84 | +resources: |
| 85 | +- nvidia.com/gpu |
| 86 | +``` |
| 87 | +config description: |
| 88 | +<p align="center"><img src="images/img2.png" title="Key components" width="600" class="center"/></p> |
| 89 | + |
| 90 | +node score: |
| 91 | +``` |
| 92 | +finalScoreNode = (allocatablesResourcesNum - requestsResourcesNum) * framework.MaxNodeScore / allocatablesResourcesNum |
| 93 | +``` |
| 94 | + |
| 95 | +### Test Plan |
| 96 | + |
| 97 | +Comprehensive unit tests will be added to ensure that each functionality works as expected. Additionally, detailed integration tests will be implemented to verify that the scheduler plugin and IO Driver interact without any issue. |
| 98 | + |
| 99 | +Finally, a basic e2e test will be included to ensure that all components can work together properly. |
| 100 | + |
| 101 | +### Graduation Criteria |
| 102 | + |
| 103 | +#### Alpha |
| 104 | + |
| 105 | +- Implement the NodeResourcesFitPlus and ScarceResourceAvoidance scheduler plugins |
| 106 | +- Provide a reference implementation of the NodeResourcesFitPlus and ScarceResourceAvoidance |
| 107 | +- Unit tests and integration test from [Test Plan](#test-plan). |
| 108 | + |
| 109 | +#### Beta |
| 110 | + |
| 111 | +- Add E2E tests. |
| 112 | +- Provide beta-level documentation. |
| 113 | + |
| 114 | +## Implementation History |
| 115 | + |
| 116 | +- 2024-12-23: KEP created |
0 commit comments