Repository navigation
Conversation
|
Very interesting changes, looks good, I'll come back and check it out later. Thanks. |
| # build the wheel | ||
| FROM base AS build | ||
|
|
||
| RUN --mount=type=cache,target=/root/.cache/pip \ |
There was a problem hiding this comment.
I don't recommend using absolute paths. What's the purpose of adding them here?
There was a problem hiding this comment.
It is inspired from vllm's Dockerfile:
https://github.com/vllm-project/vllm/blob/main/Dockerfile#L47
RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install -r requirements-cuda.txt
https://docs.docker.com/build/guide/mounts/#add-a-cache-mount
The default pip cache directory (as the docker build is running as root), is /root/.cache/pip.
The --mount in Dockerfile will mount the file (or volume) only during the RUN operation, and that will not preserved in the produced image.
This is kinda equivalent as:
- Run pip install with wheels cached to local machines (to deduplicate subsequent downloads in the future)
- Then remove the cache from the docker image layer.
|
Yes, it's a good idea to upgrade the python version. Thanks! |
Co-authored-by: Lianmin Zheng <[email protected]>
| RUN python3 -m build | ||
|
|
||
| # minimal sglang srt image | ||
| FROM python:3.10-slim AS srt |
There was a problem hiding this comment.
Use configuration for version instead of hardcoding.
| RUN --mount=type=bind,from=build,src=/sgl-workspace/sglang/python/dist,target=/sgl-workspace/dist \ | ||
| --mount=type=cache,target=/root/.cache/pip \ | ||
| pip install --verbose $(find /sgl-workspace/dist -name "*.whl" -printf "%p[srt] ") && \ | ||
| pip install --index https://flashinfer.ai/whl/cu121/torch2.4/ flashinfer |
| pip install --verbose $(find /sgl-workspace/dist -name "*.whl" -printf "%p[srt] ") && \ | ||
| pip install --index https://flashinfer.ai/whl/cu121/torch2.4/ flashinfer | ||
|
|
||
| ENTRYPOINT [ "python3", "-m", "sglang.launch_server" ] |
`mb_id` and `forward_ct` were both checked and both correct -- and both too coarse. A chunked request occupies the SAME mb slot across SEVERAL passes, and one forward of offset IS the normal pipeline state. Measured on this config in boot 45: one request walked `len_input` 4096 -> 4096 -> 254 over three passes, identical on all three ranks, with the extend invariant holding at every point. Both identities stayed valid across a factor-16 change in the quantity the guard compares. An identity check is only as good as the match between its GRANULARITY and what varies. Two passed identity checks are not proof of the same work. So the stamp now carries the sender's CHUNK POSITION -- the rid and `extend_range` of the batch the proxy was built from -- and the receiver attaches its own through the same helper, so the guard prints like against like. Equal means one pass and the divergence is elsewhere; different means the guard is comparing two passes of the same request, which is what the measured walk predicts and what the unstable sign requires (sender larger in boot 44 at 422/254, smaller in boots 26-34 at 253/254/277 against 301/302 -- which pair collides decides the sign). Coverage is satisfied by construction here, and that is why the field sits at the guard rather than in the sgl-project#998 probe: the guard only prints when it fires, so the reading is the dying request by definition. Two closing statements of this window rested on samples that excluded it. Appended at index 5; every stamp consumer indexes positionally behind a `>= N` guard, verified again by reading epoch out of a 6-tuple. The helper returns (-1,-1,-1) rather than raising -- a stamp may not break a send. THE GUARD IS NOT TO BE REMOVED. If it turns out to be comparing two passes, it is the only thing making that confusion visible today; the answer is a stamp that lets it be RIGHT, not switching it off. Evidence: desk. py_compile on both files; the helper degrades to its sentinel on an empty scheduler, and `pp_proxy_stamp_epoch` still reads index 3 from a 6-tuple. Belegstufe: DESK-BEWIESEN.
Thank you for your contribution, we really appreciate it. The following instructions will help improve your pull request and make it easier to receive feedback. If there are any items you don't understand, don't worry. Just submit the pull request and ask the maintainers for help.
Motivation
The current
lmsysorg/sglangimage is somewhat painful to download in some shared cloud environment, where they don't cache images locally, due to it's size (compressed size of 8.19 GB). Uncompressed image size:Modification
srtwhich only installssglang[srt]on top ofpython:slimimage. If anyone think we need to usenvidia/cuda:*-base-*image, I can change this PR to use that image instead. The result is whopping -46% in size (compressed size of 4.44 GB). Uncompressed image size:nvidia/cuda:*-devel-*image to runsrt(seems like all the needed CUDA stuffs are already being installed by pip and/or mounted by the host machine).srtbuild stage is basically simply gonna build the wheel from the base stage, and installing it.srt-only image to some of our production instances and are working fine.-srtto the existing tags, so that the existing tags can still be used as-is.-srttagged images will havepython -m sglang.launch_serveras anENTRYPOINT.Discussions
COPYinstruction instead? (cc: @zhyncs)Checklist
pre-commit run --all-filesor other linting tools are used to fix potential lint issues.