Skip to content

support multi gpu for golden dataset generation - #222

Merged
rui-ren merged 6 commits into
mainfrom
ruiren/enable-multi-gpu-for-golden-dataset-gen
Apr 27, 2026
Merged

rui-ren merged 6 commits into
mainfrom
ruiren/enable-multi-gpu-for-golden-dataset-gen

Conversation

@rui-ren

@rui-ren rui-ren commented Apr 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

When generating golden dataset for large models, existing command with --device cuda only use 1 gpu and causes OOM issue.

Fixes

Auto detect gpu when generating dataset.

@github-actions

github-actions Bot commented Apr 26, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing a8e4ca2 → c45392e

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 107 107 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 53 53 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 61 61 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 58 58 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 98 98 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 59 59 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 61 61 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 58 58 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 275 275 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 129 129 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 408 408 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

@rui-ren
rui-ren force-pushed the ruiren/enable-multi-gpu-for-golden-dataset-gen branch from 2732f16 to cba4ebc Compare April 26, 2026 01:10
@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

The author of this PR, rui-ren, is not an activated member of this organization on Codecov.
Please activate this user on Codecov to display this PR comment.
Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.
Please don't hesitate to email us at [email protected] with any questions.

@rui-ren
rui-ren marked this pull request as ready for review April 26, 2026 01:24
@rui-ren
rui-ren requested review from a team and Copilot April 26, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for using HuggingFace device_map="auto" (multi-GPU sharding) when generating golden references, by ensuring processor outputs are moved to a concrete torch device instead of the literal "auto" string.

Changes:

  • Update vision-language golden generation to handle --device auto by moving processed inputs to the model’s first parameter device.
  • Avoid calling BatchEncoding.to("auto"), which would otherwise error.

Comment thread scripts/generate_golden.py Resolved
@justinchuby

Copy link
Copy Markdown
Member

Is the copilot comment reasonable?

@rui-ren

rui-ren commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

Is the copilot comment reasonable?

Thank you for your approval.

@rui-ren

rui-ren commented Apr 27, 2026

Copy link
Copy Markdown
Contributor Author

Is the copilot comment reasonable?

Copilot's suggestion is correct, and we need to enable all the data generation to have multiple GPU.

e.g:

_generate_causal_lm
_generate_vision_language
_generate_speech_to_text
_prepare_sppech_to_text
_prepare_speech_language_inputs
_load_speech_language_model
_generate_phi4mm_multimodal

@rui-ren
rui-ren enabled auto-merge (squash) April 27, 2026 20:54
@rui-ren
rui-ren merged commit db0ae40 into main Apr 27, 2026
19 of 20 checks passed
@rui-ren
rui-ren deleted the ruiren/enable-multi-gpu-for-golden-dataset-gen branch April 27, 2026 21:03
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.

3 participants