-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: [CI] Introduce uv to accelerate pip install #9169
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then | ||
| # pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
| pip install -r requirements/tests.txt -i https://mirrors.aliyun.com/pypi/simple/ | ||
| pip install uv | ||
| uv pip install -r requirements/tests.txt | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The migration to |
||
| git config --global --add safe.directory /ms-swift | ||
| git config --global user.email tmp | ||
| git config --global user.name tmp.com | ||
|
|
@@ -20,17 +20,17 @@ if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then | |
| fi | ||
| fi | ||
|
|
||
| pip install -r requirements/framework.txt -U -i https://mirrors.aliyun.com/pypi/simple/ | ||
| pip install decord einops -U -i https://mirrors.aliyun.com/pypi/simple/ | ||
| uv pip install -r requirements/framework.txt -U | ||
| uv pip install decord einops -U | ||
| pip uninstall autoawq -y | ||
| pip install optimum | ||
| pip install diffusers | ||
| pip install "transformers<5.0" | ||
| uv pip install optimum | ||
| uv pip install diffusers | ||
| uv pip install "transformers<5.0" | ||
| # pip install autoawq -U --no-deps | ||
|
|
||
| # test with install | ||
| pip install . | ||
| pip install auto_gptq bitsandbytes deepspeed -U -i https://mirrors.aliyun.com/pypi/simple/ | ||
| uv pip install . | ||
| uv pip install auto_gptq bitsandbytes deepspeed -U | ||
| else | ||
| echo "Running case in release image, run case directly!" | ||
| fi | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -49,6 +49,11 @@ do | |||||
| -e MODEL_TAG_URL=$MODEL_TAG_URL \ | ||||||
| -e MODELSCOPE_API_TOKEN=$MODELSCOPE_API_TOKEN \ | ||||||
| -e PR_CHANGED_FILES=$PR_CHANGED_FILES \ | ||||||
| -e UV_INDEX_URL=$UV_INDEX_URL \ | ||||||
| -e UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL \ | ||||||
| -e UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY \ | ||||||
| -e UV_NO_CACHE=$UV_NO_CACHE \ | ||||||
| -e UV_SYSTEM_PYTHON=$UV_SYSTEM_PYTHON \ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default,
Suggested change
|
||||||
| --workdir=$CODE_DIR_IN_CONTAINER \ | ||||||
| ${IMAGE_NAME}:${IMAGE_VERSION} \ | ||||||
| $CI_COMMAND | ||||||
|
|
@@ -73,6 +78,11 @@ do | |||||
| -e MODEL_TAG_URL=$MODEL_TAG_URL \ | ||||||
| -e MODELSCOPE_API_TOKEN=$MODELSCOPE_API_TOKEN \ | ||||||
| -e PR_CHANGED_FILES=$PR_CHANGED_FILES \ | ||||||
| -e UV_INDEX_URL=$UV_INDEX_URL \ | ||||||
| -e UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL \ | ||||||
| -e UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY \ | ||||||
| -e UV_NO_CACHE=$UV_NO_CACHE \ | ||||||
| -e UV_SYSTEM_PYTHON=$UV_SYSTEM_PYTHON \ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the change above, providing a default value for
Suggested change
|
||||||
| --workdir=$CODE_DIR_IN_CONTAINER \ | ||||||
| ${IMAGE_NAME}:${IMAGE_VERSION} \ | ||||||
| $CI_COMMAND | ||||||
|
|
||||||
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
pip install uvcommand does not use the mirror index that was previously configured for package installations. In environments where the default PyPI index is slow or unreachable (as suggested by the previous use of the Aliyun mirror), this bootstrap step may fail or be significantly slower. Consider using the mirror for this step as well.