-
Notifications
You must be signed in to change notification settings - Fork 60
Add Intel Arc XPU backend support #443
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
Open
LaNataliaaa
wants to merge
1
commit into
Haidra-Org:main
Choose a base branch
from
LaNataliaaa:feat/intel-arc-xpu-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| name: ldm | ||
| channels: | ||
| - conda-forge | ||
| - defaults | ||
| # Minimal environment for Intel XPU. PyTorch and the rest of the stack are installed with pip. | ||
| dependencies: | ||
| - git | ||
| - pip | ||
| - python==3.11 |
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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/bin/bash | ||
| # Get the directory of the current script | ||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
|
||
| # Build the absolute path to the Conda environment | ||
| CONDA_ENV_PATH="$SCRIPT_DIR/conda/envs/linux/lib" | ||
|
|
||
| # Add the Conda environment to LD_LIBRARY_PATH | ||
| export LD_LIBRARY_PATH="$CONDA_ENV_PATH:$LD_LIBRARY_PATH" | ||
|
|
||
| # List of directories to check | ||
| dirs=( | ||
| "/usr/lib" | ||
| "/usr/local/lib" | ||
| "/lib" | ||
| "/lib64" | ||
| "/usr/lib/x86_64-linux-gnu" | ||
| ) | ||
|
|
||
| # Check each directory | ||
| for dir in "${dirs[@]}"; do | ||
| if [ -f "$dir/libjemalloc.so.2" ]; then | ||
| export LD_PRELOAD="$dir/libjemalloc.so.2" | ||
| printf "Using jemalloc from $dir\n" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| # If jemalloc was not found, print a warning | ||
| if [ -z "$LD_PRELOAD" ]; then | ||
| printf "WARNING: jemalloc not found. You may run into memory issues! We recommend running 'sudo apt install libjemalloc2'\n" | ||
| read -n 1 -s -r -p "Press q to quit or any other key to continue: " key | ||
| if [ "$key" = "q" ]; then | ||
| printf "\n" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| XPU_ARGS=(--xpu) | ||
| if [ -n "${ONEAPI_DEVICE_SELECTOR:-}" ]; then | ||
| XPU_ARGS+=("--oneapi-device-selector=${ONEAPI_DEVICE_SELECTOR}") | ||
| printf "Using ONEAPI_DEVICE_SELECTOR=%s\n" "$ONEAPI_DEVICE_SELECTOR" | ||
| fi | ||
|
|
||
| if "$SCRIPT_DIR/runtime-xpu.sh" python -s "$SCRIPT_DIR/download_models.py" "${XPU_ARGS[@]}"; then | ||
| echo "Model Download OK. Starting worker..." | ||
| "$SCRIPT_DIR/runtime-xpu.sh" python -s "$SCRIPT_DIR/run_worker.py" "${XPU_ARGS[@]}" "$@" | ||
| else | ||
| echo "download_models.py exited with error code. Aborting" | ||
| fi |
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.
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.
The nested bullets under “Run
update-runtimefor your OS…” are mis-indented, so the Markdown list renders inconsistently (the “Not all updates…” and “Advanced users…” bullets don’t align under step 4). Align the indentation so these remain sub-bullets of step 4.