[Bug]: MappingBase.to_dict() drops pp_partition
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Đọc MappingBase.to_dict() trong tensorrt_llm/mapping.py và các bài kiểm thử mapping trong tests/unittest/others/test_mapping.py. Tái hiện quá trình chuyển đổi khứ hồi với pp_partition tùy chỉnh, sau đó kiểm tra rằng Mapping.from_dict(m.to_dict()) giữ nguyên nó và việc thay đổi danh sách đã xuất không làm thay đổi bản gốc. Issue mô tả hành vi mong đợi và vị trí của bài kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
System Info
- OS: Windows 11 (x86_64) — reproduced directly against
NVIDIA/TensorRT-LLMmain(1d379e2b4) - Python: 3.14 (CPU-only pure-Python unit reproduction;
tensorrt_llm/mapping.pyis pure Python) - TensorRT-LLM commit:
1d379e2b4(origin/main)
Who can help?
@Shixiaowei02 @funatiq (listed under Inference runtime in .github/workflows/module-owners.json / @NVIDIA/trt-llm-runtime-devs in CODEOWNERS).
I already have a minimal fix and regression unit test ready locally and would be happy to open the PR if a maintainer agrees this should proceed.
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
MappingBase.to_dict() in tensorrt_llm/mapping.py (around lines 472–491 on 1d379e2b4) exports all constructor parameters of MappingBase.__init__ except pp_partition. Calling Mapping.from_dict(m.to_dict()) or Mapping(**m.to_dict()) silently resets pp_partition to None.
Minimal reproduction:
from tensorrt_llm.mapping import Mapping
m1 = Mapping(
world_size=2,
rank=0,
tp_size=1,
pp_size=2,
pp_partition=[10, 22],
)
as_dict = m1.to_dict()
m2 = Mapping.from_dict(as_dict)
assert "pp_partition" in as_dict, f"missing pp_partition key: {sorted(as_dict.keys())}"
Inspecting the resulting objects without modifying MappingBase.to_dict():
m1.pp_partition = [10, 22]
m2.pp_partition = None
m1 == m2 -> False
m1.pp_layers(32) = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
m2.pp_layers(32) = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Expected behavior
MappingBase.to_dict() should include 'pp_partition': copy.copy(self.pp_partition) so that:
Mapping.from_dict(m.to_dict())andMapping(**m.to_dict())preserve custompp_partitionvalues (m2 == m1,hash(m2) == hash(m1), identicalpp_layers()andpp_rank_of_layer()).- Mutating the exported list in the returned dict does not mutate
m.pp_partition.
actual behavior
MappingBase.to_dict() omits 'pp_partition', so any Mapping.from_dict(m.to_dict()) or Mapping(**m.to_dict()) round-trip silently drops pp_partition to None and reverts to uniform layer partitioning across PP ranks.
additional notes
Real callers affected on main (1d379e2b4):
tensorrt_llm/_torch/pyexecutor/py_executor_creator.py(lines 955–958):
When expert DWDP (mapping = Mapping(**{ **mapping.to_dict(), "dwdp_size": dwdp_size, "dwdp_rank": dwdp_rank })dwdp_size > 1) is combined with a custompp_partition, this call silently resetspp_partitiontoNonebefore creatingDistributed.get(mapping)and the executor.tensorrt_llm/_torch/models/modeling_kimi_linear.py(lines 2151–2155):
Similarly drops any custommapping_dict = mapping.to_dict() mapping_dict["moe_cluster_size"] = 1 mapping_dict["moe_tp_size"] = moe_tp mapping_dict["moe_ep_size"] = moe_ep routed_mapping = Mapping.from_dict(mapping_dict)pp_partitiononrouted_mapping.
Note: Adding 'pp_partition': copy.copy(self.pp_partition) in MappingBase.to_dict() is a minimal 1-line fix; I have it ready locally alongside parametrized regression tests in tests/unittest/others/test_mapping.py and will open the PR once confirmed.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
- Ngôn ngữ chính
- Python
- Star
- 15.2k
- Fork
- 3k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 477
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xCó thể đã có người làm @NimaVaziri đã nhận hôm nay. Đang mởPytorch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: MMLU subsampling changes when evaluators are interleavedCó thể đã có người làm @LeNeLeNeWo đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NVIDIA/TensorRT-LLM#23273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderCó thể đã có người làm @sbeierle đã nhận 3 ngày trước. Đang mởTesting
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NVIDIA/TensorRT-LLM#23077 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LongBench V2 blog command breaks on inline comments after continuationsCó thể đã có người làm @ddlw đã nhận 25 ngày trước. Đang mởDoc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
NVIDIA/TensorRT-LLM#21879 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: AutoTuner load_cache crashes on a non-string tactic entry: warning_once(key=<list>) raises TypeError: unhashable typeCó thể đã có người làm @Gloria72 đã nhận 36 ngày trước. Đang mởCustomized kernels
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/TensorRT-LLM#21218 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/TensorRT-LLM
Issue tương tự
-
[Resource]: SpaicelyĐang mởresource-submission validation-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
hesreallyhim/awesome-claude-code#3875 · 1 bình luận ·
-
[Bug]: Ajax Pro login issueĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
bvis/aegis-hass#725 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
Maintainer thường phản hồi trong vòng 1 ngày