[Feature] Enable cache aware DP routing for standalone ATOMesh#1501
Open
simondanielsson wants to merge 4 commits into
Open
[Feature] Enable cache aware DP routing for standalone ATOMesh#1501simondanielsson wants to merge 4 commits into
simondanielsson wants to merge 4 commits into
Conversation
Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
Collaborator
|
hi, thanks for your support! And we also have a similar pr #1505, @JiaoliangYu will discuss and work with you |
…k-header Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
Author
|
@ZhangLirong-amd @JiaoliangYu This PR is still needed to support cache aware routing using
Would appreciate a review, thanks 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Enable cache aware DP routing for data parallel attention using standalone ATOMesh router.
Note: #1505 added logic to wire up the
data-parallel-rankfield from the ATOMesh router to ATOM, however/v1/completions, not/v1/chat/completionsmesh-onlymode not supported/server_infoendpoint used by the atommesh router doesn't exist in ATOMTechnical Details
Running DPA with ATOM on real workloads requires prefix cache hit rate similar to TP, which requires a cache aware router like atommesh. Atommesh selects which DP rank to route to and injects
data-parallel-rankinto the request body accordingly. However, ATOM currently ignores this field and defaults to round-robin DP routing.This PR makes ATOM account for this field injected by atommesh. We also expose the endpoint
/server_infowhich atommesh uses to identify the number of DP replicas.Test Plan
Run ATOM with DPA + Atommesh router and check if prefix cache hits are as expected (i.e, better than round robin). Tested on DSv3 on MI350.
docker run \ --rm \ --name atomesh-router \ --init --network host --ipc host --privileged \ --cap-add SYS_PTRACE --security-opt seccomp=unconfined \ --ulimit memlock=-1 --ulimit stack=67108864 \ --shm-size 256G \ --group-add video \ --device /dev/kfd --device /dev/dri --device /dev/infiniband \ -e USE_ATOMESH_ENTRYPOINTS=1 \ --entrypoint python3 \ atommesh:nightly \ -m atom.entrypoints.openai_server mesh-only \ --host 0.0.0.0 \ --port 30000 \ --worker-urls "http://localhost:8000" \ --dp-aware \ --policy cache_awareExpand to see dockerfile for building atommesh
Run a basic prefix repetition benchmark, like the one shipped by vLLM. This has 5 unique prefixes each of length 512 tokens, each running 100/5=20 times. So we would expect about (20-1)*5*512=48k cached tokens. The (20-1) comes from the fact that the first request of each prefix does not hit the cache, but the subsequent 19 requests of the same prefix does hit it.
ATOM logs the cache hit rate every 100 requests so we can read it off there.
Test Result
Checking the logs, as expected we get 48k cached tokens.
A round robin routing would yield a much lower hit rate.
Submission Checklist