[QUESTION] I found that the Huggingface Tokenizer cannot be selected in Date Preprocessing. Is this intentional or a bug? #1019
Replies: 1 comment
-
|
This is generally intentional rather than a bug, and it comes down to how TensorRT-LLM separates concerns between data preprocessing, tokenizer ownership, and engine portability. 1. Why HuggingFace tokenizer is not selectable in “Data Preprocessing”In TensorRT-LLM pipelines, the preprocessing stage is designed to be:
So instead of directly using HuggingFace
2. Why HuggingFace tokenizer is avoided🔴 A. Dependency isolationHF tokenizers bring:
TensorRT-LLM prefers:
🔴 B. Determinism + deployment consistencyHuggingFace tokenizers can vary across:
TensorRT-LLM avoids this by requiring:
🔴 C. Engine portability requirementTensorRT-LLM engines are designed to be:
So preprocessing must be:
3. What TensorRT-LLM expects insteadTypically supported formats: ✔ SentencePiece tokenizer
✔ HuggingFace exported tokenizer files
BUT NOT the HF tokenizer class itself. ✔ Pre-tokenized inputs (common in benchmarking)You can bypass tokenizer entirely: 4. Is HF tokenizer support ever used internally?Yes — but only during:
Not in production preprocessing pipelines. 5. Why this feels like a “missing feature”Many users expect: AutoTokenizer.from_pretrained(...)to be part of inference stack, but TensorRT-LLM intentionally splits:
6. When this is NOT a bugIt is intentional if:
7. When it might be a limitationIt could be considered a limitation if:
But even then, TensorRT-LLM intentionally avoids coupling. 8. Recommended workflow✔ Option A (production)✔ Option B (benchmarking)✔ Option C (dev / hybrid)Use HF tokenizer separately: tokens = tokenizer(text)
engine.run(tokens)9. Bottom line
If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I found that the Huggingface Tokenizer cannot be selected in Date Preprocessing. Is this intentional or a bug?
Beta Was this translation helpful? Give feedback.
All reactions