Skip to content

[TRTLLM-18378][fix] Import TransformersTokenizer from tensorrt_llm.tokenizer in kimi_k3_processor_utils - #23279

Merged
YihuiLu512 merged 1 commit into
NVIDIA:mainfrom
YihuiLu512:fix/kimi-k3-layering-import
Dec 3, 2026
Merged

YihuiLu512 merged 1 commit into
NVIDIA:mainfrom
YihuiLu512:fix/kimi-k3-layering-import

Conversation

@YihuiLu512

@YihuiLu512 YihuiLu512 commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fix a merge-window layering contract failure on main between #23084 and #23145:

Change the import in tensorrt_llm/_torch/models/kimi_k3_processor_utils.py to the canonical tensorrt_llm.tokenizer module (which tensorrt_llm.llmapi.tokenizer directly re-exports), keeping runtime behavior identical without expanding the _ENGINE_USES_FRONTEND allowlist.

Test Coverage

  • Verified locally against latest main (ed9650f212):
    • Before fix: pytest --noconftest tests/unittest/executor/test_layering.py tests/unittest/serve/test_layering.py -k "test_contracts_hold or test_no_stale_allowances" failed on kimi_k3_processor_utils.py:26 (1 failed, 3 passed).
    • After fix: same command passes (4 passed, 0 failed).
  • pre-commit hooks passed (ruff, ruff-format, codespell, verify legacy lint configs, DCO).
  • Covered in CI by l0_cpu.yml (unittest/executor/test_layering.py).

PR Checklist

  • Please check this after reviewing the above items as appropriate for this PR.

Dev Engineer Review

  • The PR changes one import in tensorrt_llm/_torch/models/kimi_k3_processor_utils.py. TransformersTokenizer now comes from tensorrt_llm.tokenizer instead of tensorrt_llm.llmapi.tokenizer.
  • The author states that the legacy shim re-exports the canonical module. If so, runtime behavior does not change. I did not verify this in the source.
  • No other declarations or behavior changed.

QA Engineer Review

No test changes.

Per-File QA Perspective

  • tensorrt_llm/_torch/models/kimi_k3_processor_utils.py: Import path only. QA should confirm that the Kimi K3 processor still loads and tokenizes as before. The author reports that tests/unittest/executor/test_layering.py and tests/unittest/serve/test_layering.py now pass.

…kenizer in kimi_k3_processor_utils

Signed-off-by: Yihui Lu <269394165+YihuiLu512@users.noreply.github.com>
@YihuiLu512
YihuiLu512 requested a review from a team as a code owner December 3, 2026 02:01
@YihuiLu512
YihuiLu512 enabled auto-merge December 3, 2026 02:01
@YihuiLu512

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Kimi K3 processor utility now imports TransformersTokenizer from tensorrt_llm.tokenizer instead of tensorrt_llm.llmapi.tokenizer.

Changes

Tokenizer Import Path

Layer / File(s) Summary
Update tokenizer import
tensorrt_llm/_torch/models/kimi_k3_processor_utils.py
The import path for TransformersTokenizer changes to tensorrt_llm.tokenizer.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Suggested reviewers: 2ez4bz, reasonsolo

Merge Risk: Minimal · up to 19435

This change only updates which module the Kimi K3 processor imports TransformersTokenizer from, so runtime behavior is unchanged. It is a low-risk import-path cleanup and is ready to merge.

Architecture risk: Low · up to 19435

The Kimi K3 processor's module dependency moved from the LLM API tokenizer path to the package-level tokenizer export.

Changed areas: tensorrt_llm

Review details

Systems and components

  • observed — 1 changed file mapped to tensorrt_llm.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the TransformersTokenizer import in kimi_k3_processor_utils moves to tensorrt_llm.tokenizer. It follows the required [TICKET][type] Summary format. The title matches the on…
Description check Passed The description covers the problem, the fix, and test coverage. It explains the layering contract failure between PR #23084 and PR #23145, the one-line import change, and the local before and after te…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: the TransformersTokenizer import in kimi_k3_processor_utils moves to tensorrt_llm.tokenizer. It follows the required [TICKET][type] Summary format. The title matches the one-line diff in the raw summary and the author's stated intent.

Full details: Description check

Explanation

The description covers the problem, the fix, and test coverage. It explains the layering contract failure between PR #23084 and PR #23145, the one-line import change, and the local before and after test results. It also lists the pre-commit checks and the CI job that covers the test. The template's Description and Test Coverage sections are filled in. The PR Checklist has only the final box checked. The description does not state API impact, which the checklist asks about. This gap is minor because the change does not alter any API.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ed9650f and 194351d.

Files selected for processing: 1

  • tensorrt_llm/_torch/models/kimi_k3_processor_utils.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88778 [ run ] triggered by Bot. Commit: 194351d Link to invocation

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88778 [ run ] completed with state SUCCESS. Commit: 194351d
/LLM/main/L0_MergeRequest_PR pipeline #73745 completed with status: 'SUCCESS'

CI Report

⚠️ Resource Maintenance — Test Coverage Reduced:

Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #10910: AWS-PDX-SLURM-1 is unavailable for maintenance on 2026-12-02 17:00-23:00 UTC; H100_PCIe-PyTorch-Perf-1 was retired from main.
Affected stages:
DGX_B300-PyTorch-1
DGX_B300-PyTorch-2
DGX_B300-PyTorch-3
DGX_B300-PyTorch-4

Link to invocation

@YihuiLu512
YihuiLu512 added this pull request to the merge queue Dec 3, 2026
Merged via the queue into NVIDIA:main with commit e9be04b Dec 3, 2026
22 of 23 checks passed
@YihuiLu512
YihuiLu512 deleted the fix/kimi-k3-layering-import branch December 3, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants