Conversation
Build prefill and decode cache tables and slot mappings in batched NumPy operations instead of creating and copying many small tensors. Decode now writes tables and block counts directly into shared staging buffers. In the aligned GBS32 profile, median decode prepare_early fell from 12.74 ms to 5.85 ms and prefill prepare_inputs fell from 22.44 ms to 11.10 ms.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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 |
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.
Summary
Batch DeepSeek V4 cache-table and slot-mapping preparation across requests and ranks instead of constructing many small tensors per row. Decode writes table data and block counts directly into shared staging buffers, while prefill builds metadata for all requests together. The aligned GBS32 profile reduced median decode prepare_early from 12.74 ms to 5.85 ms and prefill prepare_inputs from 22.44 ms to 11.10 ms.
Changes
DeepSeekV4CacheMetadataBuilder: bucket compatible rows and populate block tables and slot mappings with batched NumPy operations.Verification
/data/yangyaodong/code/pypto-serving/.venv-dsv4-cb49/bin/python -m pytest tests/unit/model/deepseek/test_model_components.py -q -k "cache_metadata_maps_scheduler_block_ids or prepare_prefill_inputs or prepare_decode_inputs": exit 0, 18 passed, 90 deselected./data/yangyaodong/code/pypto-serving/.venv-dsv4-cb49/bin/python tests/lint/check_headers.py: exit 0./data/yangyaodong/code/pypto-serving/.venv-dsv4-cb49/bin/python tests/lint/check_english_only.py: exit 0.git ls-files -z -- "*.py" "*.pyi" | xargs -0 /data/yangyaodong/.cache/pre-commit/repowkh36_43/py_env-python3.10/bin/ruff check --config ruff.toml: exit 0.