Replies: 1 comment
-
|
This symptom — engine runs but outputs a repeated character / looped token — is a classic sign that the model is technically converted but not semantically compatible with the expected LLaMA-style assumptions in TensorRT-LLM. 1. Why Yi models “convert successfully” but fail at runtimeYi models (01.AI Yi series) are LLaMA-like, but not identical. Even if conversion scripts succeed, small architectural differences can break generation. Common mismatches: 🔴 A. Tokenizer mismatch (most common cause)If:
👉 Result:
🔴 B. RoPE / positional encoding differencesYi models may use:
If TensorRT-LLM treats it as vanilla LLaMA: 👉 attention becomes unstable → repetitive decoding 🔴 C. RMSNorm / layer norm subtle differencesEven small changes in:
can cause: 👉 logits collapse → model outputs same token repeatedly 🔴 D. Weight mapping “looks correct but is not”The conversion script may:
So engine builds fine, but behavior is wrong. 2. Why repeated characters happen specificallyThis pattern: usually means: ❗ logits collapseThe model output distribution becomes extremely peaked:
This is almost always caused by:
3. Why “conversion succeeds” is misleadingTensorRT-LLM conversion scripts: ✔ only check structural compatibility So:
4. What is likely wrong in Yi → LLaMA conversionYi models typically require attention to: ✔ Correct config differences:Check:
✔ Correct model type mappingYi is “LLaMA-like”, but not always:
5. How to fix or debug✔ Step 1: verify tokenizerRun HF model directly:
If NOT → TRT-LLM is not the issue ✔ Step 2: compare config.jsonCompare:
Look for:
✔ Step 3: test FP16 baselineBefore TRT conversion:
Then:
✔ Step 4: disable sampling issuesSometimes repetition is exaggerated by:
Try:
6. Why Yi support is tricky in TRT-LLMYi models are:
TensorRT-LLM converters assume:
So even small deviations break correctness. 7. 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.
-
when I used the llama convert script convert Yi model, It converted successfully, but the engine did not work normally. the output is a character repeatedly
Beta Was this translation helpful? Give feedback.
All reactions