diff --git a/gds/benchmarks/pytorch/LICENSE b/gds/benchmarks/pytorch/LICENSE index 9234418..b5f187c 100644 --- a/gds/benchmarks/pytorch/LICENSE +++ b/gds/benchmarks/pytorch/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/LICENSE b/gds/benchmarks/pytorch/deepCam-inference/LICENSE index cd142b1..696efb7 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/LICENSE +++ b/gds/benchmarks/pytorch/deepCam-inference/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Pyjcsx, 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +Copyright (c) 2018 Pyjcsx, 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/README.md b/gds/benchmarks/pytorch/deepCam-inference/README.md index efc8584..de72d99 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/README.md +++ b/gds/benchmarks/pytorch/deepCam-inference/README.md @@ -68,3 +68,17 @@ Note: if you encounter error messages related to Tensor RT and device incompatib ## GDS Support The benchmark uses the [GDS enabled DALI numpy reader](https://docs.nvidia.com/deeplearning/dali/user-guide/docs/examples/general/data_loading/numpy_reader.html#GPUDirect-Storage-Support). Numpy (npy) is the only file format in DALI which currently supports GDS. For more information about the pipeline used in this benchmark, please see `data/cam_numpy_dali_dataset.py`. + +## Software Versions +The benchmark was tested with the following software versions: + +PyTorch Container: nvcr.io/nvidia/pytorch:21.11-py3 +CUDA SDK: 11.6 +CUDA Driver: 510.47.03 +GDS: 1.2.1 +pytorch: 1.11.0a0+b6df043 +cuDNN: 8.3.0 +DALI: 1.12.0dev.20220304 +Torch-TensorRT: 1.1.0a0+00da3d1f + +The Dockerfile from the `pytorch/docker` already uses these versions. Concerning DALI, any version newer than the one stated is also supposed to work. diff --git a/gds/benchmarks/pytorch/deepCam-inference/architecture/__init__.py b/gds/benchmarks/pytorch/deepCam-inference/architecture/__init__.py index d17eefb..66ec8f0 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/architecture/__init__.py +++ b/gds/benchmarks/pytorch/deepCam-inference/architecture/__init__.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/architecture/deeplab_xception.py b/gds/benchmarks/pytorch/deepCam-inference/architecture/deeplab_xception.py index 22d2d2e..d64cd8e 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/architecture/deeplab_xception.py +++ b/gds/benchmarks/pytorch/deepCam-inference/architecture/deeplab_xception.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2018 Pyjcsx, 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2018 Pyjcsx, 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/data/cam_numpy_dali_dataset.py b/gds/benchmarks/pytorch/deepCam-inference/data/cam_numpy_dali_dataset.py index 4d5c30e..a21927c 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/data/cam_numpy_dali_dataset.py +++ b/gds/benchmarks/pytorch/deepCam-inference/data/cam_numpy_dali_dataset.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/driver/test_numpy_dali.py b/gds/benchmarks/pytorch/deepCam-inference/driver/test_numpy_dali.py index add7136..f1cc538 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/driver/test_numpy_dali.py +++ b/gds/benchmarks/pytorch/deepCam-inference/driver/test_numpy_dali.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/scripts/bind.sh b/gds/benchmarks/pytorch/deepCam-inference/scripts/bind.sh index f8381e6..19baebc 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/scripts/bind.sh +++ b/gds/benchmarks/pytorch/deepCam-inference/scripts/bind.sh @@ -2,7 +2,7 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_benchmark.sh b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_benchmark.sh index a980360..41240e5 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_benchmark.sh +++ b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_benchmark.sh @@ -2,7 +2,7 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_deepcam.sh b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_deepcam.sh index 47f1c86..a32d9ea 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_deepcam.sh +++ b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_deepcam.sh @@ -2,7 +2,7 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_download_data.sh b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_download_data.sh index 7121e40..aec99ff 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_download_data.sh +++ b/gds/benchmarks/pytorch/deepCam-inference/scripts/run_docker_download_data.sh @@ -2,7 +2,7 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/download_data.py b/gds/benchmarks/pytorch/deepCam-inference/utils/download_data.py index 6db8fb0..7538fdd 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/download_data.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/download_data.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/h52npy.py b/gds/benchmarks/pytorch/deepCam-inference/utils/h52npy.py index e612774..ddce4c5 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/h52npy.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/h52npy.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/losses.py b/gds/benchmarks/pytorch/deepCam-inference/utils/losses.py index 3e7ab97..bb48e68 100755 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/losses.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/losses.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/model_handler.py b/gds/benchmarks/pytorch/deepCam-inference/utils/model_handler.py index b1da180..01b367c 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/model_handler.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/model_handler.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/parser.py b/gds/benchmarks/pytorch/deepCam-inference/utils/parser.py index 3d70ccd..a57ed78 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/parser.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/parser.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/deepCam-inference/utils/visualizer.py b/gds/benchmarks/pytorch/deepCam-inference/utils/visualizer.py index d4048bb..04c645d 100644 --- a/gds/benchmarks/pytorch/deepCam-inference/utils/visualizer.py +++ b/gds/benchmarks/pytorch/deepCam-inference/utils/visualizer.py @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/docker/Dockerfile b/gds/benchmarks/pytorch/docker/Dockerfile index 0516809..dfb399c 100644 --- a/gds/benchmarks/pytorch/docker/Dockerfile +++ b/gds/benchmarks/pytorch/docker/Dockerfile @@ -1,6 +1,6 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/benchmarks/pytorch/docker/Dockerfile~ b/gds/benchmarks/pytorch/docker/Dockerfile~ deleted file mode 100644 index fd5810b..0000000 --- a/gds/benchmarks/pytorch/docker/Dockerfile~ +++ /dev/null @@ -1,109 +0,0 @@ -# MIT License -# -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -FROM nvcr.io/nvidia/pytorch:21.11-py3 as builder - -ENV DEBIAN_FRONTEND noninteractive - -# install GDS -RUN apt update -y && apt install -y liburcu-dev linux-headers-generic #linux-headers-$(uname -r) -RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \ - mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \ - wget https://developer.download.nvidia.com/compute/cuda/11.6.1/local_installers/cuda-repo-ubuntu2004-11-6-local_11.6.1-510.47.03\ --1_amd64.deb && \ - dpkg -i cuda-repo-ubuntu2004-11-6-local_11.6.1-510.47.03-1_amd64.deb && \ - apt-key add /var/cuda-repo-ubuntu2004-11-6-local/7fa2af80.pub && \ - apt-get update -y && apt install -y libcufile-dev-11-6 - -# cleanup -RUN rm -rf /usr/local/cuda /usr/local/cuda-11 && \ - ln -s /usr/local/cuda-11.5/ /usr/local/cuda && \ - ln -s /usr/local/cuda-11.5/ /usr/local/cuda-11 && \ - cp -r /usr/local/cuda-11.6/targets/x86_64-linux/include/* /usr/local/cuda/include/ && \ - cp -r /usr/local/cuda-11.6/targets/x86_64-linux/lib/* /usr/local/cuda/lib64/ && \ - cp -r /usr/local/cuda-11.6/gds /usr/local/cuda - -# torch_tensorrt prereqs -# bazel -RUN apt-get update && apt-get install -y curl gnupg && rm -rf /var/lib/apt/lists/* && \ - curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg && \ - mv bazel.gpg /etc/apt/trusted.gpg.d/ && \ - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list -RUN apt-get update && apt-get install -y bazel-4.0.0 && rm -rf /var/lib/apt/lists/* -RUN ln -s /usr/bin/bazel-4.0.0 /usr/bin/bazel -# Workaround for bazel expecting both static and shared versions, we only use shared libraries inside container -RUN cp /usr/lib/x86_64-linux-gnu/libnvinfer.so /usr/lib/x86_64-linux-gnu/libnvinfer_static.a - -# notebook -RUN pip install notebook - -# install mpi4py -RUN pip install h5py mpi4py - -# install other prereqs -RUN pip install matplotlib PILLOW - -FROM builder - -# torch_tensorrt -RUN cd /opt && git clone https://github.com/NVIDIA/Torch-TensorRT.git torch_tensorrt && \ - cd /opt/torch_tensorrt && \ - git checkout -b stable-21.12 --no-track origin/release/ngc/21.12 && \ - git fetch origin pull/719/head:fix_branch && \ - git config user.name "Container" && \ - git config user.email "" && \ - git merge fix_branch - -RUN cd /opt/torch_tensorrt && cp ./docker/WORKSPACE.docker WORKSPACE -RUN cd /opt/torch_tensorrt && bazel build //:libtorchtrt --compilation_mode opt -RUN cd /opt/torch_tensorrt/py && \ - pip install ipywidgets --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org && \ - jupyter nbextension enable --py widgetsnbextension - -# Locale is not set by default -RUN apt-get update && apt-get install -y locales ninja-build && \ - rm -rf /var/lib/apt/lists/* && locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -RUN cd /opt/torch_tensorrt/py && python3 setup.py bdist_wheel --use-cxx11-abi -RUN cd /opt/torch_tensorrt/py/dist && pip install *.whl && rm -rf *.whl - -RUN conda init bash - -ENV LD_LIBRARY_PATH /opt/conda/lib/python3.8/site-packages/torch/lib:/opt/conda/lib/python3.8/site-packages/torch_tensorrt/lib:$LD_LIBRARY_PATH -ENV PATH /opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin:${PATH} - -# upgrade DALI to nightly -RUN pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/nightly --upgrade nvidia-dali-nightly-cuda110 - -# copy benchmarks -#deepcam -COPY ./benchmarks/deepCam /opt/benchmarks/deepCam -RUN mkdir /share && cat /opt/benchmarks/deepCam/share/model_part* > /share/model.pth - -# create additional folders for mapping data in -RUN mkdir -p /data && mkdir -p /data && mkdir -p /data/output - -# env variables -ENV UCX_MEMTYPE_CACHE n -ENV UCX_TLS cma,mm diff --git a/gds/benchmarks/pytorch/docker/build_docker.sh b/gds/benchmarks/pytorch/docker/build_docker.sh index 1c9e199..e5eb3d1 100755 --- a/gds/benchmarks/pytorch/docker/build_docker.sh +++ b/gds/benchmarks/pytorch/docker/build_docker.sh @@ -2,7 +2,7 @@ # MIT License # -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/gds/readers/pytorch-numpy/cpp/numpy_reader.cpp b/gds/readers/pytorch-numpy/cpp/numpy_reader.cpp index aef688f..f7d2ab0 100644 --- a/gds/readers/pytorch-numpy/cpp/numpy_reader.cpp +++ b/gds/readers/pytorch-numpy/cpp/numpy_reader.cpp @@ -531,6 +531,6 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { npr.def("disable_p2p", &NumpyReader::DisableP2P); //loader - npr.def("get_sample", &NumpyReader::getSample, py::arg("element_id") ); - npr.def("get_batch", &NumpyReader::getBatch, py::arg("element_ids") ); + npr.def("get_sample", &NumpyReader::getSample, py::arg("element_id"), py::call_guard()); + npr.def("get_batch", &NumpyReader::getBatch, py::arg("element_ids"), py::call_guard()); }