Skip to content

Commit

Permalink
Fix nvidia-apex installation from deps
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed May 17, 2023
1 parent 5d7294f commit 0537e59
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cm-mlops/script/app-image-classification-onnx-py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ ___
* get,dataset-aux,imagenet-aux,image-classification
- CM script: [get-dataset-imagenet-aux](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-dataset-imagenet-aux)
* get,ml-model,resnet50,_onnx,image-classification
- CM script: [get-ml-model-resnet50-tvm](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50-tvm)
- CM script: [get-ml-model-resnet50](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50)
- CM script: [get-ml-model-resnet50-tvm](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50-tvm)
* get,generic-python-lib,_onnxruntime
* `if (USE_CUDA != True)`
- CM script: [get-generic-python-lib](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-generic-python-lib)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ ___
* get,imagenet-helper
- CM script: [get-dataset-imagenet-helper](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-dataset-imagenet-helper)
* get,ml-model,image-classification,resnet50,_pytorch,_fp32
- CM script: [get-ml-model-resnet50-tvm](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50-tvm)
- CM script: [get-ml-model-resnet50](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50)
- CM script: [get-ml-model-resnet50-tvm](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50-tvm)
* get,generic-python-lib,_torch
* `if (USE_CUDA != yes)`
- CM script: [get-generic-python-lib](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-generic-python-lib)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,8 @@ ___
- CM script: [get-dataset-imagenet-val](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-dataset-imagenet-val)
* get,dataset-aux,image-classification
- CM script: [get-dataset-imagenet-aux](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-dataset-imagenet-aux)
* get,ml-model,image-classification,resnet50,_onnx
* get,raw,ml-model,image-classification,resnet50,_onnx
- CM script: [get-ml-model-resnet50](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50)
- CM script: [get-ml-model-resnet50-tvm](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-ml-model-resnet50-tvm)
* get,generic-python-lib,_onnxruntime
- CM script: [get-generic-python-lib](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/get-generic-python-lib)
1. Run "preprocess" function from customize.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ See [more info](README-extra.md).

#### Information

* Category: *IPOL reproducibility.*
* Category: *Reproduced papers.*
* CM GitHub repository: *[mlcommons@ck](https://github.com/mlcommons/ck/tree/master/cm-mlops)*
* GitHub directory for this script: *[GitHub](https://github.com/mlcommons/ck/tree/master/cm-mlops/script/app-ipol-reproducibility-2022-439)*
* CM meta description for this script: *[_cm.yaml](_cm.yaml)*
Expand Down
16 changes: 13 additions & 3 deletions cm-mlops/script/get-generic-python-lib/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"new_env_keys": [
"CM_PYTHONLIB_*"
],
"local_env_keys": [
"CM_GENERIC_PYTHON_PACKAGE_VARIANT"
],
"tags": [
"get",
"install",
Expand Down Expand Up @@ -83,6 +86,13 @@
"torch"
],
"tags": "get,generic-python-lib,_torch_cuda"
},
{
"tags": "get,git,repo,_repo.https://github.com/NVIDIA/apex",
"env": {
"CM_GIT_CHECKOUT": "master",
"CM_GIT_CHECKOUT_FOLDER": "apex"
}
}
]
},
Expand Down Expand Up @@ -609,7 +619,7 @@
"CM_GENERIC_PYTHON_PACKAGE_NAME": "torch",
"CM_GENERIC_PYTHON_PIP_INDEX_URL": "https://download.pytorch.org/whl/${CM_TORCH_CUDA}",
"CM_GENERIC_PYTHON_PIP_EXTRA": " --pre",
"CM_TORCH_CUDA": "cu117",
"CM_TORCH_CUDA": "cu118",
"CM_TORCH_VERSION_EXTRA": "CUDA"
},
"new_env_keys": [
Expand Down Expand Up @@ -640,7 +650,7 @@
"env": {
"CM_GENERIC_PYTHON_PACKAGE_NAME": "torch",
"CM_GENERIC_PYTHON_PIP_EXTRA_INDEX_URL": "https://download.pytorch.org/whl/${CM_TORCH_CUDA}",
"CM_TORCH_CUDA": "cu117",
"CM_TORCH_CUDA": "cu118",
"CM_TORCH_VERSION_EXTRA": "CUDA"
},
"new_env_keys": [
Expand Down Expand Up @@ -672,7 +682,7 @@
"CM_GENERIC_PYTHON_PACKAGE_NAME": "torchaudio",
"CM_GENERIC_PYTHON_PIP_EXTRA_INDEX_URL": "https://download.pytorch.org/whl/${CM_TORCH_CUDA}",
"CM_TORCHAUDIO_VERSION_EXTRA": "CUDA",
"CM_TORCH_CUDA": "cu117"
"CM_TORCH_CUDA": "cu118"
},
"new_env_keys": [
"CM_TORCHAUDIO_VERSION*"
Expand Down
2 changes: 2 additions & 0 deletions cm-mlops/script/get-generic-python-lib/customize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def preprocess(i):
'env': env,
'run_script_input':i['run_script_input'],
'recursion_spaces':recursion_spaces})

if r['return'] >0:
if r['return'] == 16:
extra = env.get('CM_GENERIC_PYTHON_PIP_EXTRA','')
Expand Down Expand Up @@ -63,6 +64,7 @@ def preprocess(i):
return automation._available_variations({'meta':meta})

r = automation.run_native_script({'run_script_input':run_script_input, 'env':env, 'script_name':'install'})

if r['return']>0: return r

return {'return':0}
Expand Down
7 changes: 4 additions & 3 deletions cm-mlops/script/get-generic-python-lib/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

if [[ ${CM_GENERIC_PYTHON_PACKAGE_VARIANT} == "nvidia-apex" ]]; then
git clone https://github.com/NVIDIA/apex
cd apex
${CM_PYTHON_BIN_WITH_PATH} -m pip install -v --disable-pip-version-check --global-option="--cpp_ext" --global-option="--cuda_ext" ./
cd ${CM_GIT_REPO_CHECKOUT_PATH}
cmd="${CM_PYTHON_BIN_WITH_PATH} -m pip install -v --disable-pip-version-check --global-option=\"--cpp_ext\" --global-option=\"--cuda_ext\" ./"
echo $cmd
eval $cmd
test $? -eq 0 || exit $?
exit 0
fi
Expand Down

0 comments on commit 0537e59

Please sign in to comment.