"torchvision/models/vscode:/vscode.git/clone" did not exist on "385a44f84859477ffa2d574fa6fbd4930dec9bf6"
Commit 880ab925 authored by Marek Kolodziej's avatar Marek Kolodziej Committed by mcarilli
Browse files

Adding PyProf to Apex (#404)


Co-authored-by: default avatarAditya Agrawal <aditya.iitb@gmail.com>
Co-authored-by: default avatarMarek Kolodziej <mkolod@gmail.com>
parent 4a8c4ac0
This diff is collapsed.
This diff is collapsed.
cxxfilt>=0.2.0
tqdm>=4.28.1
numpy>=1.15.3
PyYAML>=5.1
pytest>=3.5.1
...@@ -2,7 +2,9 @@ import torch ...@@ -2,7 +2,9 @@ import torch
from setuptools import setup, find_packages from setuptools import setup, find_packages
import subprocess import subprocess
from pip._internal import main as pipmain
import sys import sys
import warnings
if not torch.cuda.is_available(): if not torch.cuda.is_available():
print("\nWarning: Torch did not find available GPUs on this system.\n", print("\nWarning: Torch did not find available GPUs on this system.\n",
...@@ -19,6 +21,17 @@ if TORCH_MAJOR == 0 and TORCH_MINOR < 4: ...@@ -19,6 +21,17 @@ if TORCH_MAJOR == 0 and TORCH_MINOR < 4:
cmdclass = {} cmdclass = {}
ext_modules = [] ext_modules = []
if "--pyprof" in sys.argv:
with open('requirements.txt') as f:
required_packages = f.read().splitlines()
pipmain(["install"] + required_packages)
try:
sys.argv.remove("--pyprof")
except:
pass
else:
warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")
if "--cpp_ext" in sys.argv or "--cuda_ext" in sys.argv: if "--cpp_ext" in sys.argv or "--cuda_ext" in sys.argv:
if TORCH_MAJOR == 0: if TORCH_MAJOR == 0:
raise RuntimeError("--cpp_ext requires Pytorch 1.0 or later, " raise RuntimeError("--cpp_ext requires Pytorch 1.0 or later, "
......
import test_pyprof_nvtx.TestPyProfNvtx as TestPyProfNvtx
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment