Fix Hunyuan-VL PIL image resize parity with reference preprocessing#47233
Conversation
zucchini-nlp
left a comment
There was a problem hiding this comment.
yeah, we defi need to fix this now that the model is released! I will trigger slow CI, since I had no time to check what type of "difference from baseline implementation" there was
|
run-slow: hunyuan_vl |
|
This comment contains models: ["models/hunyuan_vl"] |
|
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. |
CI ResultsCommit Info
The test failure analysis could not be completed. Please check the workflow run for details. |
|
Oh right, slow tests are failing in main as well, though the error messages look different. Can you check locally @IMvision12 ? |
|
@zucchini-nlp Yeah, I checked locally on GPU and the same slow Hunyuan-VL test fails because the generated text snapshot changed after the PIL image preprocessing update. I updated the expected |
|
Thank you for your contribution 🤗! CI Security Gate — automatic approval blockedThis PR was not automatically approved for CI because the security gate failed. Possible reasons:
See the workflow run for the exact violations. A maintainer can review and manually approve CI if a finding is a false positive. |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: hunyuan_vl |
|
@zucchini-nlp can you again run the slow test? |
CI recapDashboard: View test results in Grafana |
|
run-slow: hunyuan_vl |
|
This comment contains models: ["models/hunyuan_vl"] |
|
@zucchini-nlp any updates from Hunyuan team? |
|
Nope, silence from their side. Let's merge and I'll revert hardcoding if they decide to update hub configs |
* upstream/main: (39 commits) Remove deprecated training args and `is_fast` property (huggingface#46917) Consistent output shape from `get_image_features` (huggingface#46405) Fix multi-device mxfp4 dequantization race in `_convert_moe_packed_tensors` (huggingface#47423) fix failed test cases for qwen3_omni_moe model (huggingface#47449) Fix Hunyuan-VL PIL image resize parity with reference preprocessing (huggingface#47233) Move `value` padding into the attention interfaces that need it (huggingface#47451) Simplify function dispatch for linear attention (huggingface#47450) [cache] Allow sliding window layers to be roll-backed for speculative decoding (huggingface#47447) Fix double-shifted training loss in GitForCausalLM (huggingface#47395) Fix CohereASR training-loss double-shift (same as Moonshine fix huggingface#46784) (huggingface#46895) Warn when `group_by_length` is silently ignored for iterable datasets (huggingface#47379) Update bug report list (huggingface#46607) Fix shape mismatch in KyutaiSpeechToText `generate()` last window (huggingface#46952) Optimize flash attention max seqlen computation in vision attention (huggingface#47170) fix: remove unreachable return in special token builder (huggingface#47420) Add Harry to slow CI (huggingface#47454) BLT: vectorize patch length processing (huggingface#47385) Fix `TrackioCallback` fails to log evaluation metrics after training ends (huggingface#46935) [Kimi] add integration tests (huggingface#47383) Fix typo in `MusicgenForCausalLM.generate()` (huggingface#46974) ...
This PR removes the manual PIL resize workaround from the Hunyuan-VL PIL image processor and routes resizing through the shared processor backend.
The previous code manually converted numpy images to PIL, called
PIL.Image.resize(...), then converted back to numpy because the shared resize path produced degraded results. The difference came from the default resize method: plain PIL resize matches bicubic behavior here, while the shared path was falling back to bilinear whenresample=None.This PR preserves the original HunyuanOCR preprocessing behavior by defaulting Hunyuan-VL PIL resize to
PILImageResampling.BICUBICwhen noresamplevalue is provided.Tests