Skip to content

fix(afmoe): reduce tokens in test_compile_static_cache to avoid flaky bfloat16 drift#46521

Merged
ydshieh merged 1 commit into
mainfrom
few_tokens
Jun 9, 2026
Merged

fix(afmoe): reduce tokens in test_compile_static_cache to avoid flaky bfloat16 drift#46521
ydshieh merged 1 commit into
mainfrom
few_tokens

Conversation

@ydshieh

@ydshieh ydshieh commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

torch.compile with reduce-overhead + static cache in bfloat16 produces outputs that vary across runs. Switching to float16 makes the compiled outputs consistent across runs, but they differ from the dynamic and static (non-compiled) baselines.

This PR reduce num_tokens_to_generate from 24 to 4 keeps the test within the stable bfloat16 range and eliminates the flakiness observed in CI.

A run to see it was failing

https://github.com/huggingface/transformers/actions/runs/27200489039

A run to see it works now

https://github.com/huggingface/transformers/actions/runs/27207933386

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: afmoe

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

CI Dashboard: View test results in Grafana

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@ydshieh ydshieh merged commit d209460 into main Jun 9, 2026
45 checks passed
@ydshieh ydshieh deleted the few_tokens branch June 9, 2026 14:57
louzongzhi pushed a commit to louzongzhi/transformers that referenced this pull request Jun 10, 2026
… bfloat16 drift (huggingface#46521)

fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
louzongzhi pushed a commit to louzongzhi/transformers that referenced this pull request Jun 10, 2026
… bfloat16 drift (huggingface#46521)

fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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