Skip to content

[WIP]🚨 set dtype=float16 for CPU as well #266

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

prashantgupta24
Copy link
Collaborator

@prashantgupta24 prashantgupta24 commented Jun 27, 2025

Description

Use float16 for CPU to try and speed tests

Related Issues

Copy link

👋 Hi! Thank you for contributing to vLLM support on Spyre.
Just a reminder: Make sure that your code passes all the linting checks, otherwise your PR won't be able to be merged. To do so, first install the linting requirements, then run format.sh and commit the changes. This can be done with uv directly:

uv sync --frozen --group lint --active --inexact

Or this can be done with pip:

uv pip compile --group lint > requirements-lint.txt
pip install -r requirements-lint.txt
bash format.sh

Now you are good to go 🚀

@prashantgupta24 prashantgupta24 changed the title 🚨 set dtype=float16 for CPU as well [WIP]🚨 set dtype=float16 for CPU as well Jun 27, 2025
@prashantgupta24 prashantgupta24 marked this pull request as draft June 27, 2025 19:04
@prashantgupta24 prashantgupta24 force-pushed the float16 branch 2 times, most recently from bc83e4b to 3190d8d Compare June 27, 2025 20:34
tjohnson31415 and others added 4 commits July 1, 2025 09:47
Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com>
Signed-off-by: Prashant Gupta <prashantgupta@us.ibm.com>
Signed-off-by: Prashant Gupta <prashantgupta@us.ibm.com>
Signed-off-by: Prashant Gupta <prashantgupta@us.ibm.com>
@@ -228,7 +229,8 @@ def generate_hf_output(
if not isinstance(max_new_tokens, list):
max_new_tokens = [max_new_tokens] * len(prompts)

hf_model = AutoModelForCausalLM.from_pretrained(model)
hf_model = AutoModelForCausalLM.from_pretrained(model,
torch_dtype=torch.float16)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure if this should be float16 or bfloat16

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.

2 participants