-
Notifications
You must be signed in to change notification settings - Fork 3
Fix Docker deployment #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
5ab4b24
c4d5d9d
5b50722
af09dcf
c673dc9
b9e3665
ef8ff05
c3bf9cf
3e685ed
ec43f29
45cd130
3b249d1
a7f404c
50a401a
6023cb2
7484eec
3957f8e
864a42a
8e5ded7
560d384
b18d843
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| .git | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.egg-info | ||
| build/ | ||
| dist/ | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| tests/output/ | ||
| tests/merged/ | ||
| logs/ | ||
| .mypy_cache/ | ||
| .pytest_cache/ | ||
| .ruff_cache/ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,22 @@ For testing and scripts that make use of the library, it is advised to create a | |||||||||||||||
| ./scripts/generate_env.sh | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ## Docker | ||||||||||||||||
|
|
||||||||||||||||
| ### Build | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| docker compose build | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ### Run | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| docker compose run --rm mmirage --config configs/your_config.yaml | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| The container requires an NVIDIA GPU. The `docker-compose.yml` handles GPU access automatically. | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| The container requires an NVIDIA GPU. The `docker-compose.yml` handles GPU access automatically. | |
| The container requires an NVIDIA GPU. The `docker-compose.yml` is configured to request GPU access, but the host must have: | |
| - NVIDIA GPU drivers installed | |
| - NVIDIA Container Toolkit / `nvidia-container-runtime` configured for Docker | |
| - A recent Docker Engine and Docker Compose version with GPU support enabled | |
| Without these host-side prerequisites, `docker compose run` may fail to detect or use the GPU. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| services: | ||
| mmirage: | ||
| build: | ||
| context: . | ||
| dockerfile: docker/Dockerfile | ||
| deploy: | ||
| resources: | ||
| reservations: | ||
| devices: | ||
| - driver: nvidia | ||
| count: all | ||
| capabilities: [gpu] |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,11 @@ | ||||||||||
| FROM docker.io/lmsysorg/sglang:latest | ||||||||||
| FROM --platform=linux/amd64 lmsysorg/sglang:v0.5.8.post1-runtime | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why only AMD?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and why not keep the latest image?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||
|
|
||||||||||
| ENV NVIDIA_VISIBLE_DEVICES=all | ||||||||||
| ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility | ||||||||||
|
Comment on lines
+1
to
+4
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated the description |
||||||||||
|
|
||||||||||
| COPY . /workspace/MMIRAGE | ||||||||||
| WORKDIR /workspace/MMIRAGE | ||||||||||
| RUN pip install --no-cache-dir -e . | ||||||||||
|
|
||||||||||
| RUN pip install --no-cache-dir . | ||||||||||
|
|
||||||||||
| ENTRYPOINT ["python3", "-m", "mmirage.shard_process"] | ||||||||||
|
||||||||||
| ENTRYPOINT ["python3", "-m", "mmirage.shard_process"] | |
| ENTRYPOINT ["python3", "-c", "import mmirage.core.process, runpy; runpy.run_module('mmirage.shard_process', run_name='__main__')"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's wrong to use this entrypoint, this means you can only run the mmirage.shard_process and not MMIRAGE's CLI
| ENTRYPOINT ["python3", "-m", "mmirage.shard_process"] | |
| ENTRYPOINT ["mmirage"] |
This way if you can directly call the CLI command run specifically designed to call mmirage.shard_process, and you can easily call the other CLI commands without workaround
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing with Fabrice, to be coherent with the documentation we will drop the entrypoint so that we just prefix each command by mmirage as said everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means you build both the GPU and CPU images while only actually using one of the two in the end
On my computer the build takes >10min, we could make it more optimized