Repository navigation
fix(tokenizer): avoid GPU model imports for DeepSeek-V3.2 - #1658
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Move the tokenizer wrapper lightllm/models/deepseek3_2/model.py, lightllm/models/deepseek3_2/tokenizer.py |
The wrapper and its chat-template handling move from the model module to the tokenizer module. |
Wire and verify tokenizer selection lightllm/server/tokenizer.py, unit_tests/server/test_tokenizer.py |
The server imports the wrapper from the tokenizer module. Tests check regular, thinking, and tool template output, and verify that the model module is not loaded. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- ModelTC/LightLLM#1593: Adds a tokenizer-only path and import-isolation tests for DeepSeek-V4; this PR applies similar import-isolation testing to DeepSeek-V3.2.
Suggested reviewers: sufubao
Merge Risk: 
Minimal · up to 4c35b
-
No concrete merge-blocking risk was identified in the tokenizer relocation.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Resolve the tokenizer import-isolation test conflict while preserving DeepSeek-V3.2 and DeepSeek-V4 coverage. Validation: 29 tokenizer tests passed; Black and Flake8 passed.
Initializing a DeepSeek-V3.2 tokenizer currently imports
deepseek3_2.model, which also loads model weights, inference layers, and GPU kernel dependencies. This unnecessarily exposes CPU-only PD masters and other tokenizer-only processes to GPU import failures.Move the existing
DeepSeekV32Tokenizerclass unchanged intodeepseek3_2/tokenizer.pyand update the tokenizer factory. Replace the fake model-module stub in the import-isolation regression with the real wrapper, covering text encoding, thinking, and tool prompt construction while rejecting GPU model implementation imports.Validation:
CUDA_VISIBLE_DEVICES=''andHF_HUB_OFFLINE=1; pytest is unavailable in the validation environment.Summary by CodeRabbit