Commit 124f649
committed
[None][refactor] Drop batched pos-embed kernel and prune vLLM references
Stripped layer of commit 7368e5b after measurement showed the batched
single-launch kernel did not move the conc=64 throughput needle and added
non-trivial setup cost (5 small H->D copies for per-image metadata) on
the low-concurrency path.
* Vision pos-embed interpolation goes back to the per-image Triton
kernel ``_triton_pos_embed_interpolate`` + ``torch.cat`` join in
``Qwen3VisionModel.fast_pos_embed_interpolate``. The kernel takes
``(h, w, h_scale, w_scale)`` as scalar args, so no H<->D metadata
transfers happen on the hot path. The batched
``_bilinear_pos_embed_batched_kernel`` /
``_triton_pos_embed_interpolate_batched`` pair is removed.
* Vision rotary cache no longer hard-codes ``max_rope_seqlen = 8192``;
``Qwen3VisionModel.__init__`` now constructs a standard
``RotaryEmbedding`` whose ``rotary_cos_sin`` buffer is sized to
``text_config.max_position_embeddings`` via ``RopeParams.from_config``.
``_rotary_pos_emb_thw`` slices ``self.rotary_pos_emb.rotary_cos_sin
[:max(h, w)]`` then indexes with ``pos_ids``, mirroring upstream/main.
* Removed vLLM cross-reference comments in modeling_qwen3vl.py,
modeling_qwen2vl.py, and modules/rotary_embedding.py while keeping
the local technical descriptions intact.
* Updated unit tests to mock ``rotary_pos_emb.rotary_cos_sin`` (the new
buffer location) and dropped the batched-vs-per-image comparison
test together with the batched kernel.
3-run aiperf sweep (conc=64, ISL=1000, OSL=100, warmup=20, single
512x512 image, Qwen3-VL-8B): throughput 18.01 +/- 0.94 req/s vs main
17.25 +/- 0.72 (+4.4%), TTFT 1082 +/- 107 ms vs 1240 +/- 137 (-12.7%),
latency 3528 +/- 178 ms vs 3692 +/- 149 (-4.4%).
Signed-off-by: yechank <161688079+yechank-nvidia@users.noreply.github.com>1 parent 7368e5b commit 124f649
4 files changed
Lines changed: 99 additions & 365 deletions
File tree
- tensorrt_llm/_torch
- models
- modules
- tests/unittest/_torch/modeling
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
782 | 781 | | |
783 | 782 | | |
784 | 783 | | |
| |||
951 | 950 | | |
952 | 951 | | |
953 | 952 | | |
954 | | - | |
955 | | - | |
956 | | - | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
957 | 956 | | |
958 | 957 | | |
959 | 958 | | |
| |||
978 | 977 | | |
979 | 978 | | |
980 | 979 | | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | 980 | | |
989 | 981 | | |
990 | 982 | | |
| |||
1031 | 1023 | | |
1032 | 1024 | | |
1033 | 1025 | | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
| 1026 | + | |
| 1027 | + | |
1037 | 1028 | | |
1038 | 1029 | | |
1039 | 1030 | | |
| |||
0 commit comments