transfer mrope_position_delta to device when first running#11047
Merged
zhyncs merged 9 commits intosgl-project:mainfrom Oct 26, 2025
Merged
transfer mrope_position_delta to device when first running#11047zhyncs merged 9 commits intosgl-project:mainfrom
zhyncs merged 9 commits intosgl-project:mainfrom
Conversation
Alcanderian
approved these changes
Oct 17, 2025
ping1jing2
approved these changes
Oct 26, 2025
2 tasks
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
related to #11046
Modifications
The
mrope_position_deltais transferred to the device during the first run to avoid subsequent host-to-device transfers for decode performance improvement of multi-modality models.Accuracy Tests
Ascend NPU:
result before modification:
Benchmark time: 388.05547650624067s
Overall accuracy: 0.582
result after modification:
Benchmark time: 279.4189731432125s
Overall accuracy: 0.583
H20 GPU:
result before modification:
Benchmark time: 293.04421259183437
Overall accuracy: 0.586
result after modification:
Benchmark time: 291.70924793416634
Overall accuracy: 0.586
Benchmarking and Profiling
Ascend NPU:
result before modification:
============ Serving Benchmark Result ============
Backend: sglang
Traffic request rate: inf
Max request concurrency: 32
Successful requests: 512
Benchmark duration (s): 497.67
Total input tokens: 27971
Total generated tokens: 131072
Total generated tokens (retokenized): 60654
Request throughput (req/s): 1.03
Input token throughput (tok/s): 56.20
Output token throughput (tok/s): 263.37
Total token throughput (tok/s): 319.58
Concurrency: 31.82
----------------End-to-End Latency----------------
Mean E2E Latency (ms): 30929.16
Median E2E Latency (ms): 31412.63
---------------Time to First Token----------------
Mean TTFT (ms): 6228.17
Median TTFT (ms): 6573.16
P99 TTFT (ms): 13450.14
---------------Inter-Token Latency----------------
Mean ITL (ms): 96.89
Median ITL (ms): 64.00
P95 ITL (ms): 283.95
P99 ITL (ms): 540.91
Max ITL (ms): 7429.85
result after modification:
============ Serving Benchmark Result ============
Backend: sglang
Traffic request rate: inf
Max request concurrency: 32
Successful requests: 512
Benchmark duration (s): 456.94
Total input tokens: 27877
Total generated tokens: 131072
Total generated tokens (retokenized): 60441
Request throughput (req/s): 1.12
Input token throughput (tok/s): 61.01
Output token throughput (tok/s): 286.85
Total token throughput (tok/s): 347.85
Concurrency: 31.83
----------------End-to-End Latency----------------
Mean E2E Latency (ms): 28403.76
Median E2E Latency (ms): 28722.04
---------------Time to First Token----------------
Mean TTFT (ms): 6642.61
Median TTFT (ms): 7468.42
P99 TTFT (ms): 13886.43
---------------Inter-Token Latency----------------
Mean ITL (ms): 85.35
Median ITL (ms): 57.98
P95 ITL (ms): 128.43
P99 ITL (ms): 584.89
Max ITL (ms): 10766.88
H20 GPU:
result before modification:
============ Serving Benchmark Result ============
Backend: sglang
Traffic request rate: inf
Max request concurrency: 32
Successful requests: 512
Benchmark duration (s): 301.21
Total input tokens: 27944
Total generated tokens: 131072
Total generated tokens (retokenized): 59641
Request throughput (req/s): 1.70
Input token throughput (tok/s): 92.77
Output token throughput (tok/s): 435.15
Total token throughput (tok/s): 527.92
Concurrency: 31.52
----------------End-to-End Latency----------------
Mean E2E Latency (ms): 18543.10
Median E2E Latency (ms): 18754.19
---------------Time to First Token----------------
Mean TTFT (ms): 7447.40
Median TTFT (ms): 8141.37
P99 TTFT (ms): 17402.11
---------------Inter-Token Latency----------------
Mean ITL (ms): 43.60
Median ITL (ms): 17.32
P95 ITL (ms): 76.08
P99 ITL (ms): 294.61
Max ITL (ms): 14387.22
result after modification:
============ Serving Benchmark Result ============
Backend: sglang
Traffic request rate: inf
Max request concurrency: 32
Successful requests: 512
Benchmark duration (s): 297.15
Total input tokens: 28008
Total generated tokens: 131072
Total generated tokens (retokenized): 59120
Request throughput (req/s): 1.72
Input token throughput (tok/s): 94.26
Output token throughput (tok/s): 441.10
Total token throughput (tok/s): 535.36
Concurrency: 31.71
----------------End-to-End Latency----------------
Mean E2E Latency (ms): 18405.00
Median E2E Latency (ms): 18126.27
---------------Time to First Token----------------
Mean TTFT (ms): 7743.42
Median TTFT (ms): 8579.59
P99 TTFT (ms): 16227.20
---------------Inter-Token Latency----------------
Mean ITL (ms): 41.81
Median ITL (ms): 17.31
P95 ITL (ms): 36.65
P99 ITL (ms): 625.31
Max ITL (ms): 13778.65
Checklist