Repository navigation
[dev] [DeepSeek-v4] Context Parallel support #5087
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 21 commits
b83d57e
8a271be
3aeb5f5
91710ac
3418b58
4afb6fe
cea7032
db75531
2acda35
867d4c8
e75190a
83b1938
1df04cb
50e63e7
19313cd
46ec4cf
cad0ac5
9fb43fe
1ada640
d4832db
e1198f6
e8b0ff2
3599a37
1543950
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 |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| # syntax=docker/dockerfile:1.3-labs | ||
|
|
||
| ARG FROM_IMAGE_NAME | ||
| FROM ${FROM_IMAGE_NAME} as main | ||
|
Check warning on line 5 in docker/Dockerfile.ci.dev
|
||
| ENV PIP_CONSTRAINT="" | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ARG UV_VERSION=0.7.2 | ||
|
|
@@ -31,7 +31,7 @@ | |
| curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh | ||
| EOF | ||
|
|
||
| RUN ln -sf /usr/local/cuda/targets/x86_64-linux/include/cuda \ | ||
| RUN ln -sf /usr/local/cuda/include/cccl/cuda \ | ||
| /usr/local/include/cuda | ||
| RUN find /usr/local/cuda -name "utility" 2>/dev/null | head -5 && \ | ||
| ls /usr/local/cuda/targets/x86_64-linux/include/ | head -20 | ||
|
|
@@ -40,6 +40,8 @@ | |
| COPY megatron/core/__init__.py /workspace/megatron/core/ | ||
| COPY megatron/core/package_info.py /workspace/megatron/core/ | ||
| ARG IMAGE_TYPE=dev | ||
| ARG CUDNN_FRONTEND_COMMIT=0a14b7181d129d30e7bad34b8c3ed0a0c995e23d | ||
| ARG FLASH_MLA_COMMIT=b7643bd54521f563b839b98289b5cd048c062ba2 | ||
|
Contributor
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. I think flash_mla is already using the commit you want
Contributor
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. Oh this PR is going into dev branch. I would just cherry pick this change from main branch
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. Thanks for pointing this out. I mirrored the change from #5448 on the dev branch, pyproject.toml now tracks FlashMLA |
||
| RUN --mount=type=cache,target=/root/.cache/uv \ | ||
| bash -ex <<"EOF" | ||
| export NVTE_CUDA_ARCHS="80;90;100" | ||
|
|
@@ -61,7 +63,12 @@ | |
| --no-install-package nvidia-cusolver-cu12 \ | ||
| --no-install-package nvidia-cusparse-cu12 \ | ||
| --no-install-package nvidia-cusparselt-cu12 \ | ||
| --no-install-package nvidia-nccl-cu12 | ||
| --no-install-package nvidia-nccl-cu12 \ | ||
| --no-install-package nvidia-cudnn-frontend | ||
| uv pip install --no-build-isolation \ | ||
| "flash-mla @ git+https://github.com/deepseek-ai/FlashMLA.git@${FLASH_MLA_COMMIT}" \ | ||
| "nvidia-cudnn-frontend[cutedsl] @ git+https://github.com/NVIDIA/cudnn-frontend.git@${CUDNN_FRONTEND_COMMIT}" \ | ||
| "torch-c-dlpack-ext==0.1.5" | ||
|
Contributor
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. Please use the pyproject.toml and uv.lock to manage dependencies if possible
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. Done. FlashMLA and cuDNN Frontend are now declared in pyproject.toml, with the exact revisions and the CuTe DSL / DLPack transitive dependencies captured in uv.lock. The Dockerfile now installs this dependency chain through uv sync --locked; the separate manual installation has been removed. |
||
| EOF | ||
|
|
||
| # Install DeepEP | ||
|
|
@@ -83,10 +90,15 @@ | |
| EOF | ||
|
|
||
| COPY assets/ /opt/data/ | ||
| # Reinstall CuTe DSL cleanly after upgrading the version provided by the base image. | ||
| RUN uv pip install --reinstall --no-deps \ | ||
| nvidia-cutlass-dsl==4.5.0 \ | ||
| nvidia-cutlass-dsl-libs-base==4.5.0 \ | ||
| nvidia-cutlass-dsl-libs-cu13==4.5.0 | ||
|
Contributor
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 do we need to reinstall? Can we handle this in pyproject toml and uv lock?
Contributor
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. @balasaajay @ko3n1g btw, looks like we had to do this in MBridge container though I can't recall why.
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. The explicit reinstall is no longer needed and has been removed. nvidia-cudnn-frontend[cutedsl] now resolves the required CuTe DSL 4.5.0 packages through uv.lock. |
||
| ENV UV_PYTHON=$UV_PROJECT_ENVIRONMENT/bin/python | ||
|
|
||
| ##### For NVIDIANS only ##### | ||
| FROM main as jet | ||
|
Check warning on line 101 in docker/Dockerfile.ci.dev
|
||
| ARG JET_API_VERSION | ||
| ENV PATH="$PATH:/opt/jet/bin" | ||
| RUN --mount=type=secret,id=JET_INDEX_URLS bash -ex <<"EOF" | ||
|
|
||
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.
@kunlunl Do we know when cudnn-frontend will include this in a release? Does this need to be included in next 26.08 Megatron-Bridge container release? Is the code backwards compatible to handle if cudnn frontend is not at this commit?
@balasaajay @ko3n1g any concerns?
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.
@balasaajay @ko3n1g I didn't realize this was going into dev branch. I don't think much of a concern on the specific cudnn frontend used for dev branch, right? Main recommendation would still be to move what we can to pyproject toml and uv lock.
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.
Thanks for checking. Since this PR targets the dev branch, I pinned the required cuDNN Frontend commit in pyproject.toml / uv.lock for the dev environment.
Older cuDNN Frontend versions remain usable for paths that do not require the new CP offset API. When ratio-4 fused CP is enabled, TransformerConfig now checks that the required wrappers expose q_causal_offsets and raises a clear initialization error if they do not, with the option to disable DSA kernel fusion.