build(deps): constrain tokenizers below 0.23 so CLIP tokenizers construct#4727
Open
pruprakash wants to merge 1 commit into
Open
build(deps): constrain tokenizers below 0.23 so CLIP tokenizers construct#4727pruprakash wants to merge 1 commit into
pruprakash wants to merge 1 commit into
Conversation
Contributor
|
Light review - LGTM Clean, well-justified pin. The override-dependencies entry Minor notes (non-blocking):
Suggested test cases
No perf tests impacted. |
…ruct With prerelease resolution allowed and no upper bound, the lock resolved tokenizers 0.23.0rc0, which renames RobertaProcessing's 'cls' keyword to 'cls_token'. transformers (including current main) still passes cls=, so any CLIPTokenizer construction raises TypeError at __init__ — e.g. FLUX inference fails in FluxInferencePipeline.load_text_encoders. Constrain tokenizers to <0.23 (locks 0.22.2) until transformers adapts to the renamed kwarg. Signed-off-by: Pruthviraj Prakash <pruprakash@nvidia.com>
38c0703 to
4dac481
Compare
Contributor
Author
|
/ok to test 4dac481 |
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.
Summary
FLUX inference crashes on every rank before generation, in
FluxInferencePipeline.load_text_encoderswhen constructing the CLIP tokenizer:Root cause:
[tool.uv]setsprerelease = "allow"andtokenizershad no upperbound, so the lock resolved
tokenizers 0.23.0rc0— a release candidate thatrenames
RobertaProcessing'sclskeyword tocls_token. transformers (includingcurrent main) still passes
cls=, so anyCLIPTokenizerconstruction raises at__init__. This blocks FLUX inference and any other path that builds a CLIP tokenizer.Changes
pyproject.toml: addtokenizers>=0.22.0,<0.23to[tool.uv] override-dependencies(alongside the existing onnx / langchain pins), resolving tokenizers to 0.22.2.
uv.lock: regenerated —tokenizers 0.23.0rc0 → 0.22.2.tests/unit_tests/utils/test_tokenizers_compat.py: regression guard asserting theinstalled
RobertaProcessingaccepts the exact kwargs transformers'CLIPTokenizerpasses (
sep,cls,add_prefix_space,trim_offsets) — fails fast if the lock everdrifts back to a renaming build.
Why this layer (not the prerelease policy or transformers)
prerelease = "allow"is global and intentional (other deps here depend on prerelease /internal wheels); disabling it would churn unrelated resolutions. Scoping the fix to the
one offending package via
override-dependenciesis the surgical, repo-idiomatic move.<0.23, not!=0.23.0rc0: thecls → cls_tokenrename lives in the whole0.23 line, so excluding only the rc would let a future stable
0.23.0reintroduce thecrash. Lift the bound once transformers adopts the renamed kwarg.
pinning tokenizers to the compatible line is the correct lock-side fix.
Verification
RobertaProcessing(sep=…, cls=…, add_prefix_space=…, trim_offsets=…)— RED on
0.23.0rc0(TypeError: unexpected keyword argument 'cls'); GREEN on0.22.2(constructs). This is exactly what the new unit test asserts.
nvcr.io/nvidian/nemo:26.06.01.rc0, EOS): FLUX inference — the failing artifact —runs the full HF→Megatron convert → inference → denoise pipeline to completion and writes an
image with tokenizers
0.22.2(the version this constraint resolves to); it crashed at theCLIP tokenizer load before. (The shipped container venv still bakes
0.23.0rc0; the lock fixtakes effect once a container rebuilds from the updated lock — the e2e confirms
0.22.2isthe correct, working target.)
Reference