Skip to content

Commit 3b986c9

Browse files
authored
Merge pull request #299 from makllama/xd/musa
Add MUSA Support
2 parents bed4533 + 90be09d commit 3b986c9

22 files changed

+85
-42
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,18 @@ jobs:
148148
sbom: true
149149
provenance: mode=max
150150
tags: ${{ steps.tags.outputs.rocm }}
151+
152+
- name: Build MUSA image
153+
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25
154+
with:
155+
file: Dockerfile
156+
target: final-llamacpp
157+
platforms: linux/amd64
158+
build-args: |
159+
"LLAMA_SERVER_VERSION=${{ inputs.llamaServerVersion }}"
160+
"LLAMA_SERVER_VARIANT=musa"
161+
"BASE_IMAGE=mthreads/musa:rc4.3.0-runtime-ubuntu22.04-amd64"
162+
push: true
163+
sbom: true
164+
provenance: mode=max
165+
tags: ${{ steps.tags.outputs.musa }}

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ If you encounter errors like `Package 'docker-model-plugin' has no installation
5757
# Check Docker Model Runner version
5858
docker model version
5959
```
60-
60+
6161
Look for the source in the output. If it shows a package from your distro, you'll need to reinstall from Docker's official repositories.
6262

6363
2. **Remove the distro version and install from Docker's official repository:**
6464
```bash
6565
# Remove distro version (Ubuntu/Debian example)
6666
sudo apt-get purge docker docker.io containerd runc
67-
67+
6868
# Install from Docker's official repository
6969
curl -fsSL https://get.docker.com | sudo bash
70-
70+
7171
# Verify Docker Model Runner is available
7272
docker model --help
7373
```
@@ -146,7 +146,7 @@ cd cmd/cli
146146
MODEL_RUNNER_HOST=http://localhost:13434 ./model-cli list
147147

148148
# Pull and run a model
149-
MODEL_RUNNER_HOST=http://localhost:13434 ./model-cli run ai/smollm2 "Hello, how are you?"
149+
MODEL_RUNNER_HOST=http://localhost:13434 ./model-cli run ai/smollm2 "Hello, how are you?"
150150
```
151151

152152
#### Option 2: Using Docker
@@ -173,7 +173,7 @@ MODEL_RUNNER_HOST=http://localhost:13434 ./model-cli list
173173

174174
## Using the Makefile
175175

176-
This project includes a Makefile to simplify common development tasks. It requires Docker Desktop >= 4.41.0
176+
This project includes a Makefile to simplify common development tasks. It requires Docker Desktop >= 4.41.0
177177
The Makefile provides the following targets:
178178

179179
- `build` - Build the Go application
@@ -224,6 +224,7 @@ Available variants:
224224
- `cpu`: CPU-optimized version
225225
- `cuda`: CUDA-accelerated version for NVIDIA GPUs
226226
- `rocm`: ROCm-accelerated version for AMD GPUs
227+
- `musa`: MUSA-accelerated version for MTHREADS GPUs
227228

228229
The binary path in the image follows this pattern: `/com.docker.llama-server.native.linux.${LLAMA_SERVER_VARIANT}.${TARGETARCH}`
229230

cmd/cli/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,37 @@ A powerful command-line interface for managing, running, packaging, and deployin
2424
```
2525
3. **Install Model Runner:**
2626
```bash
27-
./model install-runner
27+
./model-cli install-runner
2828
```
2929
Use `--gpu cuda` for GPU support, or `--gpu auto` for automatic detection.
3030

3131
## Usage
32-
Run `./model --help` to see all commands and options.
32+
Run `./model-cli --help` to see all commands and options.
3333

3434
### Common Commands
35-
- `model install-runner` — Install the Docker Model Runner
36-
- `model start-runner` — Start the Docker Model Runner
37-
- `model stop-runner` — Stop the Docker Model Runner
38-
- `model restart-runner` — Restart the Docker Model Runner
39-
- `model run MODEL [PROMPT]` — Run a model with a prompt or enter chat mode
40-
- `model list` — List available models
41-
- `model package --gguf <path> --push <target>` — Package and push a model
42-
- `model logs` — View logs
43-
- `model status` — Check runner status
44-
- `model configure MODEL [flags]` — Configure model runtime
45-
- `model unload MODEL` — Unload a model
46-
- `model tag SOURCE TARGET` — Tag a model
47-
- `model pull MODEL` — Pull a model
48-
- `model push MODEL` — Push a model
49-
- `model rm MODEL` — Remove a model
35+
- `model-cli install-runner` — Install the Docker Model Runner
36+
- `model-cli start-runner` — Start the Docker Model Runner
37+
- `model-cli stop-runner` — Stop the Docker Model Runner
38+
- `model-cli restart-runner` — Restart the Docker Model Runner
39+
- `model-cli run MODEL [PROMPT]` — Run a model with a prompt or enter chat mode
40+
- `model-cli list` — List available models
41+
- `model-cli package --gguf <path> --push <target>` — Package and push a model
42+
- `model-cli logs` — View logs
43+
- `model-cli status` — Check runner status
44+
- `model-cli configure MODEL [flags]` — Configure model runtime
45+
- `model-cli unload MODEL` — Unload a model
46+
- `model-cli tag SOURCE TARGET` — Tag a model
47+
- `model-cli pull MODEL` — Pull a model
48+
- `model-cli push MODEL` — Push a model
49+
- `model-cli rm MODEL` — Remove a model
5050

5151
## Example: Interactive Chat
5252
```bash
53-
./model run llama.cpp "What is the capital of France?"
53+
./model-cli run llama.cpp "What is the capital of France?"
5454
```
5555
Or enter chat mode:
5656
```bash
57-
./model run llama.cpp
57+
./model-cli run llama.cpp
5858
> """
5959
Tell me a joke.
6060
"""

cmd/cli/commands/install-runner.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"github.com/docker/model-runner/cmd/cli/pkg/types"
87
"os"
98
"time"
109

10+
"github.com/docker/model-runner/cmd/cli/pkg/types"
11+
1112
"github.com/docker/docker/api/types/container"
1213
"github.com/docker/model-runner/cmd/cli/commands/completion"
1314
"github.com/docker/model-runner/cmd/cli/desktop"
@@ -247,6 +248,8 @@ func runInstallOrStart(cmd *cobra.Command, opts runnerOptions) error {
247248
gpu = gpupkg.GPUSupportCUDA
248249
} else if opts.gpuMode == "rocm" {
249250
gpu = gpupkg.GPUSupportROCm
251+
} else if opts.gpuMode == "musa" {
252+
gpu = gpupkg.GPUSupportMUSA
250253
} else if opts.gpuMode != "none" {
251254
return fmt.Errorf("unknown GPU specification: %q", opts.gpuMode)
252255
}
@@ -295,7 +298,7 @@ func newInstallRunner() *cobra.Command {
295298
c.Flags().Uint16Var(&port, "port", 0,
296299
"Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode)")
297300
c.Flags().StringVar(&host, "host", "127.0.0.1", "Host address to bind Docker Model Runner")
298-
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda|rocm)")
301+
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda|rocm|musa)")
299302
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
300303
return c
301304
}

cmd/cli/commands/reinstall-runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func newReinstallRunner() *cobra.Command {
2828
c.Flags().Uint16Var(&port, "port", 0,
2929
"Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode)")
3030
c.Flags().StringVar(&host, "host", "127.0.0.1", "Host address to bind Docker Model Runner")
31-
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda)")
31+
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda|musa)")
3232
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
3333
return c
3434
}

cmd/cli/commands/restart-runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func newRestartRunner() *cobra.Command {
3636
c.Flags().Uint16Var(&port, "port", 0,
3737
"Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode)")
3838
c.Flags().StringVar(&host, "host", "127.0.0.1", "Host address to bind Docker Model Runner")
39-
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda)")
39+
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda|musa)")
4040
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
4141
return c
4242
}

cmd/cli/commands/start-runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func newStartRunner() *cobra.Command {
2424
}
2525
c.Flags().Uint16Var(&port, "port", 0,
2626
"Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode)")
27-
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda)")
27+
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda|musa)")
2828
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
2929
return c
3030
}

cmd/cli/docs/reference/docker_model_install-runner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ options:
1919
- option: gpu
2020
value_type: string
2121
default_value: auto
22-
description: Specify GPU support (none|auto|cuda|rocm)
22+
description: Specify GPU support (none|auto|cuda|rocm|musa)
2323
deprecated: false
2424
hidden: false
2525
experimental: false

cmd/cli/docs/reference/docker_model_reinstall-runner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ options:
1919
- option: gpu
2020
value_type: string
2121
default_value: auto
22-
description: Specify GPU support (none|auto|cuda)
22+
description: Specify GPU support (none|auto|cuda|musa)
2323
deprecated: false
2424
hidden: false
2525
experimental: false

cmd/cli/docs/reference/docker_model_restart-runner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ options:
2121
- option: gpu
2222
value_type: string
2323
default_value: auto
24-
description: Specify GPU support (none|auto|cuda)
24+
description: Specify GPU support (none|auto|cuda|musa)
2525
deprecated: false
2626
hidden: false
2727
experimental: false

0 commit comments

Comments
 (0)