This repository was archived by the owner on Sep 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 245
Add Intel XPU device support to generate and serve #1361
Merged
Merged
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
778efd6
add xpu
jenniew 7c4e42b
add xpu device
jenniew 6ed3cda
update
jenniew 6e73400
Merge branch 'main' of https://github.com/pytorch/torchchat into xpu_…
jenniew 4735bff
Merge branch 'main' into xpu_device
Jack-Khuu 6ef7cd5
merge
jenniew 4d16351
Merge branch 'xpu_device' of https://github.com/jenniew/torchchat int…
jenniew 11222dd
update
songhappy 20e3eae
profile
songhappy 5e0b073
merge
songhappy 069d393
merge
songhappy c0530d0
Merge branch 'main' of https://github.com/pytorch/torchchat into xpu_…
songhappy ab61f0f
update install
songhappy 9f4cde3
update
songhappy 5c3306e
update
songhappy 30a38ec
update
jenniew b784239
Merge branch 'main' of https://github.com/pytorch/torchchat into xpu_…
jenniew 8edfeb2
Merge branch 'main' into xpu_device
Jack-Khuu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,12 @@ fi | |
| # NOTE: If a newly-fetched version of the executorch repo changes the value of | ||
| # PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary | ||
| # package versions. | ||
| PYTORCH_NIGHTLY_VERSION=dev20241002 | ||
| if [[ -x "$(command -v xpu-smi)" ]]; | ||
| then | ||
| PYTORCH_NIGHTLY_VERSION=dev20241001 | ||
| else | ||
| PYTORCH_NIGHTLY_VERSION=dev20241002 | ||
| fi | ||
|
|
||
| # Nightly version for torchvision | ||
| VISION_NIGHTLY_VERSION=dev20241002 | ||
|
|
@@ -70,16 +75,28 @@ then | |
| elif [[ -x "$(command -v rocminfo)" ]]; | ||
| then | ||
| TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/rocm6.2" | ||
| elif [[ -x "$(command -v xpu-smi)" ]]; | ||
| then | ||
| TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/xpu" | ||
| else | ||
| TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cpu" | ||
| fi | ||
|
|
||
| # pip packages needed by exir. | ||
| REQUIREMENTS_TO_INSTALL=( | ||
| torch=="2.6.0.${PYTORCH_NIGHTLY_VERSION}" | ||
| torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}" | ||
| torchtune=="0.4.0.${TUNE_NIGHTLY_VERSION}" | ||
| ) | ||
| if [[ -x "$(command -v xpu-smi)" ]]; | ||
| then | ||
| REQUIREMENTS_TO_INSTALL=( | ||
| torch=="2.6.0.${PYTORCH_NIGHTLY_VERSION}" | ||
| torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}" | ||
| torchtune=="0.3.1" | ||
|
||
| ) | ||
| else | ||
| REQUIREMENTS_TO_INSTALL=( | ||
| torch=="2.6.0.${PYTORCH_NIGHTLY_VERSION}" | ||
| torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}" | ||
| torchtune=="0.4.0.${TUNE_NIGHTLY_VERSION}" | ||
| ) | ||
| fi | ||
|
|
||
| # Install the requirements. --extra-index-url tells pip to look for package | ||
| # versions on the provided URL if they aren't available on the default URL. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does xpu need an older PYTORCH_NIGHTLY?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when install torch==2.6.0.dev20241002 and torchvision==0.20.0.dev20241002+xpu, it will get error:
ERROR: Cannot install torch==2.6.0.dev20241002 and torchvision==0.20.0.dev20241002+xpu because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested torch==2.6.0.dev20241002
torchvision 0.20.0.dev20241002+xpu depends on torch==2.6.0.dev20241001
So for xpu, I changed the torch nightly version to dev20241001
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me see if I can get you a fresher version on XPU, the torch/vision discrepancy shouldn't be a normal thing