Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable QA bf16 pipeline #34483

Merged
merged 3 commits into from
Oct 31, 2024
Merged

enable QA bf16 pipeline #34483

merged 3 commits into from
Oct 31, 2024

Conversation

jiqing-feng
Copy link
Contributor

Hi @SunMarc @ArthurZucker

The same issue as #31625 . Numpy can only process fp32 data type but the input tensor could be bf16/fp16 based on the model's dtype. Please review it, thx!

@jiqing-feng
Copy link
Contributor Author

The issue can be reproduced by:

import torch
from transformers import pipeline

question = "How many programming languages does BLOOM support?"
context = "BLOOM has 176 billion parameters and can generate text in 46 languages natural languages and 13 programming languages."

question_answerer = pipeline("question-answering", model="bert-large-uncased-whole-word-masking-finetuned-squad", torch_dtype=torch.bfloat16)
out = question_answerer(question=question, context=context)

@jiqing-feng
Copy link
Contributor Author

Hi @Rocketknight1 , could you please review this PR ? Thx!

Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Yes, good fix, and thank you for the clean reproducer!

@Rocketknight1
Copy link
Member

Merging without core maintainer review since this is a straightforward pipeline dtype fix that shouldn't have any side effects

@Rocketknight1 Rocketknight1 merged commit f385316 into huggingface:main Oct 31, 2024
26 checks passed
@HuggingFaceDocBuilderDev

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.

BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* enable QA bf16 pipeline

* add tests
@jiqing-feng jiqing-feng deleted the falcon branch December 19, 2024 02:02
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