Skip to content

[WIP] Resize/pad VL decode works#4370

Draft
hengtaoguo wants to merge 1 commit into
mainfrom
hengtaoguo-sft-video
Draft

[WIP] Resize/pad VL decode works#4370
hengtaoguo wants to merge 1 commit into
mainfrom
hengtaoguo-sft-video

Conversation

@hengtaoguo

@hengtaoguo hengtaoguo commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Dynamic resize and pad to (32, 32, 32) grid -> (32s, 512pix, 512pix)

Tests

# Decode
python -m maxtext.inference.decode maxtext/configs/base.yml tokenizer_type=huggingface model_name=qwen3-vl-2b tokenizer_path=Qwen/Qwen3-VL-2B-Instruct load_parameters_path=gs://hengtaoguo-maxtext-logs/checkpoints/qwen3-vl-2b/unscanned/2026-07-01-11-55/0/items per_device_batch_size=1 run_name=ht_test scan_layers=false use_multimodal=true prompt=\'What\ is\ the\ classification\ of\ the\ single\ exhibit\ in\ this\ video\?\' video_path=\'tests/assets/test_video.mp4\' max_prefill_predict_length=1240 max_target_length=1280 ici_tensor_parallelism=4 override_model_config=true video_max_grid_t=32 video_max_grid_h=32 video_max_grid_w=32 attention=\'dot_product\' hf_access_token=xxx

# Result
DEBUG TRACE: inputs.shape = (1, 32768, 16, 64), cos_emb.shape = (32768, 64)

Input `<|im_start|>user
<|vision_start|><|video_pad|><|vision_end|>What is the classification ofthe single exhibit in this video?<|im_end|>
<|im_start|>assistant
` -> `The exhibit in the video is a **dinosaur**. More specifically, it is a **model of a multi-headed dinosaur**, which is a type of **dinosaur exhibit**. The exhibit is likely`

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

@hengtaoguo hengtaoguo force-pushed the hengtaoguo-sft-video branch from 0c6e519 to 48b758c Compare July 7, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant