Skip to content

[https://nvbugs/7054722][fix] Pin sentencepiece below 0.2.3 - #21790

Merged
weiminwang-nv merged 3 commits into
NVIDIA:mainfrom
weiminwang-nv:fix/pin-sentencepiece-below-0.2.3
Nov 10, 2026
Merged

weiminwang-nv merged 3 commits into
NVIDIA:mainfrom
weiminwang-nv:fix/pin-sentencepiece-below-0.2.3

Conversation

@weiminwang-nv

@weiminwang-nv weiminwang-nv commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

requirements.txt constrains sentencepiece to >=0.1.99,<0.2.3. Comments explain that version 0.2.3 requires protobuf >=7.36.1, which conflicts with the current protobuf<7 constraint. The comments state that the sentencepiece cap should be lifted only after the protobuf floor reaches 7.36.1. The protobuf constraint did not change. Review findings: not available.

QA Engineer Review

No test changes.

Per-File QA Perspective

  • requirements.txt: Verify dependency resolution with the sentencepiece cap and current protobuf constraint. The reported mBART test waiver was not changed in this diff.

Description

Since 2026-11-05, llmapi/test_llm_api_pytorch_bart.py::test_mbart_pytorch_generate_encoder_decoder_end_to_end fails on L40S on both main and release/1.3 (https://nvbugs/7054722):

ValueError: Error parsing line b'\x0e' in /scratch.trt_llm_data/llm-models/mbart-large-50-many-to-one-mmt/sentencepiece.bpe.model

Root cause: sentencepiece 0.2.3 was released on PyPI on 2026-11-05. Its sentencepiece_model_pb2.py is generated by protobuf 7.36.1, but requirements.txt pins protobuf>=6.30.2,<7, so the import fails:

google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading sentencepiece_model.proto: gencode 7.36.1 runtime 6.33.6. Runtime version cannot be older than the linked gencode version.

transformers then falls back to the tiktoken converter. That converter cannot parse the binary sentencepiece.bpe.model, so it raises the ValueError above. sentencepiece 0.2.2 ships an older generated file with no runtime version check, so it works with protobuf 6.

Changes:

  • Pin sentencepiece>=0.1.99,<0.2.3 in requirements.txt. 0.2.3 does not declare a protobuf requirement, so pip cannot resolve around it. Add a note at the protobuf pin so the two caps are lifted together.
  • Keep the waiver for the mbart test (added in [None][infra] Waive 1 failed cases for main in pre-merge 68497 #21771) for now. PR pipelines test the PR head with its own requirements.txt, so open PRs that branched before the waiver landed would fail this test again if the waiver were removed here. I will remove it in a follow-up PR once the cap has been on main for a few days.

release/1.3 has the same requirements and will likely need the same fix.

Note: I skipped the openengine-bindings-check pre-commit hook locally because grpcio 1.67.1 does not build on my machine (Python 3.14 on macOS). That hook only reads the protobuf and grpcio lines of requirements.txt, which this PR does not change. All other hooks passed.

Test Coverage

  • llmapi/test_llm_api_pytorch_bart.py::test_mbart_pytorch_generate_encoder_decoder_end_to_end (L40S-PyTorch-1/2, pre-merge). The cap was checked on the first commit (f286c55), which also removed the waiver, with /bot run --stage-list "L40S-PyTorch-1, L40S-PyTorch-2".

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

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

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

🤖 Generated with Claude Code

…ve mbart test

sentencepiece 0.2.3 (released 2026-11-05) ships sentencepiece_model_pb2.py
generated by protobuf 7.36.1. requirements.txt pins protobuf<7, so importing
it fails with a protobuf VersionError. transformers then falls back to
tiktoken, which cannot parse sentencepiece.bpe.model, and the mbart test
fails with "ValueError: Error parsing line b'\x0e'".

Pin sentencepiece below 0.2.3 and remove the waiver for the mbart test.

Signed-off-by: Weimin Wang <[email protected]>
@weiminwang-nv
weiminwang-nv requested a review from a team as a code owner November 6, 2026 07:55
@weiminwang-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "L40S-PyTorch-1, L40S-PyTorch-2"

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The sentencepiece requirement now has an upper bound of <0.2.3. Comments describe its compatibility link to the protobuf <7 runtime and when to reconsider the cap.

Changes

Dependency Constraint

Layer / File(s) Summary
Constrain sentencepiece versions
requirements.txt
The requirement now sets sentencepiece to >=0.1.99,<0.2.3. Comments state that versions 0.2.3 and later include protobuf 7.36.1 generated code, which is incompatible with the configured protobuf <7 runtime. They also state that the cap should be reconsidered when the protobuf floor reaches 7.36.1.

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

Change: Bug fix

Suggested reviewers: yuanjingx87

Merge Risk: Minimal · up to 897b6

This change pins sentencepiece below a release that is incompatible with the repository's protobuf pin. It restores working tokenizer loading and carries no identified merge-blocking risk.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the NVBugs ID and type tag, then states the change: pinning sentencepiece below 0.2.3. This matches the main change in the changeset, which adds the sentencepiece cap to requirements.t…
Description check Passed The description covers the problem, root cause, the requirements.txt change, the reason the mBART waiver stays, and the test coverage. It also explains the skipped pre-commit hook. The template's Desc…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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 NVBugs ID and type tag, then states the change: pinning sentencepiece below 0.2.3. This matches the main change in the changeset, which adds the sentencepiece cap to requirements.txt. The title follows the repository template format.

Full details: Description check

Explanation

The description covers the problem, root cause, the requirements.txt change, the reason the mBART waiver stays, and the test coverage. It also explains the skipped pre-commit hook. The template's Description, Test Coverage, and PR Checklist sections are all present and filled in. The Description section restates the issue and fix in detail, which goes beyond the template's short-form request but does not leave any required element missing. The author also ticked the checklist box. The description does not state that the 'Test Coverage' test ran on the head commit, but it names the stage and commit, so the claim is verifiable.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

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 c6c664c and 897b670.

Files selected for processing: 1

  • requirements.txt
Files skipped from review as they are similar to previous changes: 1

  • requirements.txt

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 #83065 [ run ] triggered by Bot. Commit: f286c55 Link to invocation

@sunnyqgg sunnyqgg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick root-cause. I checked it, and the pin itself is right. sentencepiece 0.2.3's sentencepiece_model_pb2.py is protobuf 7.36.1 gencode, and its runtime version check fails under protobuf<7; 0.2.2 has no such check. <0.2.3 (rather than !=0.2.3) is right because upstream master still ships 7.36.1 gencode. CI installs requirements.txt through requirements-dev.txt, so the cap takes effect there. Findings: 1 blocker, 0 possibly blocking, 1 required, 2 nice to have. No pre-merge pipeline has run on f286c55 yet.

  • [Required] release/1.3: the description says nvbug 7054722 also fails there. release/1.3 has the same sentencepiece>=0.1.99, protobuf>=6.30.2,<7 and transformers==5.5.4 (requirements.txt:25,112,41 on that branch), and its l0_l40s.yml:43 still lists the mbart test. CONTRIBUTING.md asks NVIDIA developers to "submit feature or bug fixes to the dedicated branch specified in the nvbug Keywords field". Please confirm which branch the nvbug targets, and open and link the release/1.3 counterpart (the same two lines) or a cherry-pick, so the bug isn't closed while 1.3 still fails.

Comment thread tests/integration/test_lists/waives.txt Resolved
Comment thread requirements.txt Resolved
Comment thread requirements.txt Resolved
…ece cap comment

Address review feedback:
- Keep the waiver for the mbart test. Open PRs that branched before the
  waiver landed run their own requirements.txt without the cap, so removing
  the waiver now would make the test fail again for them. Remove it in a
  follow-up PR once the cap has been on main for a few days.
- Reword the sentencepiece comment: 0.2.3 does not declare a protobuf
  requirement, and its gencode needs protobuf>=7.36.1. Add a note at the
  protobuf pin so the two caps are lifted together.

Signed-off-by: Weimin Wang <[email protected]>
@weiminwang-nv weiminwang-nv changed the title [https://nvbugs/7054722][fix] Pin sentencepiece below 0.2.3 and unwaive mbart test [https://nvbugs/7054722][fix] Pin sentencepiece below 0.2.3 Nov 6, 2026
@weiminwang-nv

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. In c6c664c I kept the mbart waiver and will remove it in a follow-up once the cap has been on main for a few days. I also updated the comment as you suggested and added a note at the protobuf pin. I'll leave the CPU import test and the release/1.3 change out of this PR.

@sunnyqgg sunnyqgg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review on c6c664c: 0 Blockers, 0 possibly blocking, 2 Required, 2 Nice to have. The earlier Blocker is fixed: the PR no longer touches waives.txt, and the mbart waive stays at tests/integration/test_lists/waives.txt:166. The cap works: in the stage-list run on f286c55 (L0_Test-x86_64-Single-GPU #10533, L40S-PyTorch-1), pip resolved sentencepiece<0.2.3,>=0.1.99 to 0.2.2 against the image's protobuf 6.33.6, and test_mbart_pytorch_generate_encoder_decoder_end_to_end passed. c6c664c has not run CI yet.

  • [Required] release/1.3 (raised in the earlier review, still open): nvbug 7054722 is filed against Main with empty Keywords, so targeting main here is right. But the bug's CI-report comment shows LLM/release-1.3/L0_PostMerge #53 (L40S-PyTorch-1) failing the same mbart test, and release/1.3 still has sentencepiece>=0.1.99 and protobuf>=6.30.2,<7 (requirements.txt:25,112) and no waive for it. There is no release/1.3 PR for this yet. Please open the release/1.3 counterpart (the same requirements.txt lines) and link it here, or clone the nvbug for 1.3, so the bug is not closed by this PR while 1.3 still fails.
  • [Nice to have] CI coverage of the cap (raised in the earlier review, still open): with the waive kept, nothing in CI exercises the cap until the follow-up removes it. The mbart test is the CI test that caught this (#21771 waived only that case), and import sentencepiece alone does not load sentencepiece_model_pb2; only transformers' slow-to-fast tokenizer conversion does. A tiny cpu_only test under tests/unittest/others/ (the whole directory is in l0_cpu.yml) that does from sentencepiece import sentencepiece_model_pb2 would cover it; otherwise please remove the waive soon after this lands.

Comment thread requirements.txt Resolved
Comment thread requirements.txt Resolved
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83065 [ run ] completed with state SUCCESS. Commit: f286c55
/LLM/main/L0_MergeRequest_PR pipeline #68619 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

…sentencepiece cap note

sentencepiece 0.2.3 gencode calls ValidateProtobufRuntimeVersion(PUBLIC, 7, 36, 1),
which also rejects 7.34 through 7.36.0 runtimes. Removing the protobuf <7 cap is
not enough; the sentencepiece cap can only go once the protobuf floor reaches
7.36.1.

Signed-off-by: Weimin Wang <[email protected]>
@weiminwang-nv

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83326 [ run ] triggered by Bot. Commit: 897b670 Link to invocation

@github-actions

github-actions Bot commented Nov 9, 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 #83326 [ run ] completed with state SUCCESS. Commit: 897b670
/LLM/main/L0_MergeRequest_PR pipeline #68864 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@weiminwang-nv

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "Only requirements.txt changes. Fix verified in L0_MergeRequest_PR #68619"

@weiminwang-nv
weiminwang-nv enabled auto-merge (squash) November 10, 2026 01:37
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83597 [ skip ] triggered by Bot. Commit: 897b670 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #83597 [ skip ] completed with state SUCCESS. Commit: 897b670
Skipping testing for commit 897b670

Link to invocation

@weiminwang-nv
weiminwang-nv merged commit b2f659a into NVIDIA:main Nov 10, 2026
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.

5 participants