[WIP]OSDOCS-19990: Resource fair sharing#113457
Conversation
|
@StephenJamesSmith: This pull request references OSDOCS-19990 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
🤖 Tue Jun 16 14:57:00 - Prow CI generated the docs preview: |
| + | ||
| `resourceWeights`:: Assigns weights to resources. The higher the weight, the higher the penalty. | ||
|
|
||
| `usageHalfLifeTimeSeconds`:: The time in seconds after which the current usage will decrease by half. In other words, controls how long the past consumption should impact future admission. |
There was a problem hiding this comment.
🤖 [error] RedHat.TermsErrors: Use 'for example' or 'that is' rather than 'In other words'. For more information, see RedHat.TermsErrors.
f4afbb5 to
ddf8f8f
Compare
|
@StephenJamesSmith: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
|
||
| Given this upstream limitation, isolating CPU as the sole scoring factor by setting a memory weight of `0` is a reliable approach for deterministic fair sharing behavior. | ||
|
|
||
| The following example contains `admissionFairSharing.resourceWeights` settings for mixed CPU, memory, and GPU weights: |
There was a problem hiding this comment.
@MaysaMacedo Wondering if we should use the example Option A from kubernetes-sigs/kueue#10434?
There was a problem hiding this comment.
We can't because that is not implemented yet.
| . Choose the `configuration` type you want to use: | ||
| + | ||
| * `Default`: Uses {kueue-name} predefined values. | ||
| * `Custom`: Uses {kueue-name} predefined values. |
There was a problem hiding this comment.
Custom allows for the user to specify their own desired values.
| + | ||
| [source,yaml] | ||
| ---- | ||
| config: |
There was a problem hiding this comment.
Instead we can recommend the user to use the following command to apply the default configuration:
oc patch kueue.kueue.openshift.io/cluster --type=merge -p \
'{"spec":{"config":{"admissionFairSharing":{"configuration":"Default"}}}}'
There was a problem hiding this comment.
There's a small correction Stephen. The command would be:
oc patch kueue.kueue.openshift.io/cluster --type=merge -p \
'{"spec":{"config":{"admissionFairSharing":{"configuration":"Default","custom":null}}}}'
| configuration: Default | ||
| ---- | ||
| + | ||
| * For `Custom` configuration use the following command: |
There was a problem hiding this comment.
| * For `Custom` configuration use the following command: | |
| * For `Custom` configuration you can adapt the following command with your desired values: |
There was a problem hiding this comment.
Changed to "Use the following command to create a Custom configuration that applies values that you specify:"
| [source,terminal] | ||
| ---- | ||
| oc patch kueue.kueue.openshift.io/cluster --type=merge -p \ | ||
|
|
|
|
||
| [role="_abstract"] | ||
| Use Admission fair sharing to fairly distribute workloads across LocalQueues that share a single ClusterQueue. | ||
| This feature balances workload admission by prioritizing workloads from tenants that have used fewer resources historically. It tracks usage over time with a configurable decay function and applies admission penalties when workloads are admitted. |
There was a problem hiding this comment.
| This feature balances workload admission by prioritizing workloads from tenants that have used fewer resources historically. It tracks usage over time with a configurable decay function and applies admission penalties when workloads are admitted. | |
| This feature balances workload admission by prioritizing workloads from local Queues that have used fewer resources historically. It tracks usage over time with a configurable decay function and applies admission penalties when workloads are admitted. |
| [id="setting-resource-weights_{context}"] | ||
| = Setting resource weights | ||
|
|
||
| [role="_abstract"] |
There was a problem hiding this comment.
Will get back to this.
| = Setting resource weights | ||
|
|
||
| [role="_abstract"] | ||
| Resource weights define the relative importance of different resource types (CPU, memory, GPU) when calculating admission penalties. Queues that consume resources with higher weights receive larger penalties, reducing their priority for future workload admission. |
There was a problem hiding this comment.
Instead of adding a section specific to resourceWeights, I was thinking we could just add a note where you explained what each field of the configuration is, with something like:
When using Admission Fair Sharing, the
resourceWeightsfor any resource whose Kubernetes quantity is expressed in bytes — such as memory — must be scaled down to compensate for the internal byte representation. Without this adjustment, the raw byte value of these resources will numerically dominate human-scale resources, such as CPU cores, by several orders of magnitude, effectively making their weights meaningless. For example, if you would like to specify the value of 1.0 for the memory weight, you would need to instead specify9.31e-10, which corresponds to1.0 / 1,073,741,824.
There was a problem hiding this comment.
@anahas-redhat @kannon92 let me know what you guys think about it
There was a problem hiding this comment.
I agree removing this. Also because in the example below we're using GPUs which may be out of context without DRA explanation. Added more details here: #113457 (comment)
|
@StephenJamesSmith In the description of the PR you mentioned this is for |
| Use Admission fair sharing to fairly distribute workloads across LocalQueues that share a single ClusterQueue. | ||
| This feature balances workload admission by prioritizing workloads from tenants that have used fewer resources historically. It tracks usage over time with a configurable decay function and applies admission penalties when workloads are admitted. | ||
|
|
||
| The shared ClusterQueue causes resource starvation between tenants, creating a high risk of resource starvation for the tenants. Admission fair sharing adresses this issue by meeting the following requirements: |
There was a problem hiding this comment.
"high risk of resource starvation" — redundant phrasing
Suggestion: "When multiple tenants share a single ClusterQueue, some tenants risk resource starvation. Admission fair sharing addresses this by..."
|
|
||
| Improve service predictability:: Guarantee each tenant gets a consistent share of resources, reducing latency spikes and preventing starvation. | ||
|
|
||
| Enable scalable governance:: Use dynamic, usage-based allocation instead of complex static quotas. |
There was a problem hiding this comment.
I think this can be changed because Admission fair sharing does not replace quotas. It works alongside ClusterQueue quotas.. maybe something like:
"Complement static quotas with dynamic, usage-based admission ordering that adapts as tenant demand changes."
| nvidia.com/gpu.count : 50 | ||
| ---- | ||
|
|
||
| In this example, .................... |
There was a problem hiding this comment.
Do you want to add some explanation here?
|
|
||
| [source,yaml] | ||
| ---- | ||
| admissionFairSharing: |
There was a problem hiding this comment.
This format does not work because time fields are in second downstream, resource name is not valid and the format is wrong.
If we want to detail about GPUs, the user would need to first create a DeviceClass (considering Nvidia, from your example):
"spec": {
"config": {
"resources": {
"deviceClassMappings": [{
"name": "nvidia-gpus",
"deviceClassNames": ["gpu.nvidia.com"]
}]
}
}
}
}'
And then configure Kueue Operand like this (considering the time in your example):
oc patch kueue.kueue.openshift.io/cluster --type=merge -p '{
"spec": {
"config": {
"admissionFairSharing": {
"configuration": "Custom",
"custom": {
"usageHalfLifeTimeSeconds": 432000,
"usageSamplingIntervalSeconds": 300,
"resourceWeights": [
{"name": "cpu", "weight": "1"},
{"name": "memory", "weight": "4"},
{"name": "nvidia-gpus", "weight": "50"}
]
}
}
}
}
}'
I guess we agreed to talk about Admission Fair Sharing on the Kueue + DRA documents, right? Because it may be out of context for the user to add these concepts here.
Admission Fair Sharing (Kueue) Integration for Multi-Tenant Resource Fairness
Version: 4.22+
Jira: https://redhat.atlassian.net/browse/OSDOCS-19990
Preview: https://113457--ocpdocs-pr.netlify.app/openshift-enterprise/latest/ai_workloads/kueue/admission-fair-sharing.html
Dev: @kannon92
QE @MaysaMacedo @anahas-redhat