-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_loong64.patch
More file actions
113 lines (106 loc) · 5.13 KB
/
Copy pathpatch_loong64.patch
File metadata and controls
113 lines (106 loc) · 5.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
diff --git a/.ci/manywheel/build.sh b/.ci/manywheel/build.sh
index 2f4abd2..06aaf77 100755
--- a/.ci/manywheel/build.sh
+++ b/.ci/manywheel/build.sh
@@ -6,7 +6,7 @@ SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PYTORCH_ROOT="${PYTORCH_ROOT:-$(cd "${SCRIPTPATH}/../.." && pwd)}"
case "${GPU_ARCH_TYPE:-BLANK}" in
- cuda|cuda-aarch64|cpu|cpu-aarch64|cpu-cxx11-abi|xpu|rocm)
+ cuda|cuda-aarch64|cpu|cpu-aarch64|cpu-loongarch64|cpu-cxx11-abi|xpu|rocm)
# New pipeline: pyproject-driven build via `python -m build`
# then patchelf-based wheel repair.
source "${SCRIPTPATH}/set_desired_python.sh"
diff --git a/.ci/manywheel/build_common.sh b/.ci/manywheel/build_common.sh
index cd20c07..ba9aac5 100644
--- a/.ci/manywheel/build_common.sh
+++ b/.ci/manywheel/build_common.sh
@@ -41,6 +41,9 @@ if [[ "$OS_NAME" == *"AlmaLinux"* ]]; then
aarch64)
PLATFORM="manylinux_2_28_aarch64"
;;
+ loongarch64)
+ PLATFORM="manylinux_2_38_loongarch64"
+ ;;
*)
echo "Other architectures: $ARCH, not setting PLATFORM"
;;
@@ -115,6 +118,7 @@ if [[ -z "$PYTORCH_ROOT" ]]; then
exit 1
fi
pushd "$PYTORCH_ROOT"
+retry pip install -U pip
retry pip install -qUr requirements-build.txt
python setup.py clean
retry pip install -qr requirements.txt
@@ -382,6 +386,10 @@ for pkg in /$WHEELHOUSE_DIR/torch_no_python*.whl /$WHEELHOUSE_DIR/torch*linux*.w
wheel_file=$(echo $(basename $pkg) | sed -e 's/-cp.*$/.dist-info\/WHEEL/g')
sed -i -e s#linux_aarch64#"${PLATFORM}"# $wheel_file;
fi
+ if [[ $PLATFORM == "manylinux_2_38_loongarch64" ]]; then
+ wheel_file=$(echo $(basename $pkg) | sed -e 's/-cp.*$/.dist-info\/WHEEL/g')
+ sed -i -e s#linux_loongarch64#"${PLATFORM}"# $wheel_file;
+ fi
# regenerate the RECORD file with new hashes
record_file=$(echo $(basename $pkg) | sed -e 's/-cp.*$/.dist-info\/RECORD/g')
@@ -434,6 +442,11 @@ for pkg in /$WHEELHOUSE_DIR/torch_no_python*.whl /$WHEELHOUSE_DIR/torch*linux*.w
zip -rq $pkg_name $PREIX*
rm -f $pkg
mv $pkg_name $(dirname $pkg)/$pkg_name
+ elif [[ $PLATFORM == "manylinux_2_38_loongarch64" ]]; then
+ pkg_name=$(echo $(basename $pkg) | sed -e s#linux_loongarch64#"${PLATFORM}"#)
+ zip -rq $pkg_name $PREIX*
+ rm -f $pkg
+ mv $pkg_name $(dirname $pkg)/$pkg_name
else
# zip up the wheel back
zip -rq $(basename $pkg) $PREIX*
diff --git a/.ci/manywheel/build_env_setup.py b/.ci/manywheel/build_env_setup.py
index a72b7e4..d285170 100755
--- a/.ci/manywheel/build_env_setup.py
+++ b/.ci/manywheel/build_env_setup.py
@@ -186,6 +186,7 @@ ROCM_BUILD_ENV_STATIC: dict[str, str] = {
PLATFORM_TAGS: dict[str, str] = {
"x86_64": "manylinux_2_28_x86_64",
"aarch64": "manylinux_2_28_aarch64",
+ "loongarch64": "manylinux_2_38_loongarch64",
}
@@ -453,7 +454,7 @@ def main() -> None:
setup_cuda(cuda_version)
env_out.update(cuda_build_env(cuda_version, arch))
print(f"CUDA {cuda_version} environment configured")
- elif gpu_arch_type in ("cpu", "cpu-aarch64", "cpu-s390x", "cpu-cxx11-abi"):
+ elif gpu_arch_type in ("cpu", "cpu-aarch64", "cpu-loongarch64", "cpu-s390x", "cpu-cxx11-abi"):
cleanup_cuda_for_cpu_build()
env_out.update(CPU_BUILD_ENV)
print("CPU environment configured")
diff --git a/.ci/manywheel/repair_wheel.py b/.ci/manywheel/repair_wheel.py
index ae964c5..a440554 100755
--- a/.ci/manywheel/repair_wheel.py
+++ b/.ci/manywheel/repair_wheel.py
@@ -419,7 +419,7 @@ def main() -> None:
force_rpath,
)
- retag_wheels(args.output_dir, f"manylinux_2_28_{arch}")
+ retag_wheels(args.output_dir, f"manylinux_2_38_{arch}")
repaired = list(args.output_dir.glob("*.whl"))
print(f"Repaired {len(repaired)} wheel(s) in {args.output_dir}")
diff --git a/.ci/pytorch/build.sh b/.ci/pytorch/build.sh
index 855ad14..9ac66b7 100755
--- a/.ci/pytorch/build.sh
+++ b/.ci/pytorch/build.sh
@@ -232,7 +232,7 @@ fi
# Do not change workspace permissions for ROCm and s390x CI jobs
# as it can leave workspace with bad permissions for cancelled jobs
-if [[ "$BUILD_ENVIRONMENT" != *rocm* && "$BUILD_ENVIRONMENT" != *s390x* && "$BUILD_ENVIRONMENT" != *riscv64* && -d /var/lib/jenkins/workspace ]]; then
+if [[ "$BUILD_ENVIRONMENT" != *rocm* && "$BUILD_ENVIRONMENT" != *loongarch64* && "$BUILD_ENVIRONMENT" != *s390x* && "$BUILD_ENVIRONMENT" != *riscv64* && -d /var/lib/jenkins/workspace ]]; then
# Workaround for dind-rootless userid mapping (https://github.com/pytorch/ci-infra/issues/96)
WORKSPACE_ORIGINAL_OWNER_ID=$(stat -c '%u' "/var/lib/jenkins/workspace")
cleanup_workspace() {
@@ -439,6 +439,6 @@ if [[ "$BUILD_ENVIRONMENT" != *libtorch* ]]; then
PYTHONPATH=. python tools/stats/export_test_times.py
fi
# don't do this for s390x or riscv64 as they don't use sccache
-if [[ "$BUILD_ENVIRONMENT" != *s390x* && "$BUILD_ENVIRONMENT" != *riscv64* ]]; then
+if [[ "$BUILD_ENVIRONMENT" != *loongarch64* && "$BUILD_ENVIRONMENT" != *s390x* && "$BUILD_ENVIRONMENT" != *riscv64* ]]; then
print_sccache_stats
fi