forked from mlcommons/ck
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added libkineto build from src for Nvidia gptj
- Loading branch information
1 parent
fe385d4
commit fd018d4
Showing
3 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
130 changes: 130 additions & 0 deletions
130
cm-mlops/script/install-pytorch-kineto-from-src/_cm.json
This file contains 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,130 @@ | ||
{ | ||
"alias": "install-pytorch-kineto-from-src", | ||
"automation_alias": "script", | ||
"automation_uid": "5b4e0237da074764", | ||
"cache": true, | ||
"category": "Compiler automation", | ||
"deps": [ | ||
{ | ||
"tags": "detect,os" | ||
}, | ||
{ | ||
"tags": "detect,cpu" | ||
}, | ||
{ | ||
"names": [ | ||
"python", | ||
"python3" | ||
], | ||
"skip_if_env": { | ||
"CM_CONDA_ENV": [ | ||
"yes" | ||
] | ||
}, | ||
"tags": "get,python3" | ||
}, | ||
{ | ||
"tags": "get,cmake", | ||
"version_min": "3.25.0" | ||
}, | ||
{ | ||
"env": { | ||
"CM_GIT_CHECKOUT_PATH_ENV_NAME": "CM_PYTORCH_KINETO_SRC_REPO_PATH" | ||
}, | ||
"extra_cache_tags": "pytorch-kineto,kineto,src,pytorch-kineto-src,pytorch-kineto-src-repo", | ||
"names": [ | ||
"pytorch-kineto-src-repo" | ||
], | ||
"tags": "get,git,repo", | ||
"update_tags_from_env_with_prefix": { | ||
"_branch.": [ | ||
"CM_GIT_CHECKOUT" | ||
], | ||
"_repo.": [ | ||
"CM_GIT_URL" | ||
], | ||
"_sha.": [ | ||
"CM_GIT_CHECKOUT_SHA" | ||
], | ||
"_tag.": [ | ||
"CM_GIT_CHECKOUT_TAG" | ||
] | ||
} | ||
} | ||
], | ||
"env": { | ||
"CM_GIT_URL": "https://github.com/pytorch/kineto" | ||
}, | ||
"name": "Build pytorch kineto from sources", | ||
"new_env_keys": [ | ||
"CM_PYTORCH_KINETO_*" | ||
], | ||
"prehook_deps": [], | ||
"sort": 1000, | ||
"tags": [ | ||
"install", | ||
"get", | ||
"src", | ||
"from.src", | ||
"pytorch-kineto", | ||
"kineto", | ||
"src-pytorch-kineto" | ||
], | ||
"uid": "98a4b061712d4483", | ||
"variations": { | ||
"branch.#": { | ||
"env": { | ||
"CM_GIT_CHECKOUT": "#" | ||
} | ||
}, | ||
"cuda": { | ||
"deps": [ | ||
{ | ||
"names": [ | ||
"cuda" | ||
], | ||
"tags": "get,cuda,_cudnn" | ||
} | ||
], | ||
"env": { | ||
"CUDA_HOME": "<<<CM_CUDA_INSTALLED_PATH>>>", | ||
"CUDA_NVCC_EXECUTABLE": "<<<CM_NVCC_BIN_WITH_PATH>>>", | ||
"CUDNN_INCLUDE_PATH": "<<<CM_CUDA_PATH_INCLUDE_CUDNN>>>", | ||
"CUDNN_LIBRARY_PATH": "<<<CM_CUDA_PATH_LIB_CUDNN>>>", | ||
"TORCH_CUDA_ARCH_LIST": "Ampere Ada Hopper", | ||
"TORCH_CXX_FLAGS": "-D_GLIBCXX_USE_CXX11_ABI=1", | ||
"USE_CUDA": "1", | ||
"USE_CUDNN": "1" | ||
} | ||
}, | ||
"repo.#": { | ||
"env": { | ||
"CM_GIT_URL": "#" | ||
}, | ||
"group": "repo" | ||
}, | ||
"repo.https://github.com/pytorch/kineto": { | ||
"default": true, | ||
"env": { | ||
"CM_GIT_URL": "https://github.com/pytorch/kineto" | ||
}, | ||
"group": "repo" | ||
}, | ||
"sha.#": { | ||
"env": { | ||
"CM_GIT_CHECKOUT_SHA": "#" | ||
} | ||
}, | ||
"tag.#": { | ||
"ad": { | ||
"pytorch-src-repo": { | ||
"tags": "_full-history" | ||
} | ||
}, | ||
"env": { | ||
"CM_GIT_CHECKOUT_TAG": "#" | ||
} | ||
} | ||
}, | ||
"versions": {} | ||
} |
17 changes: 17 additions & 0 deletions
17
cm-mlops/script/install-pytorch-kineto-from-src/customize.py
This file contains 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,17 @@ | ||
from cmind import utils | ||
import os | ||
|
||
def preprocess(i): | ||
|
||
os_info = i['os_info'] | ||
|
||
if os_info['platform'] == 'windows': | ||
return {'return':1, 'error': 'Windows is not supported in this script yet'} | ||
|
||
env = i['env'] | ||
|
||
automation = i['automation'] | ||
|
||
recursion_spaces = i['recursion_spaces'] | ||
|
||
return {'return':0} |
This file contains 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,15 @@ | ||
#!/bin/bash | ||
|
||
CUR_DIR=$PWD | ||
rm -rf kineto | ||
cp -r ${CM_PYTORCH_KINETO_SRC_REPO_PATH} kineto | ||
cd kineto | ||
rm -rf libkineto/build | ||
|
||
mkdir -p libkneto/build && cd libkineto/build | ||
cmake .. | ||
test $? -eq 0 || exit $? | ||
make | ||
test $? -eq 0 || exit $? | ||
sudo make install | ||
test $? -eq 0 || exit $? |