Skip to content

Commit fe455ea

Browse files
authored
feat(worker): grant IPC_LOCK and SYS_RESOURCE for Engram host memory (#777)
* refactor(pkg): unify json and stringx hash/base64 helpers across pkg Signed-off-by: thxCode <thxcode0824@gmail.com> * feat(worker): grant IPC_LOCK and SYS_RESOURCE for Engram host memory Signed-off-by: thxCode <thxcode0824@gmail.com> --------- Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent a78183e commit fe455ea

95 files changed

Lines changed: 404 additions & 178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/modules/model-deployment/deployment.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,17 @@ Changing the rendered capacity follows ordinary role rollout behavior.
341341
Existing Elastic members keep their mounts; new or replacement `Pod`s use the current value.
342342
Upgrading the operator adds the default mount to ordinary roles and triggers their recreate rollout.
343343

344+
### Engram host memory
345+
346+
When a non-privileged role (*`roles[].privileged`* unset or `false`) enables Engram host-memory
347+
offload, the operator grants `IPC_LOCK` and `SYS_RESOURCE` on the `main` container so the engine can
348+
pin host DRAM without running the whole `Pod` privileged:
349+
350+
- `vLLM`: pass `--engram-config` (or a dotted `--engram-config.*` flag) in *`roles[].extraArgs`* or
351+
*`roles[].command`* with `cpu_offload` left enabled (the default `true`). Passing `--engram-config`
352+
is required even when keeping `vLLM`'s default settings so the operator can detect Engram offload.
353+
- `SGLang`: set `SGLANG_ENABLE_DSV41_ENGRAM_HOST_TABLE=1` in *`roles[].env`*.
354+
344355
### Compilation cache and timeout
345356

346357
An engine starts against a compilation cache and a startup budget.

‎pkg/devicemanager/allocator/ascend/rank_table.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package ascend
22

33
import (
4-
"encoding/json"
54
"errors"
65
"fmt"
76
"os"
87
"path/filepath"
98

109
"gpustack.ai/gpustack/pkg/device"
10+
"gpustack.ai/gpustack/pkg/utils/json"
1111
)
1212

1313
// rankTableCapability names the host ranktable in a preflight row, in HCCL's own vocabulary: the

‎pkg/devicemanager/allocator/cambricon/smlu.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cambricon
22

33
import (
4-
"encoding/json"
54
"errors"
65
"fmt"
76
"io/fs"
@@ -14,6 +13,7 @@ import (
1413
klog "k8s.io/klog/v2"
1514

1615
"gpustack.ai/gpustack/pkg/deviceplugin"
16+
"gpustack.ai/gpustack/pkg/utils/json"
1717
"gpustack.ai/gpustack/pkg/utils/osx"
1818
"gpustack.ai/gpustack/pkg/utils/stringx"
1919
)

‎pkg/devicemanager/allocator/cambricon/smlu_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cambricon
22

33
import (
4-
"encoding/json"
54
"errors"
65
"fmt"
76
"os"
@@ -15,6 +14,7 @@ import (
1514
"github.com/stretchr/testify/require"
1615

1716
"gpustack.ai/gpustack/pkg/deviceplugin"
17+
"gpustack.ai/gpustack/pkg/utils/json"
1818
)
1919

2020
const (

‎pkg/devicemanager/allocator/hygon/mig.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package hygon
22

33
import (
4-
"encoding/json"
54
"errors"
65
"fmt"
76
"io/fs"
@@ -13,6 +12,7 @@ import (
1312

1413
workercore "gpustack.ai/gpustack/api/worker/v1alpha1"
1514
"gpustack.ai/gpustack/pkg/deviceplugin"
15+
"gpustack.ai/gpustack/pkg/utils/json"
1616
"gpustack.ai/gpustack/pkg/utils/osx"
1717
)
1818

‎pkg/devicemanager/allocator/metax/sgpu.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package metax
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"io/fs"
76
"os"
@@ -14,6 +13,7 @@ import (
1413
klog "k8s.io/klog/v2"
1514

1615
"gpustack.ai/gpustack/pkg/deviceplugin"
16+
"gpustack.ai/gpustack/pkg/utils/json"
1717
"gpustack.ai/gpustack/pkg/utils/osx"
1818
)
1919

‎pkg/devicemanager/allocator/metax/sgpu_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package metax
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"os"
76
"path/filepath"
@@ -13,6 +12,7 @@ import (
1312
"github.com/stretchr/testify/require"
1413

1514
"gpustack.ai/gpustack/pkg/deviceplugin"
15+
"gpustack.ai/gpustack/pkg/utils/json"
1616
)
1717

1818
const (

‎pkg/devicemanager/allocator/nvidia/mig.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package nvidia
33
import (
44
"cmp"
55
"context"
6-
"encoding/json"
76
"errors"
87
"fmt"
98
"io/fs"
@@ -18,6 +17,7 @@ import (
1817
workercore "gpustack.ai/gpustack/api/worker/v1alpha1"
1918
"gpustack.ai/gpustack/pkg/deviceplugin"
2019
"gpustack.ai/gpustack/pkg/kubemeta"
20+
"gpustack.ai/gpustack/pkg/utils/json"
2121
"gpustack.ai/gpustack/pkg/utils/osx"
2222
)
2323

‎pkg/devicemanager/allocator/nvidia/mig_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package nvidia
22

33
import (
44
"context"
5-
"encoding/json"
65
"fmt"
76
"maps"
87
"os"
@@ -21,6 +20,7 @@ import (
2120

2221
workercore "gpustack.ai/gpustack/api/worker/v1alpha1"
2322
"gpustack.ai/gpustack/pkg/deviceplugin"
23+
"gpustack.ai/gpustack/pkg/utils/json"
2424
)
2525

2626
// fakeMigDriver is an in-memory migDriver: it records create/destroy calls and holds a

‎pkg/devicemanager/allocator/thead/mig.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package thead
33
import (
44
"cmp"
55
"context"
6-
"encoding/json"
76
"errors"
87
"fmt"
98
"io/fs"
@@ -20,6 +19,7 @@ import (
2019

2120
workercore "gpustack.ai/gpustack/api/worker/v1alpha1"
2221
"gpustack.ai/gpustack/pkg/deviceplugin"
22+
"gpustack.ai/gpustack/pkg/utils/json"
2323
"gpustack.ai/gpustack/pkg/utils/osx"
2424
)
2525

0 commit comments

Comments
 (0)