add sw_64 support

This commit is contained in:
Dun Liang 2021-07-21 17:04:48 +08:00
parent c82db520b1
commit 08fcf01d62
4 changed files with 22 additions and 3 deletions

View File

@ -9,7 +9,7 @@
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.2.3.71'
__version__ = '1.2.3.72'
from jittor_utils import lock
with lock.lock_scope():
ori_int = int

View File

@ -494,6 +494,9 @@ rank = mpi.world_rank() if in_mpi else 0
setup_nccl()
setup_cutt()
setup_mkl()
try:
setup_mkl()
except Exception as e:
LOG.w("MKL install failed, msg:", e)
setup_cuda_extern()

View File

@ -1069,6 +1069,7 @@ elif platform.system() == 'Darwin':
os_arch = platform.machine()
os_type = {
"isoft": "ubuntu",
"ubuntu": "ubuntu",
"debian": "ubuntu",
"centos": "centos",
@ -1088,6 +1089,10 @@ if os.path.isfile(version_file) and not os.path.isdir(os.path.join(jittor_path,
os_key += '-' + os_arch if os_arch else ''
if platform.machine()=='aarch64':
os_key += '-aarch64'
if platform.machine()=='sw_64':
os_key += '-sw_64'
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if "os_key" in os.environ:
os_key = os.environ['os_key']
LOG.i("OS type:", os_id, " OS key:", os_key)

View File

@ -60,6 +60,9 @@ os_name_system_dict = {
'macos': 'Darwin',
}
if len(sys.argv) > 1 and sys.argv[1] == "native":
os_name_system_dict = {'ubuntu': 'Linux'}
for os_name, os_type in os_name_system_dict.items():
if platform.system() != os_type:
continue
@ -82,6 +85,8 @@ for os_name, os_type in os_name_system_dict.items():
cmd = f"{env} {sys.executable} -c 'import jittor'"
if key != 'ubuntu': key += '-' + os_name
if os_arch : key += '-' + os_arch
if platform.machine() == "sw_64":
key += '-sw_64'
if os_name == 'centos':
run_in_centos(env)
obj_path = home + f"/.cache/centos/build/{cc_type}/{device}/{cname}/obj_files"
@ -98,7 +103,12 @@ for os_name, os_type in os_name_system_dict.items():
fname = f"{obj_path}/{name}.o"
assert os.path.isfile(fname), fname
obj_files.append(fname)
run_cmd(f"ld -r {' '.join(obj_files)} -o {build_path}/{key}.o")
ld_cmd = f"ld -r {' '.join(obj_files)} -o {build_path}/{key}.o"
print("RUN CMD:", ld_cmd)
run_cmd(ld_cmd)
if len(sys.argv) > 1 and sys.argv[1] == "native":
exit(0)
# compress source
# tar -cvzf build/jittor.tgz . --exclude build --exclude .git --exclude .ipynb_checkpoints --exclude __pycache__
@ -108,6 +118,7 @@ assert os.system(f"cd {root_path} && tar --exclude=build --exclude=.git --exclud
# rsync to build-server
jittor_web_base_dir = "Documents/jittor-blog/assets/"
jittor_web_build_dir = jittor_web_base_dir
# copy to jittor-web:Documents/jittor-blog/assets/build/
assert os.system(f"rsync -avPu {build_path} jittor-web:{jittor_web_build_dir}")==0
assert os.system(f"ssh jittor-web Documents/jittor-blog.git/hooks/post-update")==0