Skip to content

Enable XPU doc #38929

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

Merged
merged 17 commits into from
Jun 30, 2025
Merged

Enable XPU doc #38929

merged 17 commits into from
Jun 30, 2025

Conversation

jiqing-feng
Copy link
Contributor

Hi @SunMarc . This PR enables XPU torchao example in the doc, and also fixed a minor bug on the doc. Please review it. Thanks!

@jiqing-feng jiqing-feng marked this pull request as ready for review June 20, 2025 07:29
@github-actions github-actions bot requested a review from stevhliu June 20, 2025 07:29
@jiqing-feng jiqing-feng marked this pull request as draft June 20, 2025 08:06
@jiqing-feng
Copy link
Contributor Author

Convert this PR to draft mode for verifying FP8.

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
@jiqing-feng jiqing-feng marked this pull request as ready for review June 25, 2025 03:09
@jiqing-feng jiqing-feng changed the title Enable XPU on torchao doc Enable XPU doc Jun 25, 2025
@@ -175,7 +175,7 @@ processed_chat = processor.apply_chat_template(
add_generation_prompt=True,
tokenize=True,
return_dict=True,
video_fps=32,
video_fps=16,
Copy link
Contributor Author

@jiqing-feng jiqing-feng Jun 25, 2025

Choose a reason for hiding this comment

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

video_fps=32 will cause error: ValueError: When loading the video with fps=32, we computed num_frames=320 which exceeds total_num_frames=300. Check fps or video meta data.. Fixed by reducing video_fps.

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
@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.

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks! cc @MekkCyber for quick review as well please 🙏

Copy link
Contributor

@MekkCyber MekkCyber left a comment

Choose a reason for hiding this comment

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

Thanks a lot for adding this ! left minor nits

@@ -47,7 +47,7 @@ quantized_model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="

tokenizer = AutoTokenizer.from_pretrained(model_name)
input_text = "What are we having for dinner?"
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
input_ids = tokenizer(input_text, return_tensors="pt").to(quantized_model.device.type)
Copy link
Contributor

Choose a reason for hiding this comment

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

do xpu support fp8 (torch.float8_e4m3fn) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've been verified on XPU.

Comment on lines 185 to 186
<hfoption id="int8_dynamic_activation_int8_weight-and-int8_weight_only">

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better to keep the previous version! it's more consize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

jiqing-feng and others added 3 commits June 30, 2025 09:20
@stevhliu stevhliu merged commit 03db270 into huggingface:main Jun 30, 2025
10 checks passed
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.

5 participants