fix(flaky): test_generate_with_and_without_position_ids in GLM ORC#44173
fix(flaky): test_generate_with_and_without_position_ids in GLM ORC#44173tarekziade merged 8 commits intomainfrom
test_generate_with_and_without_position_ids in GLM ORC#44173Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
run-slow: glm_ocr |
|
This comment contains models: ["models/glm_ocr"] |
Changes: 1. src/transformers/models/glm_ocr/modeling_glm_ocr.py:1431 - In prepare_inputs_for_generation, normalize user-provided 2D position_ids into packed multimodal format. - On cache continuation, only reuse rope_deltas when cache length is non-zero (fixes stale-delta reuse across sequential generate() calls). 2. tests/models/glm_ocr/test_modeling_glm_ocr.py:166 - Avoid random accidental pad tokens in synthetic input IDs by remapping pad_token_id in random portions (0 -> 1), reducing test instability from pad-derived masks.
7d35dff to
893ab53
Compare
|
[For maintainers] Suggested jobs to run (before merge) run-slow: glm_ocr |
|
run-slow: glm_ocr |
|
This comment contains models: ["models/glm_ocr"] |
…rate_with_and_without_position_ids`
|
run-slow: glm_ocr now, glm4v, glm46v, glm_image, qwen2_vl, qwen2_5_vl, qwen2_5_omni, qwen3_vl, qwen3_vl_moe, qwen3_5, qwen3_5_moe, qwen3_omni_moe, paddleocr_vl, ernie4_5_vl_moe, glm4v_moe |
|
run-slow: glm_ocr, glm4v, glm46v, glm_image, qwen2_vl, qwen2_5_vl, qwen2_5_omni, qwen3_vl, qwen3_vl_moe, qwen3_5, qwen3_5_moe, qwen3_omni_moe, paddleocr_vl, ernie4_5_vl_moe, glm4v_moe |
|
note that the idefics failure is yet another different flake I will fix in a separate branch |
|
run-slow: glm_ocr, glm4v, glm46v |
| if has_3d_rope_positions: | ||
| continue |
There was a problem hiding this comment.
nit: we can skip right away because usually all models in the set will be the same arch
|
This comment contains models: ["models/glm46v", "models/glm4v", "models/glm_ocr"] |
Fixes flaky GLM OCR generation behavior when 2D
position_idsare passed explicitly.Reproducible locally with:
Fix
We skip 2D from
GenerationTesterMixin.test_generate_with_and_without_position_idswhen model usesget_rope_index15 models impacted