Skip to content

Commit f3e3f8e

Browse files
authored
Merge pull request #71 from kube-HPC/kai_documentation
Kai documentation
2 parents d46423a + e8bb7c2 commit f3e3f8e

File tree

6 files changed

+88
-7
lines changed

6 files changed

+88
-7
lines changed

site/_core/schemas/connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ this._socket.on('open', () => {
3131
name: 'Python',
3232
content: <Prism language="python">
3333
{`
34-
this._socket = new WebSocket(this._url);
34+
this._socket = WebSocket(this._url)
3535
this._socket.on('open', () => {
3636
log.debug("connected");
3737
});`}

site/_core/schemas/install.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const items = [
1010
--addons registry \
1111
--addons registry-aliases \
1212
--addons storage-provisioner \
13-
--kubernetes-version=v1.23.5`}
13+
--kubernetes-version=v1.33.4`}
1414
</Prism>
1515
},
1616
{
@@ -21,7 +21,7 @@ const items = [
2121
--addons=registry ^
2222
--addons=registry-aliases ^
2323
--addons=storage-provisioner ^
24-
--kubernetes-version=v1.23.5`}
24+
--kubernetes-version=v1.33.4`}
2525
</Prism>
2626
},
2727
{
@@ -32,7 +32,7 @@ const items = [
3232
--addons=registry \
3333
--addons=registry-aliases \
3434
--addons=storage-provisioner \
35-
--kubernetes-version=v1.23.5`}
35+
--kubernetes-version=v1.33.4`}
3636
</Prism>
3737
},
3838
];

site/learn/Algorithms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ Each event has a specific handler, as described below.
498498
The initialize event is the first event that HKube sends to your algorithm.
499499
The payload of this event includes the pipeline data and the input for your algorithm.
500500
You need to store the input in a local variable for later use.
501-
> same input as written in the [descriptor](../learn/input/)
501+
> same input as written in the [descriptor](../input/)
502502
503503
```hkube-tabs
504504
# { "hkube": true, "schema": "handle-messages-initialize" }

site/learn/InstallHkube.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Current context is now "default"
5353
### 3. Start Minikube
5454
Currently HKube requires at least 4 cpu cores and 6GB of memory, ingress controller, registry, and dynamic storage.
5555

56-
HKube was tested on Kubernetes v1.23.5, so to run it properly, start Minikube with:
56+
HKube was tested on Kubernetes v1.33.4, so to run it properly, start Minikube with:
5757
```hkube-tabs-with-copy
5858
# { "hkube": true, "schema": "install" }
5959
```

site/learn/Kai.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: KAI Integration
3+
sidebarTitle: KAI Integration
4+
layout: ../_core/DocsLayout
5+
category: Learn
6+
sublinks: Configuration, Example
7+
permalink: /learn/kai/
8+
next: /learn/codeapi/
9+
---
10+
11+
The **KAI Scheduler** lets you control how your algorithms use resources.
12+
It allows assigning algorithms to queues, limiting memory, and sharing GPUs between multiple algorithms to improve efficiency.
13+
14+
## What is KAI Scheduler?
15+
16+
**KAI Scheduler** is a Kubernetes component that manages how workloads are scheduled.
17+
It supports advanced features like GPU sharing (using fractions of a GPU) and queue prioritization — allowing multiple algorithms to use the same GPU efficiently.
18+
19+
You can find the KAI Scheduler source code and installation guide [here](https://github.com/NVIDIA/KAI-Scheduler).
20+
21+
> **Important:**
22+
> To use this feature, the KAI Scheduler **must be installed and configured** in your cluster.
23+
> It requires **Kubernetes version 1.24.x or higher**.
24+
> Make sure all **prerequisites** mentioned in the [KAI GitHub repository](https://github.com/NVIDIA/KAI-Scheduler) are met before enabling this integration.
25+
> If your algorithm tries to use more resources than assigned at runtime, the request will not be strictly limited.
26+
27+
---
28+
29+
## Configuration
30+
31+
KAI-related settings are defined in the `kaiObject` section inside your algorithm specification.
32+
This section allows you to control how the algorithm interacts with the scheduler, including queue assignment, memory allocation, and GPU fraction usage.
33+
34+
**Example of `kaiObject` configuration:**
35+
36+
```json
37+
{
38+
"kaiObject": {
39+
"queue": "gpu-queue",
40+
"memory": "512Mi",
41+
"fraction": 0.5
42+
}
43+
}
44+
```
45+
46+
### **Properties**
47+
48+
| Field | Type | Description | Required |
49+
| :----------- | :----- | :--------------------------------------------------------- | :------- |
50+
| **queue** | string | Name of the KAI queue to assign the algorithm to. | ✅ Yes |
51+
| **memory** | string | Memory limit for the algorithm (e.g., `"512Mi"`, `"1Gi"`). | ❌ No |
52+
| **fraction** | number | Fraction of GPU usage (e.g., `0.5` for 50% GPU). | ❌ No |
53+
54+
---
55+
56+
## Example
57+
58+
Below is a minimal algorithm configuration that includes `kaiObject`:
59+
60+
```json
61+
{
62+
"name": "gpu-fraction-algorithm",
63+
"algorithmImage": "docker.io/hkubedevtest/my-gpu-algo:latest",
64+
"cpu": 0.5,
65+
"mem": "512Mi",
66+
"gpu": 1,
67+
"kaiObject": {
68+
"queue": "gpu-queue",
69+
"memory": "512Mi",
70+
"fraction": 0.5
71+
}
72+
}
73+
```
74+
75+
In this example:
76+
77+
* The algorithm requests **one GPU** but sets a **fraction of 0.5**, allowing the GPU to be shared between two algorithms.
78+
* The **queue** defines which KAI-managed queue handles this algorithm.
79+
* The **memory** value specifies an optional memory limit.
80+
81+
---

site/learn/Sidecars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ layout: ../_core/DocsLayout
55
category: Learn
66
sublinks: Container Configuration, Volumes Usage, Environment Variables, Common Errors, Multiple Sidecars
77
permalink: /learn/sidecars/
8-
next: /learn/debug/
8+
next: /learn/kai/
99
---
1010

1111
In HKube, sidecars are additional containers that can be added to an algorithm's pod to perform supplementary tasks alongside the main algorithm container. Sidecars are a powerful way to extend the functionality of your algorithm, such as logging, monitoring, or handling auxiliary tasks.

0 commit comments

Comments
 (0)