Skip to content

[bugfix]: fix VLM MFU miscomputation - #4057

Open
gtnv wants to merge 3 commits into
pytorch:mainfrom
gtnv:fix/vlm-mfu-miscomputation
Open

[bugfix]: fix VLM MFU miscomputation#4057
gtnv wants to merge 3 commits into
pytorch:mainfrom
gtnv:fix/vlm-mfu-miscomputation

Conversation

@gtnv

@gtnv gtnv commented Aug 3, 2026

Copy link
Copy Markdown

Closes #4009.

Currently, VLM TFLOPs and MFU are reported from decoder FLOPs alone, so vision-encoder work is missing.

this pr adds per-batch vision FLOPs from grid_thw for Qwen3.5 and Kimi2.5. Then accumulates them over each logging window and then adds them to the existing decoder estimate.

Testing

Ran VLM on 8xH100. Ran fixed-seed branch vs upstream runs which matched at every logged loss value. log_freq=3 run matched independent computed FLOPs at every logging bound (max rel error 7.3e-8).

some observations: tflops/mfu increased by the missing vision work. qwen mem peak was identical and tps stayed within bounds.

test plots image image image

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 3, 2026
@pytorch-bot

pytorch-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/8gpu

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@tianyu-l
tianyu-l requested a review from shuhuayu August 5, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VLM MFU is miscomputed: vision-encoder FLOPs billed per decoder token, not per image patch

1 participant