Skip to content
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

DeepSeek #11971

Merged
merged 44 commits into from
Feb 22, 2025
Merged

DeepSeek #11971

merged 44 commits into from
Feb 22, 2025

Conversation

cuichenx
Copy link
Collaborator

@cuichenx cuichenx commented Jan 28, 2025

What does this PR do ?

Add DeepSeek V2-Lite, V2, and V3 (including R1) models.
Support model import (from HF), model export (to HF), SFT/LoRA recipes.

Currently not supported: SFT/LoRA with packed sequence, pretraining,

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Sorry, something went wrong.

cuichenx and others added 2 commits January 27, 2025 21:47
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
cuichenx and others added 20 commits January 28, 2025 09:42
clean
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
This reverts commit 4e5929b.
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
exporter
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
@NVIDIA NVIDIA deleted a comment from github-actions bot Feb 12, 2025
@NVIDIA NVIDIA deleted a comment from github-actions bot Feb 12, 2025
cuichenx and others added 4 commits February 13, 2025 22:47
Signed-off-by: Chen Cui <chcui@nvidia.com>
# Conflicts:
#	nemo/collections/llm/gpt/model/deepseek.py

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
@cuichenx cuichenx marked this pull request as ready for review February 14, 2025 03:53
@cuichenx
Copy link
Collaborator Author

@JRD971000 @yaoyu-33 could you review the changes to ssm.py and mllama.py

cuichenx and others added 3 commits February 20, 2025 15:30
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
hemildesai
hemildesai previously approved these changes Feb 21, 2025
Copy link
Collaborator

@hemildesai hemildesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for llm/api and nemo.lightning related changes

Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
fix test
Signed-off-by: Chen Cui <chcui@nvidia.com>
Copy link
Contributor

[🤖]: Hi @cuichenx 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully

So it might be time to merge this PR or get some approvals

I'm just a bot so I'll leave it you what to do next.

//cc @pablo-garay @ko3n1g

@ko3n1g ko3n1g merged commit b1dd398 into main Feb 22, 2025
192 checks passed
@ko3n1g ko3n1g deleted the chcui/deepseek branch February 22, 2025 10:14
ko3n1g pushed a commit that referenced this pull request Feb 22, 2025

Verified

This commit was signed with the committer’s verified signature.
ko3n1g oliver könig
* initial commit

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* clean

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* fix mscale and remove debug code

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* remove MTP to avoid HF warning

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Revert "remove MTP to avoid HF warning"

This reverts commit 4e5929b.

* guard v3 args

Signed-off-by: Chen Cui <chcui@nvidia.com>

* guard one more v3 arg

Signed-off-by: Chen Cui <chcui@nvidia.com>

* add recipes (wip)

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update to latest mcore

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update to latest mcore

Signed-off-by: Chen Cui <chcui@nvidia.com>

* support lora for TELinear

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* support V2 lite

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* exporter

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* memory-efficient hf export

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* code scanning

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* comment out cli factory for pretraining recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Support non-layernom column parallel layer for LoRA SP in MLA

Signed-off-by: Chen Cui <chcui@nvidia.com>

* add v2-lite recipe

Signed-off-by: Chen Cui <chcui@nvidia.com>

* recipe typos

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* linting

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* guard packed sequence=false

Signed-off-by: Chen Cui <chcui@nvidia.com>

* unused imports

Signed-off-by: Chen Cui <chcui@nvidia.com>

* fix lora

Signed-off-by: Chen Cui <chcui@nvidia.com>

* address comments

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* fix test

Signed-off-by: Chen Cui <chcui@nvidia.com>

---------

Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Co-authored-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
ko3n1g added a commit that referenced this pull request Feb 22, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
* DeepSeek (#11971)

* initial commit

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* clean

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* fix mscale and remove debug code

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* remove MTP to avoid HF warning

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Revert "remove MTP to avoid HF warning"

This reverts commit 4e5929b.

* guard v3 args

Signed-off-by: Chen Cui <chcui@nvidia.com>

* guard one more v3 arg

Signed-off-by: Chen Cui <chcui@nvidia.com>

* add recipes (wip)

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update to latest mcore

Signed-off-by: Chen Cui <chcui@nvidia.com>

* update to latest mcore

Signed-off-by: Chen Cui <chcui@nvidia.com>

* support lora for TELinear

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* support V2 lite

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* exporter

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* memory-efficient hf export

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* code scanning

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* comment out cli factory for pretraining recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Support non-layernom column parallel layer for LoRA SP in MLA

Signed-off-by: Chen Cui <chcui@nvidia.com>

* add v2-lite recipe

Signed-off-by: Chen Cui <chcui@nvidia.com>

* recipe typos

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* linting

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* update recipes

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* guard packed sequence=false

Signed-off-by: Chen Cui <chcui@nvidia.com>

* unused imports

Signed-off-by: Chen Cui <chcui@nvidia.com>

* fix lora

Signed-off-by: Chen Cui <chcui@nvidia.com>

* address comments

Signed-off-by: Chen Cui <chcui@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>

* fix test

Signed-off-by: Chen Cui <chcui@nvidia.com>

---------

Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Co-authored-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>

* missing imports

Signed-off-by: oliver könig <okoenig@nvidia.com>

---------

Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: cuichenx <cuichenx@users.noreply.github.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
Co-authored-by: Chen Cui <chcui@nvidia.com>
Co-authored-by: cuichenx <cuichenx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants