Skip to content

Commit 721eef5

Browse files
committed
[XPU] redirect xvllm/xtdk/xhpc downloading log
1 parent ebe613c commit 721eef5

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

custom_ops/xpu_ops/download_dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ fi
2626
rm -rf output* xvllm* xtdk-llvm* output.tar.gz xtdk-llvm*tar.gz
2727

2828
# Download and install xvllm
29-
if ! wget "https://klx-sdk-release-public.su.bcebos.com/xinfer/daily/eb/${version_xvllm}/output.tar.gz"; then
29+
if ! wget -q "https://klx-sdk-release-public.su.bcebos.com/xinfer/daily/eb/${version_xvllm}/output.tar.gz"; then
3030
echo "Error downloading xvllm"
3131
exit 2
3232
fi
3333
tar -zxf output.tar.gz && mv output xvllm && rm output.tar.gz
3434

3535
# Download and install xtdk
36-
if ! wget "https://klx-sdk-release-public.su.bcebos.com/xtdk_15fusion/dev/${version_xtdk}/xtdk-llvm15-ubuntu2004_x86_64.tar.gz"; then
36+
if ! wget -q "https://klx-sdk-release-public.su.bcebos.com/xtdk_15fusion/dev/${version_xtdk}/xtdk-llvm15-ubuntu2004_x86_64.tar.gz"; then
3737
echo "Error downloading xtdk"
3838
exit 3
3939
fi

custom_ops/xpu_ops/setup_ops.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def download_and_extract(url, destination_directory):
4848
print(f"Downloading: {url}")
4949
subprocess.run(
5050
["wget", "-O", file_path, url],
51+
stdout=subprocess.DEVNULL,
52+
stderr=subprocess.DEVNULL,
5153
check=True,
5254
)
5355
print(f"Downloaded to: {file_path}")
@@ -152,12 +154,8 @@ def xpu_setup_ops():
152154

153155
XDNN_PATH = os.getenv("XDNN_PATH")
154156
if XDNN_PATH is None:
155-
version_cmd = 'python -c "import paddle; print(paddle.version.xpu_xhpc())"'
156-
try:
157-
XHPC_VERSION = subprocess.check_output(version_cmd, shell=True).strip().decode()
158-
print(f"Fetched XHPC_VERSION from paddle: {XHPC_VERSION}")
159-
except Exception as e:
160-
raise Exception(f"PaddlePaddle-xpu not installed, please install it first. {e}")
157+
XHPC_VERSION = paddle.version.xpu_xhpc()
158+
print(f"Fetched XHPC_VERSION from paddle: {XHPC_VERSION}")
161159

162160
XHPC_URL = f"https://klx-sdk-release-public.su.bcebos.com/xhpc/{XHPC_VERSION}/xhpc-ubuntu2004_x86_64.tar.gz"
163161
THIRD_PARTY_PATH = os.path.join(current_file.parent, "third_party")

0 commit comments

Comments
 (0)