From da80b585dd7c311196dcfec2f06e0bf56248b7f6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Jul 2020 10:56:15 -0700 Subject: [PATCH 001/750] 2020-07-30 nightly release (62fb3231d97f7c14de45d8202253e11974642f1f) From 6c726d23030934df8d608f53a5bb9190902cb91e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Jul 2020 15:39:23 -0700 Subject: [PATCH 002/750] 2020-07-30 nightly release (62fb3231d97f7c14de45d8202253e11974642f1f) From fc119b5b2332e96127e04ff13ccc43aa8ab72f63 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Jul 2020 16:08:07 -0700 Subject: [PATCH 003/750] 2020-07-30 nightly release (74e951481359efb65556ff0f75f1fdcc89af939f) --- .circleci/config.yml | 1431 +++++++++-------- packaging/vs2017/activate.bat | 44 + packaging/vs2017/conda_build_config.yaml | 24 + packaging/vs2017/install_activate.bat | 30 + packaging/vs2017/install_runtime.bat | 49 + packaging/vs2017/meta.yaml | 24 + packaging/vs2019/activate.bat | 44 + packaging/vs2019/conda_build_config.yaml | 24 + packaging/vs2019/install_activate.bat | 30 + packaging/vs2019/install_runtime.bat | 49 + packaging/vs2019/meta.yaml | 24 + packaging/windows/internal/auth.bat | 46 + packaging/windows/internal/build_conda.bat | 15 + packaging/windows/internal/build_wheels.bat | 12 + packaging/windows/internal/check_deps.bat | 67 + packaging/windows/internal/check_opts.bat | 33 + packaging/windows/internal/clean.bat | 5 + packaging/windows/internal/clone.bat | 56 + packaging/windows/internal/copy.bat | 13 + packaging/windows/internal/copy_cpu.bat | 1 + packaging/windows/internal/cuda_install.bat | 143 ++ packaging/windows/internal/dep_install.bat | 14 + packaging/windows/internal/env_fix.bat | 31 + .../windows/internal/nightly_defaults.bat | 200 +++ packaging/windows/internal/publish.bat | 89 + packaging/windows/internal/setup.bat | 44 + packaging/windows/internal/test.bat | 79 + packaging/windows/internal/upload.bat | 96 ++ packaging/windows/internal/vc_env_helper.bat | 43 + .../windows/internal/vc_install_helper.sh | 16 + packaging/windows/internal/vs2017_install.ps1 | 25 + packaging/windows/internal/vs2019_install.ps1 | 21 + packaging/windows/internal/vs_install.bat | 14 + setup.py | 2 +- 34 files changed, 2128 insertions(+), 710 deletions(-) create mode 100644 packaging/vs2017/activate.bat create mode 100644 packaging/vs2017/conda_build_config.yaml create mode 100644 packaging/vs2017/install_activate.bat create mode 100644 packaging/vs2017/install_runtime.bat create mode 100644 packaging/vs2017/meta.yaml create mode 100644 packaging/vs2019/activate.bat create mode 100644 packaging/vs2019/conda_build_config.yaml create mode 100644 packaging/vs2019/install_activate.bat create mode 100644 packaging/vs2019/install_runtime.bat create mode 100644 packaging/vs2019/meta.yaml create mode 100644 packaging/windows/internal/auth.bat create mode 100644 packaging/windows/internal/build_conda.bat create mode 100644 packaging/windows/internal/build_wheels.bat create mode 100644 packaging/windows/internal/check_deps.bat create mode 100644 packaging/windows/internal/check_opts.bat create mode 100644 packaging/windows/internal/clean.bat create mode 100644 packaging/windows/internal/clone.bat create mode 100644 packaging/windows/internal/copy.bat create mode 100644 packaging/windows/internal/copy_cpu.bat create mode 100644 packaging/windows/internal/cuda_install.bat create mode 100644 packaging/windows/internal/dep_install.bat create mode 100644 packaging/windows/internal/env_fix.bat create mode 100644 packaging/windows/internal/nightly_defaults.bat create mode 100644 packaging/windows/internal/publish.bat create mode 100644 packaging/windows/internal/setup.bat create mode 100644 packaging/windows/internal/test.bat create mode 100644 packaging/windows/internal/upload.bat create mode 100644 packaging/windows/internal/vc_env_helper.bat create mode 100755 packaging/windows/internal/vc_install_helper.sh create mode 100644 packaging/windows/internal/vs2017_install.ps1 create mode 100644 packaging/windows/internal/vs2019_install.ps1 create mode 100644 packaging/windows/internal/vs_install.bat diff --git a/.circleci/config.yml b/.circleci/config.yml index 56202b7..aadcaf6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,18 @@ version: 2.1 +executors: + windows-cpu: + machine: + resource_class: windows.xlarge + image: windows-server-2019-vs2019:stable + shell: bash.exe + + windows-gpu: + machine: + resource_class: windows.gpu.nvidia.medium + image: windows-server-2019-nvidia:stable + shell: bash.exe + commands: checkout_merge: @@ -179,51 +192,51 @@ jobs: - store_test_results: path: build_results/ -# binary_win_conda: -# <<: *binary_common -# executor: windows-cpu -# steps: -# - checkout_merge -# - run: -# name: Build conda packages -# command: | -# set -ex -# source packaging/windows/internal/vc_install_helper.sh -# packaging/windows/internal/cuda_install.bat -# eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" -# conda activate base -# conda install -yq conda-build "conda-package-handling!=1.5.0" -# packaging/build_conda.sh -# rm /C/tools/miniconda3/conda-bld/win-64/vs${VC_YEAR}*.tar.bz2 -# - store_artifacts: -# path: C:/tools/miniconda3/conda-bld/win-64 -# - persist_to_workspace: -# root: C:/tools/miniconda3/conda-bld/win-64 -# paths: -# - "*" -# - store_test_results: -# path: build_results/ -# -# binary_win_wheel: -# <<: *binary_common -# executor: windows-cpu -# steps: -# - checkout_merge -# - run: -# name: Build wheel packages -# command: | -# set -ex -# source packaging/windows/internal/vc_install_helper.sh -# packaging/windows/internal/cuda_install.bat -# packaging/build_wheel.sh -# - store_artifacts: -# path: dist -# - persist_to_workspace: -# root: dist -# paths: -# - "*" -# - store_test_results: -# path: build_results/ + binary_win_conda: + <<: *binary_common + executor: windows-cpu + steps: + - checkout_merge + - run: + name: Build conda packages + command: | + set -ex + source packaging/windows/internal/vc_install_helper.sh + packaging/windows/internal/cuda_install.bat + eval "$('/C/tools/miniconda3/Scripts/conda.exe' 'shell.bash' 'hook')" + conda activate base + conda install -yq conda-build "conda-package-handling!=1.5.0" + packaging/build_conda.sh + rm /C/tools/miniconda3/conda-bld/win-64/vs${VC_YEAR}*.tar.bz2 + - store_artifacts: + path: C:/tools/miniconda3/conda-bld/win-64 + - persist_to_workspace: + root: C:/tools/miniconda3/conda-bld/win-64 + paths: + - "*" + - store_test_results: + path: build_results/ + + binary_win_wheel: + <<: *binary_common + executor: windows-cpu + steps: + - checkout_merge + - run: + name: Build wheel packages + command: | + set -ex + source packaging/windows/internal/vc_install_helper.sh + packaging/windows/internal/cuda_install.bat + packaging/build_wheel.sh + - store_artifacts: + path: dist + - persist_to_workspace: + root: dist + paths: + - "*" + - store_test_results: + path: build_results/ binary_macos_wheel: <<: *binary_common @@ -490,104 +503,104 @@ workflows: name: binary_macos_wheel_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 -# - binary_win_wheel: -# cu_version: cpu -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cpu -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu92 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu101 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu102 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cpu -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cpu -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu92 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu101 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu102 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cpu -# name: binary_win_wheel_py3.8_cpu -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.8_cu92 -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.8_cu101 -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu102 -# name: binary_win_wheel_py3.8_cu102 -# python_version: '3.8' + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cpu + python_version: '3.6' + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu92 + python_version: '3.6' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu101 + python_version: '3.6' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu102 + python_version: '3.6' + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cpu + python_version: '3.7' + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu92 + python_version: '3.7' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu101 + python_version: '3.7' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu102 + python_version: '3.7' + - binary_win_wheel: + cu_version: cpu + name: binary_win_wheel_py3.8_cpu + python_version: '3.8' + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.8_cu92 + python_version: '3.8' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.8_cu101 + python_version: '3.8' + - binary_win_wheel: + cu_version: cu102 + name: binary_win_wheel_py3.8_cu102 + python_version: '3.8' - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.6_cpu @@ -663,104 +676,104 @@ workflows: name: binary_macos_conda_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 -# - binary_win_conda: -# cu_version: cpu -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cpu -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu92 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu101 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu102 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cpu -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cpu -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu92 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu101 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu102 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cpu -# name: binary_win_conda_py3.8_cpu -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.8_cu92 -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.8_cu101 -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu102 -# name: binary_win_conda_py3.8_cu102 -# python_version: '3.8' + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cpu + python_version: '3.6' + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu92 + python_version: '3.6' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu101 + python_version: '3.6' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu102 + python_version: '3.6' + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cpu + python_version: '3.7' + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu92 + python_version: '3.7' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu101 + python_version: '3.7' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu102 + python_version: '3.7' + - binary_win_conda: + cu_version: cpu + name: binary_win_conda_py3.8_cpu + python_version: '3.8' + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.8_cu92 + python_version: '3.8' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.8_cu101 + python_version: '3.8' + - binary_win_conda: + cu_version: cu102 + name: binary_win_conda_py3.8_cu102 + python_version: '3.8' # - python_lint # - python_type_check # - clang_format @@ -1156,246 +1169,246 @@ workflows: requires: - nightly_binary_macos_wheel_py3.8_cpu subfolder: '' -# - binary_win_wheel: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cpu -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cpu_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cpu -# subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu92 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu101 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu102 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu102 -# subfolder: cu102/ -# - binary_win_wheel: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cpu -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cpu_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cpu -# subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu92 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu101 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu102 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu102 -# subfolder: cu102/ -# - binary_win_wheel: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cpu -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cpu_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cpu -# subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu92 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu101 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu102 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu102 -# subfolder: cu102/ + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cpu + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cpu_upload + requires: + - nightly_binary_win_wheel_py3.6_cpu + subfolder: cpu/ + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu92 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu92_upload + requires: + - nightly_binary_win_wheel_py3.6_cu92 + subfolder: cu92/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu101 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu101_upload + requires: + - nightly_binary_win_wheel_py3.6_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu102 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu102_upload + requires: + - nightly_binary_win_wheel_py3.6_cu102 + subfolder: cu102/ + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cpu + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cpu_upload + requires: + - nightly_binary_win_wheel_py3.7_cpu + subfolder: cpu/ + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu92 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu92_upload + requires: + - nightly_binary_win_wheel_py3.7_cu92 + subfolder: cu92/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu101 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu101_upload + requires: + - nightly_binary_win_wheel_py3.7_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu102 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu102_upload + requires: + - nightly_binary_win_wheel_py3.7_cu102 + subfolder: cu102/ + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cpu + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cpu_upload + requires: + - nightly_binary_win_wheel_py3.8_cpu + subfolder: cpu/ + - binary_win_wheel: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu92 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu92_upload + requires: + - nightly_binary_win_wheel_py3.8_cu92 + subfolder: cu92/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu101 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu101_upload + requires: + - nightly_binary_win_wheel_py3.8_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu102 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu102_upload + requires: + - nightly_binary_win_wheel_py3.8_cu102 + subfolder: cu102/ - binary_linux_conda: cu_version: cpu filters: @@ -1696,231 +1709,231 @@ workflows: name: nightly_binary_macos_conda_py3.8_cpu_upload requires: - nightly_binary_macos_conda_py3.8_cpu -# - binary_win_conda: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cpu -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cpu_upload -# requires: -# - nightly_binary_win_conda_py3.6_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu92 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu101 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu102 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu102 -# - binary_win_conda: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cpu -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cpu_upload -# requires: -# - nightly_binary_win_conda_py3.7_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu92 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu101 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu102 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu102 -# - binary_win_conda: -# cu_version: cpu -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cpu -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cpu_upload -# requires: -# - nightly_binary_win_conda_py3.8_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu92 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu101 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu102 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu102 + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cpu + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cpu_upload + requires: + - nightly_binary_win_conda_py3.6_cpu + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu92 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu92_upload + requires: + - nightly_binary_win_conda_py3.6_cu92 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu101 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu101_upload + requires: + - nightly_binary_win_conda_py3.6_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu102 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu102_upload + requires: + - nightly_binary_win_conda_py3.6_cu102 + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cpu + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cpu_upload + requires: + - nightly_binary_win_conda_py3.7_cpu + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu92 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu92_upload + requires: + - nightly_binary_win_conda_py3.7_cu92 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu101 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu101_upload + requires: + - nightly_binary_win_conda_py3.7_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu102 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu102_upload + requires: + - nightly_binary_win_conda_py3.7_cu102 + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cpu + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cpu_upload + requires: + - nightly_binary_win_conda_py3.8_cpu + - binary_win_conda: + cu_version: cu92 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu92 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu92_upload + requires: + - nightly_binary_win_conda_py3.8_cu92 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu101 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu101_upload + requires: + - nightly_binary_win_conda_py3.8_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu102 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu102_upload + requires: + - nightly_binary_win_conda_py3.8_cu102 diff --git a/packaging/vs2017/activate.bat b/packaging/vs2017/activate.bat new file mode 100644 index 0000000..ccecfc2 --- /dev/null +++ b/packaging/vs2017/activate.bat @@ -0,0 +1,44 @@ +:: Set env vars that tell distutils to use the compiler that we put on path +SET DISTUTILS_USE_SDK=1 +SET MSSdk=1 + +SET "VS_VERSION=15.0" +SET "VS_MAJOR=15" +SET "VS_YEAR=2017" + +set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out" +set "MSYS2_ENV_CONV_EXCL=CL" + +:: For Python 3.5+, ensure that we link with the dynamic runtime. See +:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info +set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime140.dll" + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [15^,16^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VSINSTALLDIR=%%i\" + goto :vswhere + ) +) + +:vswhere + +:: Shorten PATH to avoid the `input line too long` error. +SET MyPath=%PATH% + +setlocal EnableDelayedExpansion + +SET TempPath="%MyPath:;=";"%" +SET var= +FOR %%a IN (%TempPath%) DO ( + IF EXIST %%~sa ( + SET "var=!var!;%%~sa" + ) +) + +set "TempPath=!var:~1!" +endlocal & set "PATH=%TempPath%" + +:: Shorten current directory too +FOR %%A IN (.) DO CD "%%~sA" + +:: other things added by install_activate.bat at package build time diff --git a/packaging/vs2017/conda_build_config.yaml b/packaging/vs2017/conda_build_config.yaml new file mode 100644 index 0000000..5188bb0 --- /dev/null +++ b/packaging/vs2017/conda_build_config.yaml @@ -0,0 +1,24 @@ +blas_impl: + - mkl # [x86_64] +c_compiler: + - vs2017 # [win] +cxx_compiler: + - vs2017 # [win] +python: + - 3.5 + - 3.6 +# This differs from target_platform in that it determines what subdir the compiler +# will target, not what subdir the compiler package will be itself. +# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32 +# code on win-64 miniconda. +cross_compiler_target_platform: + - win-64 # [win] +target_platform: + - win-64 # [win] +vc: + - 14 +zip_keys: + - # [win] + - vc # [win] + - c_compiler # [win] + - cxx_compiler # [win] diff --git a/packaging/vs2017/install_activate.bat b/packaging/vs2017/install_activate.bat new file mode 100644 index 0000000..de0e6ff --- /dev/null +++ b/packaging/vs2017/install_activate.bat @@ -0,0 +1,30 @@ +set YEAR=2017 +set VER=15 + +mkdir "%PREFIX%\etc\conda\activate.d" +COPY "%RECIPE_DIR%\activate.bat" "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + +IF "%cross_compiler_target_platform%" == "win-64" ( + set "target_platform=amd64" + echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR% Win64" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + IF "%VSDEVCMD_ARGS%" == "" ( + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) ELSE ( + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) else ( + set "target_platform=x86" + echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvars32.bat" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd + ) + diff --git a/packaging/vs2017/install_runtime.bat b/packaging/vs2017/install_runtime.bat new file mode 100644 index 0000000..5163c16 --- /dev/null +++ b/packaging/vs2017/install_runtime.bat @@ -0,0 +1,49 @@ +set VC_PATH=x86 +if "%ARCH%"=="64" ( + set VC_PATH=x64 +) + +set MSC_VER=2017 + +rem :: This should always be present for VC installed with VS. Not sure about VC installed with Visual C++ Build Tools 2015 +rem FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VC\Servicing\14.0\IDE.x64" /v UpdateVersion`) DO ( +rem set SP=%%A +rem ) + +rem if not "%SP%" == "%PKG_VERSION%" ( +rem echo "Version detected from registry: %SP%" +rem echo "does not match version of package being built (%PKG_VERSION%)" +rem echo "Do you have current updates for VS 2015 installed?" +rem exit 1 +rem ) + + +REM ========== REQUIRES Win 10 SDK be installed, or files otherwise copied to location below! +robocopy "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\%VC_PATH%" "%LIBRARY_BIN%" *.dll /E +robocopy "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\%VC_PATH%" "%PREFIX%" *.dll /E +if %ERRORLEVEL% GEQ 8 exit 1 + +REM ========== This one comes from visual studio 2017 +set "VC_VER=141" + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [15^,16^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto :eof + ) +) + +@setlocal +call "%VS15VARSALL%" x64 + +set "REDIST_ROOT=%VCToolsRedistDir%%VC_PATH%" + +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.CRT" "%LIBRARY_BIN%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.CRT" "%PREFIX%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.OpenMP" "%LIBRARY_BIN%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.OpenMP" "%PREFIX%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +@endlocal diff --git a/packaging/vs2017/meta.yaml b/packaging/vs2017/meta.yaml new file mode 100644 index 0000000..1f56952 --- /dev/null +++ b/packaging/vs2017/meta.yaml @@ -0,0 +1,24 @@ +{% set vcver="14.1" %} +{% set vcfeature="14" %} +{% set vsyear="2017" %} +{% set fullver="15.4.27004.2010" %} + +package: + name: vs{{ vsyear }} + version: {{ fullver }} + +build: + skip: True [not win] + script_env: + - VSDEVCMD_ARGS # [win] + +outputs: + - name: vs{{ vsyear }}_{{ cross_compiler_target_platform }} + script: install_activate.bat + track_features: + # VS 2017 is binary-compatible with VS 2015/vc14. Tools are "v141". + strong: + - vc{{ vcfeature }} + about: + summary: Activation and version verification of MSVC {{ vcver }} (VS {{ vsyear }}) compiler + license: BSD 3-clause diff --git a/packaging/vs2019/activate.bat b/packaging/vs2019/activate.bat new file mode 100644 index 0000000..6f607ba --- /dev/null +++ b/packaging/vs2019/activate.bat @@ -0,0 +1,44 @@ +:: Set env vars that tell distutils to use the compiler that we put on path +SET DISTUTILS_USE_SDK=1 +SET MSSdk=1 + +SET "VS_VERSION=16.0" +SET "VS_MAJOR=16" +SET "VS_YEAR=2019" + +set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out" +set "MSYS2_ENV_CONV_EXCL=CL" + +:: For Python 3.5+, ensure that we link with the dynamic runtime. See +:: http://stevedower.id.au/blog/building-for-python-3-5-part-two/ for more info +set "PY_VCRUNTIME_REDIST=%PREFIX%\\bin\\vcruntime140.dll" + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [16^,17^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VSINSTALLDIR=%%i\" + goto :vswhere + ) +) + +:vswhere + +:: Shorten PATH to avoid the `input line too long` error. +SET MyPath=%PATH% + +setlocal EnableDelayedExpansion + +SET TempPath="%MyPath:;=";"%" +SET var= +FOR %%a IN (%TempPath%) DO ( + IF EXIST %%~sa ( + SET "var=!var!;%%~sa" + ) +) + +set "TempPath=!var:~1!" +endlocal & set "PATH=%TempPath%" + +:: Shorten current directory too +FOR %%A IN (.) DO CD "%%~sA" + +:: other things added by install_activate.bat at package build time diff --git a/packaging/vs2019/conda_build_config.yaml b/packaging/vs2019/conda_build_config.yaml new file mode 100644 index 0000000..358052e --- /dev/null +++ b/packaging/vs2019/conda_build_config.yaml @@ -0,0 +1,24 @@ +blas_impl: + - mkl # [x86_64] +c_compiler: + - vs2019 # [win] +cxx_compiler: + - vs2019 # [win] +python: + - 3.5 + - 3.6 +# This differs from target_platform in that it determines what subdir the compiler +# will target, not what subdir the compiler package will be itself. +# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32 +# code on win-64 miniconda. +cross_compiler_target_platform: + - win-64 # [win] +target_platform: + - win-64 # [win] +vc: + - 14 +zip_keys: + - # [win] + - vc # [win] + - c_compiler # [win] + - cxx_compiler # [win] diff --git a/packaging/vs2019/install_activate.bat b/packaging/vs2019/install_activate.bat new file mode 100644 index 0000000..3c38253 --- /dev/null +++ b/packaging/vs2019/install_activate.bat @@ -0,0 +1,30 @@ +set YEAR=2019 +set VER=16 + +mkdir "%PREFIX%\etc\conda\activate.d" +COPY "%RECIPE_DIR%\activate.bat" "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + +IF "%cross_compiler_target_platform%" == "win-64" ( + set "target_platform=amd64" + echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR% Win64" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + IF "%VSDEVCMD_ARGS%" == "" ( + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) ELSE ( + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 %VSDEVCMD_ARGS% >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) + echo popd >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + ) else ( + set "target_platform=x86" + echo SET "CMAKE_GENERATOR=Visual Studio %VER% %YEAR%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo pushd "%%VSINSTALLDIR%%" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo CALL "VC\Auxiliary\Build\vcvars32.bat" >> "%PREFIX%\etc\conda\activate.d\vs%YEAR%_compiler_vars.bat" + echo popd + ) + diff --git a/packaging/vs2019/install_runtime.bat b/packaging/vs2019/install_runtime.bat new file mode 100644 index 0000000..e09a5cc --- /dev/null +++ b/packaging/vs2019/install_runtime.bat @@ -0,0 +1,49 @@ +set VC_PATH=x86 +if "%ARCH%"=="64" ( + set VC_PATH=x64 +) + +set MSC_VER=2019 + +rem :: This should always be present for VC installed with VS. Not sure about VC installed with Visual C++ Build Tools 2015 +rem FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\DevDiv\VC\Servicing\14.0\IDE.x64" /v UpdateVersion`) DO ( +rem set SP=%%A +rem ) + +rem if not "%SP%" == "%PKG_VERSION%" ( +rem echo "Version detected from registry: %SP%" +rem echo "does not match version of package being built (%PKG_VERSION%)" +rem echo "Do you have current updates for VS 2015 installed?" +rem exit 1 +rem ) + + +REM ========== REQUIRES Win 10 SDK be installed, or files otherwise copied to location below! +robocopy "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\%VC_PATH%" "%LIBRARY_BIN%" *.dll /E +robocopy "C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\%VC_PATH%" "%PREFIX%" *.dll /E +if %ERRORLEVEL% GEQ 8 exit 1 + +REM ========== This one comes from visual studio 2019 +set "VC_VER=142" + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [16^,17^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto :eof + ) +) + +@setlocal +call "%VS15VARSALL%" x64 + +set "REDIST_ROOT=%VCToolsRedistDir%%VC_PATH%" + +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.CRT" "%LIBRARY_BIN%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.CRT" "%PREFIX%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.OpenMP" "%LIBRARY_BIN%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +robocopy "%REDIST_ROOT%\Microsoft.VC%VC_VER%.OpenMP" "%PREFIX%" *.dll /E +if %ERRORLEVEL% LSS 8 exit 0 +@endlocal diff --git a/packaging/vs2019/meta.yaml b/packaging/vs2019/meta.yaml new file mode 100644 index 0000000..94a0ed4 --- /dev/null +++ b/packaging/vs2019/meta.yaml @@ -0,0 +1,24 @@ +{% set vcver="14.2" %} +{% set vcfeature="14" %} +{% set vsyear="2019" %} +{% set fullver="15.4.27004.2010" %} + +package: + name: vs{{ vsyear }} + version: {{ fullver }} + +build: + skip: True [not win] + script_env: + - VSDEVCMD_ARGS # [win] + +outputs: + - name: vs{{ vsyear }}_{{ cross_compiler_target_platform }} + script: install_activate.bat + track_features: + # VS 2019 is binary-compatible with VS 2017/vc 14.1 and 2015/vc14. Tools are "v142". + strong: + - vc{{ vcfeature }} + about: + summary: Activation and version verification of MSVC {{ vcver }} (VS {{ vsyear }}) compiler + license: BSD 3-clause diff --git a/packaging/windows/internal/auth.bat b/packaging/windows/internal/auth.bat new file mode 100644 index 0000000..c874bce --- /dev/null +++ b/packaging/windows/internal/auth.bat @@ -0,0 +1,46 @@ +@echo off + +: From the following doc, the build won't be triggered if the users don't sign in daily. +: https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?tabs=yaml&view=vsts#my-build-didnt-run-what-happened +: To avoid this problem, we can just go through the sign in process using the following command. + +:auth_start + +if "%RETRY_TIMES%" == "" ( + set /a RETRY_TIMES=10 + set /a SLEEP_TIME=2 +) else ( + set /a RETRY_TIMES=%RETRY_TIMES%-1 + set /a SLEEP_TIME=%SLEEP_TIME%*2 +) + +for /f "usebackq tokens=*" %%i in (`curl -so NUL -w "%%{http_code}" -u %VSTS_AUTH% https://dev.azure.com/pytorch`) do ( + set STATUS_CODE=%%i +) + +IF NOT "%STATUS_CODE%" == "200" ( + echo Auth retry times remaining: %RETRY_TIMES% + echo Sleep time: %SLEEP_TIME% seconds + IF %RETRY_TIMES% EQU 0 ( + echo Auth failed + goto err + ) + waitfor SomethingThatIsNeverHappening /t %SLEEP_TIME% 2>nul || ver >nul + goto auth_start +) ELSE ( + echo Login Attempt Succeeded + goto auth_end +) + +:err + +: Throw a warning if it fails +powershell -c "Write-Warning 'Login Attempt Failed'" + +:auth_end + +set RETRY_TIMES= +set SLEEP_TIME= +set STATUS_CODE= + +exit /b 0 diff --git a/packaging/windows/internal/build_conda.bat b/packaging/windows/internal/build_conda.bat new file mode 100644 index 0000000..a5e5c43 --- /dev/null +++ b/packaging/windows/internal/build_conda.bat @@ -0,0 +1,15 @@ +if "%VC_YEAR%" == "2017" set VSDEVCMD_ARGS=-vcvars_ver=14.13 +if "%VC_YEAR%" == "2017" powershell packaging/windows/internal/vs2017_install.ps1 +if errorlevel 1 exit /b 1 + +call packaging/windows/internal/cuda_install.bat +if errorlevel 1 exit /b 1 + +call packaging/windows/internal/nightly_defaults.bat Conda +if errorlevel 1 exit /b 1 + +set PYTORCH_FINAL_PACKAGE_DIR=%CD%\packaging\windows\output +if not exist "%PYTORCH_FINAL_PACKAGE_DIR%" mkdir %PYTORCH_FINAL_PACKAGE_DIR% + +bash ./packaging/conda/build_csprng.sh %CUDA_VERSION% %TORCH_CSPRNG_BUILD_VERSION% %TORCH_CSPRNG_BUILD_NUMBER% +if errorlevel 1 exit /b 1 diff --git a/packaging/windows/internal/build_wheels.bat b/packaging/windows/internal/build_wheels.bat new file mode 100644 index 0000000..6d09d1a --- /dev/null +++ b/packaging/windows/internal/build_wheels.bat @@ -0,0 +1,12 @@ +if "%VC_YEAR%" == "2017" set VSDEVCMD_ARGS=-vcvars_ver=14.13 +if "%VC_YEAR%" == "2017" powershell packaging/windows/internal/vs2017_install.ps1 +if errorlevel 1 exit /b 1 + +call packaging/windows/internal/cuda_install.bat +if errorlevel 1 exit /b 1 + +call packaging/windows/internal/nightly_defaults.bat Wheels +if errorlevel 1 exit /b 1 + +call packaging/windows/build_csprng.bat %CUDA_VERSION% %TORCH_CSPRNG_BUILD_VERSION% %TORCH_CSPRNG_BUILD_NUMBER% +if errorlevel 1 exit /b 1 diff --git a/packaging/windows/internal/check_deps.bat b/packaging/windows/internal/check_deps.bat new file mode 100644 index 0000000..739e568 --- /dev/null +++ b/packaging/windows/internal/check_deps.bat @@ -0,0 +1,67 @@ +@echo off + +REM Check for necessary components + +IF NOT "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( + echo You should use 64 bits Windows to build and run PyTorch + exit /b 1 +) + +IF "%BUILD_CSPRNG%" == "" ( + where /q cmake.exe + + IF ERRORLEVEL 1 ( + echo CMake is required to compile PyTorch on Windows + exit /b 1 + ) +) + +IF NOT EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( + echo Visual Studio 2017 C++ BuildTools is required to compile PyTorch on Windows + exit /b 1 +) + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [15^,16^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15INSTALLDIR=%%i" + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto vswhere + ) +) + +:vswhere +IF "%VS15VCVARSALL%"=="" ( + echo Visual Studio 2017 C++ BuildTools is required to compile PyTorch on Windows + exit /b 1 +) + +set MSSdk=1 +set DISTUTILS_USE_SDK=1 + +where /q python.exe + +IF ERRORLEVEL 1 ( + echo Python x64 3.5 or up is required to compile PyTorch on Windows + exit /b 1 +) + +for /F "usebackq delims=" %%i in (`python -c "import sys; print('{0[0]}{0[1]}'.format(sys.version_info))"`) do ( + set /a PYVER=%%i +) + +if %PYVER% LSS 35 ( + echo Warning: PyTorch for Python 2 under Windows is experimental. + echo Python x64 3.5 or up is recommended to compile PyTorch on Windows + echo Maybe you can create a virual environment if you have conda installed: + echo ^> conda create -n test python=3.6 pyyaml mkl numpy + echo ^> activate test +) + +for /F "usebackq delims=" %%i in (`python -c "import struct;print( 8 * struct.calcsize('P'))"`) do ( + set /a PYSIZE=%%i +) + +if %PYSIZE% NEQ 64 ( + echo Python x64 3.5 or up is required to compile PyTorch on Windows + exit /b 1 +) diff --git a/packaging/windows/internal/check_opts.bat b/packaging/windows/internal/check_opts.bat new file mode 100644 index 0000000..003ad92 --- /dev/null +++ b/packaging/windows/internal/check_opts.bat @@ -0,0 +1,33 @@ +@echo off + +REM Check for optional components + +where /q ninja.exe + +IF NOT ERRORLEVEL 1 ( + echo Ninja found, using it to speed up builds + set CMAKE_GENERATOR=Ninja +) + +where /q clcache.exe + +IF NOT ERRORLEVEL 1 ( + echo clcache found, using it to speed up builds + set CC=clcache + set CXX=clcache +) + +where /q sccache.exe + +IF NOT ERRORLEVEL 1 ( + echo sccache found, using it to speed up builds + set CC=sccache cl + set CXX=sccache cl +) + +IF exist "%MKLProductDir%\mkl\lib\intel64_win" ( + echo MKL found, adding it to build + set "LIB=%MKLProductDir%\mkl\lib\intel64_win;%MKLProductDir%\compiler\lib\intel64_win;%LIB%"; +) + +exit /b 0 diff --git a/packaging/windows/internal/clean.bat b/packaging/windows/internal/clean.bat new file mode 100644 index 0000000..7489640 --- /dev/null +++ b/packaging/windows/internal/clean.bat @@ -0,0 +1,5 @@ +@echo off + +cd %MODULE_NAME% +python setup.py clean +cd .. diff --git a/packaging/windows/internal/clone.bat b/packaging/windows/internal/clone.bat new file mode 100644 index 0000000..fade37c --- /dev/null +++ b/packaging/windows/internal/clone.bat @@ -0,0 +1,56 @@ +@echo off + +:: The conda and wheels jobs are seperated on Windows, so we don't need to clone again. +IF "%BUILD_CSPRNG%" == "" ( + if exist "%NIGHTLIES_PYTORCH_ROOT%" ( + xcopy /E /Y /Q "%NIGHTLIES_PYTORCH_ROOT%" pytorch\ + cd pytorch + goto submodule + ) +) + +git clone https://github.com/%PYTORCH_REPO%/%MODULE_NAME% + +cd %MODULE_NAME% + +IF NOT "%BUILD_CSPRNG%" == "" goto latest_end + +IF "%PYTORCH_BRANCH%" == "latest" ( goto latest_start ) else ( goto latest_end ) + +:latest_start + +if "%NIGHTLIES_DATE%" == "" ( goto date_start ) else ( goto date_end ) + +:date_start + +set "DATE_CMD=Get-Date ([System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('Pacific Standard Time'))) -f 'yyyy_MM_dd'" +set "DATE_COMPACT_CMD=Get-Date ([System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('Pacific Standard Time'))) -f 'yyyyMMdd'" + +FOR /F "delims=" %%i IN ('powershell -c "%DATE_CMD%"') DO set NIGHTLIES_DATE=%%i +FOR /F "delims=" %%i IN ('powershell -c "%DATE_COMPACT_CMD%"') DO set NIGHTLIES_DATE_COMPACT=%%i + +:date_end + +if "%NIGHTLIES_DATE_COMPACT%" == "" set NIGHTLIES_DATE_COMPACT=%NIGHTLIES_DATE:~0,4%%NIGHTLIES_DATE:~5,2%%NIGHTLIES_DATE:~8,2% + +:: Switch to the latest commit by 11:59 yesterday +echo PYTORCH_BRANCH is set to latest so I will find the last commit +echo before 0:00 midnight on %NIGHTLIES_DATE% +set git_date=%NIGHTLIES_DATE:_=-% +FOR /F "delims=" %%i IN ('git log --before %git_date% -n 1 "--pretty=%%H"') DO set last_commit=%%i +echo Setting PYTORCH_BRANCH to %last_commit% since that was the last +echo commit before %NIGHTLIES_DATE% +set PYTORCH_BRANCH=%last_commit% + +:latest_end + +IF "%PYTORCH_BRANCH%" == "" ( + set PYTORCH_BRANCH=v%TORCH_CSPRNG_BUILD_VERSION% +) +git checkout %PYTORCH_BRANCH% +IF ERRORLEVEL 1 git checkout tags/%PYTORCH_BRANCH% + +:submodule + +git submodule update --init --recursive +IF ERRORLEVEL 1 exit /b 1 diff --git a/packaging/windows/internal/copy.bat b/packaging/windows/internal/copy.bat new file mode 100644 index 0000000..b4aa397 --- /dev/null +++ b/packaging/windows/internal/copy.bat @@ -0,0 +1,13 @@ +copy "%CUDA_PATH%\bin\cusparse64_%CUDA_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\cublas64_%CUDA_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\cudart64_%CUDA_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\curand64_%CUDA_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\cufft64_%CUDA_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\cufftw64_%CUDA_VERSION%.dll*" pytorch\torch\lib + +copy "%CUDA_PATH%\bin\cudnn64_%CUDNN_VERSION%.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\nvrtc64_%CUDA_VERSION%*.dll*" pytorch\torch\lib +copy "%CUDA_PATH%\bin\nvrtc-builtins64_%CUDA_VERSION%.dll*" pytorch\torch\lib + +copy "C:\Program Files\NVIDIA Corporation\NvToolsExt\bin\x64\nvToolsExt64_1.dll*" pytorch\torch\lib +copy "%CONDA_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib diff --git a/packaging/windows/internal/copy_cpu.bat b/packaging/windows/internal/copy_cpu.bat new file mode 100644 index 0000000..f5b9d11 --- /dev/null +++ b/packaging/windows/internal/copy_cpu.bat @@ -0,0 +1 @@ +copy "%CONDA_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib diff --git a/packaging/windows/internal/cuda_install.bat b/packaging/windows/internal/cuda_install.bat new file mode 100644 index 0000000..15ea785 --- /dev/null +++ b/packaging/windows/internal/cuda_install.bat @@ -0,0 +1,143 @@ +@echo on + +if "%CU_VERSION%" == "cpu" ( + echo Skipping for CPU builds + exit /b 0 +) + +set SRC_DIR=%~dp0\.. + +if not exist "%SRC_DIR%\temp_build" mkdir "%SRC_DIR%\temp_build" + +set /a CUDA_VER=%CU_VERSION:cu=% +set CUDA_VER_MAJOR=%CUDA_VER:~0,-1% +set CUDA_VER_MINOR=%CUDA_VER:~-1,1% +set CUDA_VERSION_STR=%CUDA_VER_MAJOR%.%CUDA_VER_MINOR% + +if %CUDA_VER% EQU 92 goto cuda92 +if %CUDA_VER% EQU 100 goto cuda100 +if %CUDA_VER% EQU 101 goto cuda101 +if %CUDA_VER% EQU 102 goto cuda102 + +echo CUDA %CUDA_VERSION_STR% is not supported +exit /b 1 + +:cuda92 +if not exist "%SRC_DIR%\temp_build\cuda_9.2.148_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/win2016/cuda_9.2.148_win10.exe --output "%SRC_DIR%\temp_build\cuda_9.2.148_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_9.2.148_win10.exe" + set "ARGS=nvcc_9.2 cuobjdump_9.2 nvprune_9.2 cupti_9.2 cublas_9.2 cublas_dev_9.2 cudart_9.2 cufft_9.2 cufft_dev_9.2 curand_9.2 curand_dev_9.2 cusolver_9.2 cusolver_dev_9.2 cusparse_9.2 cusparse_dev_9.2 nvgraph_9.2 nvgraph_dev_9.2 npp_9.2 npp_dev_9.2 nvrtc_9.2 nvrtc_dev_9.2 nvml_dev_9.2" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-9.2-windows10-x64-v7.2.1.38.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/win2016/cudnn-9.2-windows10-x64-v7.2.1.38.zip --output "%SRC_DIR%\temp_build\cudnn-9.2-windows10-x64-v7.2.1.38.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-9.2-windows10-x64-v7.2.1.38.zip" +) + +goto cuda_common + +:cuda100 + +if not exist "%SRC_DIR%\temp_build\cuda_10.0.130_411.31_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/win2016/cuda_10.0.130_411.31_win10.exe --output "%SRC_DIR%\temp_build\cuda_10.0.130_411.31_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_10.0.130_411.31_win10.exe" + set "ARGS=nvcc_10.0 cuobjdump_10.0 nvprune_10.0 cupti_10.0 cublas_10.0 cublas_dev_10.0 cudart_10.0 cufft_10.0 cufft_dev_10.0 curand_10.0 curand_dev_10.0 cusolver_10.0 cusolver_dev_10.0 cusparse_10.0 cusparse_dev_10.0 nvgraph_10.0 nvgraph_dev_10.0 npp_10.0 npp_dev_10.0 nvrtc_10.0 nvrtc_dev_10.0 nvml_dev_10.0" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-10.0-windows10-x64-v7.4.1.5.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/win2016/cudnn-10.0-windows10-x64-v7.4.1.5.zip --output "%SRC_DIR%\temp_build\cudnn-10.0-windows10-x64-v7.4.1.5.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-10.0-windows10-x64-v7.4.1.5.zip" +) + +goto cuda_common + +:cuda101 + +if not exist "%SRC_DIR%\temp_build\cuda_10.1.243_426.00_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cuda_10.1.243_426.00_win10.exe --output "%SRC_DIR%\temp_build\cuda_10.1.243_426.00_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_10.1.243_426.00_win10.exe" + set "ARGS=nvcc_10.1 cuobjdump_10.1 nvprune_10.1 cupti_10.1 cublas_10.1 cublas_dev_10.1 cudart_10.1 cufft_10.1 cufft_dev_10.1 curand_10.1 curand_dev_10.1 cusolver_10.1 cusolver_dev_10.1 cusparse_10.1 cusparse_dev_10.1 nvgraph_10.1 nvgraph_dev_10.1 npp_10.1 npp_dev_10.1 nvrtc_10.1 nvrtc_dev_10.1 nvml_dev_10.1" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-10.1-windows10-x64-v7.6.4.38.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-10.1-windows10-x64-v7.6.4.38.zip --output "%SRC_DIR%\temp_build\cudnn-10.1-windows10-x64-v7.6.4.38.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-10.1-windows10-x64-v7.6.4.38.zip" +) + +goto cuda_common + +:cuda102 + +if not exist "%SRC_DIR%\temp_build\cuda_10.2.89_441.22_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cuda_10.2.89_441.22_win10.exe --output "%SRC_DIR%\temp_build\cuda_10.2.89_441.22_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_10.2.89_441.22_win10.exe" + set "ARGS=nvcc_10.2 cuobjdump_10.2 nvprune_10.2 cupti_10.2 cublas_10.2 cublas_dev_10.2 cudart_10.2 cufft_10.2 cufft_dev_10.2 curand_10.2 curand_dev_10.2 cusolver_10.2 cusolver_dev_10.2 cusparse_10.2 cusparse_dev_10.2 nvgraph_10.2 nvgraph_dev_10.2 npp_10.2 npp_dev_10.2 nvrtc_10.2 nvrtc_dev_10.2 nvml_dev_10.2" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-10.2-windows10-x64-v7.6.5.32.zip --output "%SRC_DIR%\temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip" +) + +goto cuda_common + +:cuda_common + +if not exist "%SRC_DIR%\temp_build\NvToolsExt.7z" ( + curl -k -L https://www.dropbox.com/s/9mcolalfdj4n979/NvToolsExt.7z?dl=1 --output "%SRC_DIR%\temp_build\NvToolsExt.7z" + if errorlevel 1 exit /b 1 +) + +if not exist "%SRC_DIR%\temp_build\gpu_driver_dlls.7z" ( + curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "%SRC_DIR%\temp_build\gpu_driver_dlls.zip" + if errorlevel 1 exit /b 1 +) + +echo Installing CUDA toolkit... +7z x %CUDA_SETUP_FILE% -o"%SRC_DIR%\temp_build\cuda" +pushd "%SRC_DIR%\temp_build\cuda" +start /wait setup.exe -s %ARGS% +popd + +echo Installing VS integration... +xcopy /Y "%SRC_DIR%\temp_build\cuda\CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions\*.*" "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\BuildCustomizations" + +echo Installing NvToolsExt... +7z x %SRC_DIR%\temp_build\NvToolsExt.7z -o"%SRC_DIR%\temp_build\NvToolsExt" +mkdir "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\bin\x64" +mkdir "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\include" +mkdir "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\lib\x64" +xcopy /Y "%SRC_DIR%\temp_build\NvToolsExt\bin\x64\*.*" "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\bin\x64" +xcopy /Y "%SRC_DIR%\temp_build\NvToolsExt\include\*.*" "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\include" +xcopy /Y "%SRC_DIR%\temp_build\NvToolsExt\lib\x64\*.*" "%ProgramFiles%\NVIDIA Corporation\NvToolsExt\lib\x64" + +echo Setting up environment... +set "PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\libnvvp;%PATH%" +set "CUDA_PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%" +set "CUDA_PATH_V%CUDA_VER_MAJOR%_%CUDA_VER_MINOR%=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%" +set "NVTOOLSEXT_PATH=%ProgramFiles%\NVIDIA Corporation\NvToolsExt\bin\x64" + +if not exist "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\bin\nvcc.exe" ( + echo CUDA %CUDA_VERSION_STR% installed failed. + exit /b 1 +) + +echo Installing cuDNN... +7z x %CUDNN_SETUP_FILE% -o"%SRC_DIR%\temp_build\cudnn" +xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\bin\*.*" "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\bin" +xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\lib\x64\*.*" "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\lib\x64" +xcopy /Y "%SRC_DIR%\temp_build\cudnn\cuda\include\*.*" "%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v%CUDA_VERSION_STR%\include" + +echo Installing GPU driver DLLs +7z x %SRC_DIR%\temp_build\gpu_driver_dlls.zip -o"C:\Windows\System32" + +echo Cleaning temp files +rd /s /q "%SRC_DIR%\temp_build" || ver > nul diff --git a/packaging/windows/internal/dep_install.bat b/packaging/windows/internal/dep_install.bat new file mode 100644 index 0000000..db665a9 --- /dev/null +++ b/packaging/windows/internal/dep_install.bat @@ -0,0 +1,14 @@ +@echo off + +REM curl -k https://www.7-zip.org/a/7z1805-x64.exe -O +REM if errorlevel 1 exit /b 1 + +REM start /wait 7z1805-x64.exe /S +REM if errorlevel 1 exit /b 1 + +REM set "PATH=%ProgramFiles%\7-Zip;%PATH%" + +choco feature disable --name showDownloadProgress +choco feature enable --name allowGlobalConfirmation + +choco install curl 7zip diff --git a/packaging/windows/internal/env_fix.bat b/packaging/windows/internal/env_fix.bat new file mode 100644 index 0000000..dd0aaf5 --- /dev/null +++ b/packaging/windows/internal/env_fix.bat @@ -0,0 +1,31 @@ +@echo off + +:: Caution: Please don't use this script locally +:: It may destroy your build environment. + +setlocal + +IF NOT EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( + echo Visual Studio 2017 C++ BuildTools is required to compile PyTorch on Windows + exit /b 1 +) + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [15^,16^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15INSTALLDIR=%%i" + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto vswhere + ) +) + +:vswhere + +IF "%VS15VCVARSALL%"=="" ( + echo Visual Studio 2017 C++ BuildTools is required to compile PyTorch on Windows + exit /b 1 +) + +call "%VS15VCVARSALL%" x86_amd64 +for /f "usebackq tokens=*" %%i in (`where link.exe`) do move "%%i" "%%i.bak" + +endlocal diff --git a/packaging/windows/internal/nightly_defaults.bat b/packaging/windows/internal/nightly_defaults.bat new file mode 100644 index 0000000..dcef72f --- /dev/null +++ b/packaging/windows/internal/nightly_defaults.bat @@ -0,0 +1,200 @@ +@echo on + +if "%~1"=="" goto arg_error +if NOT "%~2"=="" goto arg_error +goto arg_end + +:arg_error + +echo Illegal number of parameters. Pass packge type `Conda` or `Wheels`. +exit /b 1 + +:arg_end + +echo "nightly_defaults.bat at %CD% starting at %DATE%" + +set SRC_DIR=%~dp0\.. + +:: NIGHTLIES_FOLDER +:: N.B. this is also defined in cron_start.sh +:: An arbitrary root folder to store all nightlies folders, each of which is a +:: parent level date folder with separate subdirs for logs, wheels, conda +:: packages, etc. This should be kept the same across all scripts called in a +:: cron job, so it only has a default value in the top-most script +:: build_cron.sh to avoid the default values from diverging. +if "%NIGHTLIES_FOLDER%" == "" set "NIGHTLIES_FOLDER=%SRC_DIR%" + +:: NIGHTLIES_DATE +:: N.B. this is also defined in cron_start.sh +:: The date in YYYY_mm_dd format that we are building for. If this is not +:: already set, then this will first try to find the date of the nightlies +:: folder that this builder repo exists in; e.g. if this script exists in +:: some_dir/2019_09_04/builder/cron/ then this will be set to 2019_09_04 (must +:: match YYYY_mm_dd). This is for convenience when debugging/uploading past +:: dates, so that you don't have to set NIGHTLIES_DATE yourself. If a date +:: folder cannot be found in that exact location, then this will default to +:: the current date. + + +if "%NIGHTLIES_DATE%" == "" ( goto date_start ) else ( goto date_end ) + +:date_start + +set "DATE_CMD=Get-Date ([System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('Pacific Standard Time'))) -f 'yyyy_MM_dd'" +set "DATE_COMPACT_CMD=Get-Date ([System.TimeZoneInfo]::ConvertTimeFromUtc((Get-Date).ToUniversalTime(), [System.TimeZoneInfo]::FindSystemTimeZoneById('Pacific Standard Time'))) -f 'yyyyMMdd'" + +FOR /F "delims=" %%i IN ('powershell -c "%DATE_CMD%"') DO set NIGHTLIES_DATE=%%i +FOR /F "delims=" %%i IN ('powershell -c "%DATE_COMPACT_CMD%"') DO set NIGHTLIES_DATE_COMPACT=%%i + +:date_end + +if "%NIGHTLIES_DATE_COMPACT%" == "" set NIGHTLIES_DATE_COMPACT=%NIGHTLIES_DATE:~0,4%%NIGHTLIES_DATE:~5,2%%NIGHTLIES_DATE:~8,2% + +:: Used in lots of places as the root dir to store all conda/wheel/manywheel +:: packages as well as logs for the day +set today=%NIGHTLIES_FOLDER%\%NIGHTLIES_DATE% +mkdir "%today%" || ver >nul + + +::############################################################################# +:: Add new configuration variables below this line. 'today' should always be +:: defined ASAP to avoid weird errors +::############################################################################# + + +:: List of people to email when things go wrong. This is passed directly to +:: `mail -t` +:: TODO: Not supported yet +if "%NIGHTLIES_EMAIL_LIST%" == "" set NIGHTLIES_EMAIL_LIST=peterghost86@gmail.com + +:: PYTORCH_CREDENTIALS_FILE +:: A bash file that exports credentials needed to upload to aws and anaconda. +:: Needed variables are PYTORCH_ANACONDA_USERNAME, PYTORCH_ANACONDA_PASSWORD, +:: AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY. Or it can just export the AWS +:: keys and then prepend a logged-in conda installation to the path. +:: TODO: Not supported yet +if "%PYTORCH_CREDENTIALS_FILE%" == "" set PYTORCH_CREDENTIALS_FILE=/c/Users/administrator/nightlies/credentials.sh + +:: Location of the temporary miniconda that is downloaded to install conda-build +:: and aws to upload finished packages TODO this is messy to install this in +:: upload.sh and later use it in upload_logs.sh +if "%CONDA_UPLOADER_INSTALLATION%" == "" set "CONDA_UPLOADER_INSTALLATION=%today%\miniconda" + +:: N.B. BUILDER_REPO and BUILDER_BRANCH are both set in cron_start.sh, as that +:: is the script that actually clones the builder repo that /this/ script is +:: running from. +pushd "%SRC_DIR%\.." +set NIGHTLIES_BUILDER_ROOT=%CD% +popd + +:: The shared pytorch repo to be used by all builds +if "%NIGHTLIES_PYTORCH_ROOT%" == "" set "NIGHTLIES_PYTORCH_ROOT=%today%\csprng" + +:: PYTORCH_REPO +:: The Github org/user whose fork of Pytorch to check out (git clone +:: https://github.com//pytorch.git). This will always be cloned +:: fresh to build with. Default is 'pytorch' +if "%PYTORCH_REPO%" == "" set PYTORCH_REPO=pytorch + +:: PYTORCH_BRANCH +:: The branch of Pytorch to checkout for building (git checkout ). +:: This can either be the name of the branch (e.g. git checkout +:: my_branch_name) or can be a git commit (git checkout 4b2674n...). Default +:: is 'latest', which is a special term that signals to pull the last commit +:: before 0:00 midnight on the NIGHTLIES_DATE +if "%PYTORCH_BRANCH%" == "" set PYTORCH_BRANCH=nightly + +:: Clone the requested pytorch checkout +if exist "%NIGHTLIES_PYTORCH_ROOT%" ( goto clone_end ) else ( goto clone_start ) + +:clone_start + +git clone --recursive "https://github.com/%PYTORCH_REPO%/csprng.git" "%NIGHTLIES_PYTORCH_ROOT%" +pushd "%NIGHTLIES_PYTORCH_ROOT%" + +if "%PYTORCH_BRANCH%" == "latest" ( goto latest_start ) else ( goto latest_end ) + +:latest_start + +:: Switch to the latest commit by 11:59 yesterday +echo PYTORCH_BRANCH is set to latest so I will find the last commit +echo before 0:00 midnight on %NIGHTLIES_DATE% +set git_date=%NIGHTLIES_DATE:_=-% +FOR /F "delims=" %%i IN ('git log --before %git_date% -n 1 "--pretty=%%H"') DO set last_commit=%%i +echo Setting PYTORCH_BRANCH to %last_commit% since that was the last +echo commit before %NIGHTLIES_DATE% +set PYTORCH_BRANCH=%last_commit% + +:latest_end + +git checkout "%PYTORCH_BRANCH%" +git submodule update +popd + +:clone_end + +if "%CUDA_VERSION%" == "cpu" ( + set _DESIRED_CUDA=cpu +) else ( + set _DESIRED_CUDA=cu%CUDA_VERSION% +) + +:: PYTORCH_BUILD_VERSION +:: The actual version string. Used in conda like +:: pytorch-nightly==1.0.0.dev20180908 +:: or in manylinux like +:: torch_nightly-1.0.0.dev20180908-cp27-cp27m-linux_x86_64.whl +if "%TORCH_CSPRNG_BUILD_VERSION%" == "" set TORCH_CSPRNG_BUILD_VERSION=0.8.0.dev%NIGHTLIES_DATE_COMPACT% + +if "%~1" == "Wheels" ( + if not "%CUDA_VERSION%" == "102" ( + set TORCH_CSPRNG_BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION%+%_DESIRED_CUDA% + ) +) + +:: PYTORCH_BUILD_NUMBER +:: This is usually the number 1. If more than one build is uploaded for the +:: same version/date, then this can be incremented to 2,3 etc in which case +:: '.post2' will be appended to the version string of the package. This can +:: be set to '0' only if OVERRIDE_PACKAGE_VERSION is being used to bypass +:: all the version string logic in downstream scripts. Since we use the +:: override below, exporting this shouldn't actually matter. +if "%TORCH_CSPRNG_BUILD_NUMBER%" == "" set /a TORCH_CSPRNG_BUILD_NUMBER=1 +if %TORCH_CSPRNG_BUILD_NUMBER% GTR 1 set TORCH_CSPRNG_BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION%%TORCH_CSPRNG_BUILD_NUMBER% + +:: The nightly builds use their own versioning logic, so we override whatever +:: logic is in setup.py or other scripts +:: TODO: Not supported yet +set OVERRIDE_PACKAGE_VERSION=%TORCH_CSPRNG_BUILD_VERSION% +set BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION% + +:: Build folder for conda builds to use +if "%TORCH_CONDA_BUILD_FOLDER%" == "" set TORCH_CONDA_BUILD_FOLDER=torch_csprng + +:: TORCH_PACKAGE_NAME +:: The name of the package to upload. This should probably be pytorch or +:: pytorch-nightly. N.B. that pip will change all '-' to '_' but conda will +:: not. This is dealt with in downstream scripts. +:: TODO: Not supported yet +if "%TORCH_PACKAGE_NAME%" == "" set TORCH_PACKAGE_NAME=torch_csprng + +:: PIP_UPLOAD_FOLDER should end in a slash. This is to handle it being empty +:: (when uploading to e.g. whl/cpu/) and also to handle nightlies (when +:: uploading to e.g. /whl/nightly/cpu) +:: TODO: Not supported yet +if "%PIP_UPLOAD_FOLDER%" == "" set "PIP_UPLOAD_FOLDER=nightly\" + +:: The location of the binary_sizes dir in s3 is hardcoded into +:: upload_binary_sizes.sh + +:: DAYS_TO_KEEP +:: How many days to keep around for clean.sh. Build folders older than this +:: will be purged at the end of cron jobs. '1' means to keep only the current +:: day. Values less than 1 are not allowed. The default is 5. +:: TODO: Not supported yet +if "%DAYS_TO_KEEP%" == "" set /a DAYS_TO_KEEP=5 +if %DAYS_TO_KEEP% LSS 1 ( + echo DAYS_TO_KEEP cannot be less than 1. + echo A value of 1 means to only keep the build for today + exit /b 1 +) diff --git a/packaging/windows/internal/publish.bat b/packaging/windows/internal/publish.bat new file mode 100644 index 0000000..7e820d7 --- /dev/null +++ b/packaging/windows/internal/publish.bat @@ -0,0 +1,89 @@ +@echo off + +set SRC_DIR=%~dp0 +pushd %SRC_DIR% + +if NOT "%CUDA_VERSION%" == "cpu" ( + set PACKAGE_SUFFIX=_cuda%CUDA_VERSION% +) else ( + set PACKAGE_SUFFIX= +) + +if "%PACKAGEFULLNAME%" == "Conda" ( + set PACKAGE=conda +) else ( + set PACKAGE=wheels +) + +if not defined PACKAGE_SUFFIX ( + set PUBLISH_BRANCH=csprng_%PACKAGE%_%DESIRED_PYTHON% +) else ( + set PUBLISH_BRANCH=csprng_%PACKAGE%_%DESIRED_PYTHON%%PACKAGE_SUFFIX% +) + +git clone %ARTIFACT_REPO_URL% -b %PUBLISH_BRANCH% --single-branch >nul 2>&1 + +IF ERRORLEVEL 1 ( + echo Branch %PUBLISH_BRANCH% not exist, falling back to master + set NO_BRANCH=1 + git clone %ARTIFACT_REPO_URL% -b master --single-branch >nul 2>&1 +) + +IF ERRORLEVEL 1 ( + echo Clone failed + goto err +) + +cd pytorch_builder +attrib -s -h -r . /s /d + +:: Empty repo +rd /s /q . || ver >nul + +IF NOT EXIST %PACKAGE% mkdir %PACKAGE% + +xcopy /S /E /Y ..\..\output\*.* %PACKAGE%\ + +git config --global user.name "Azure DevOps" +git config --global user.email peterghost86@gmail.com +git init +git checkout --orphan %PUBLISH_BRANCH% +git remote add origin %ARTIFACT_REPO_URL% +git add . +git commit -m "Update artifacts" + +:push + +if "%RETRY_TIMES%" == "" ( + set /a RETRY_TIMES=10 + set /a SLEEP_TIME=2 +) else ( + set /a RETRY_TIMES=%RETRY_TIMES%-1 + set /a SLEEP_TIME=%SLEEP_TIME%*2 +) + +git push origin %PUBLISH_BRANCH% -f > nul 2>&1 + +IF ERRORLEVEL 1 ( + echo Git push retry times remaining: %RETRY_TIMES% + echo Sleep time: %SLEEP_TIME% seconds + IF %RETRY_TIMES% EQU 0 ( + echo Push failed + goto err + ) + waitfor SomethingThatIsNeverHappening /t %SLEEP_TIME% 2>nul || ver >nul + goto push +) ELSE ( + set RETRY_TIMES= + set SLEEP_TIME= +) + +popd + +exit /b 0 + +:err + +popd + +exit /b 1 diff --git a/packaging/windows/internal/setup.bat b/packaging/windows/internal/setup.bat new file mode 100644 index 0000000..96cb7fb --- /dev/null +++ b/packaging/windows/internal/setup.bat @@ -0,0 +1,44 @@ +@echo off + +echo The flags after configuring: +echo NO_CUDA=%NO_CUDA% +echo CMAKE_GENERATOR=%CMAKE_GENERATOR% +if "%NO_CUDA%"=="" echo CUDA_PATH=%CUDA_PATH% +if NOT "%CC%"=="" echo CC=%CC% +if NOT "%CXX%"=="" echo CXX=%CXX% +if NOT "%DISTUTILS_USE_SDK%"=="" echo DISTUTILS_USE_SDK=%DISTUTILS_USE_SDK% + +set SRC_DIR=%~dp0\.. + +IF "%VSDEVCMD_ARGS%" == "" ( + call "%VS15VCVARSALL%" x64 +) ELSE ( + call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% +) + +pushd %SRC_DIR% + +IF NOT exist "setup.py" ( + cd %MODULE_NAME% +) + +if "%CXX%"=="sccache cl" ( + sccache --stop-server + sccache --start-server + sccache --zero-stats +) + +:pytorch +:: This stores in e.g. D:/_work/1/s/windows/output/cpu +pip wheel -e . --no-deps --wheel-dir ../output + +:build_end +IF ERRORLEVEL 1 exit /b 1 +IF NOT ERRORLEVEL 0 exit /b 1 + +if "%CXX%"=="sccache cl" ( + taskkill /im sccache.exe /f /t || ver > nul + taskkill /im nvcc.exe /f /t || ver > nul +) + +cd .. diff --git a/packaging/windows/internal/test.bat b/packaging/windows/internal/test.bat new file mode 100644 index 0000000..2f6497c --- /dev/null +++ b/packaging/windows/internal/test.bat @@ -0,0 +1,79 @@ +@echo off + +set SRC_DIR=%~dp0\.. +pushd %SRC_DIR% + +set PYTHON_VERSION=%PYTHON_PREFIX:py=cp% + +if "%BUILD_CSPRNG%" == "" ( + pip install future pytest coverage hypothesis protobuf +) ELSE ( + pip install future pytest "pillow>=4.1.1" +) + +for /F "delims=" %%i in ('where /R %SRC_DIR%\output *%MODULE_NAME%*%PYTHON_VERSION%*.whl') do pip install "%%i" + +if ERRORLEVEL 1 exit /b 1 + +if NOT "%BUILD_CSPRNG%" == "" ( + echo Smoke testing imports + python -c "import torch_csprng" + if ERRORLEVEL 1 exit /b 1 + goto smoke_test_end +) + +echo Smoke testing imports +python -c "import torch" +if ERRORLEVEL 1 exit /b 1 + +python -c "from caffe2.python import core" +if ERRORLEVEL 1 exit /b 1 + +echo Checking that MKL is available +python -c "import torch; exit(0 if torch.backends.mkl.is_available() else 1)" +if ERRORLEVEL 1 exit /b 1 + +setlocal EnableDelayedExpansion +set NVIDIA_GPU_EXISTS=0 +for /F "delims=" %%i in ('wmic path win32_VideoController get name') do ( + set GPUS=%%i + if not "x!GPUS:NVIDIA=!" == "x!GPUS!" ( + SET NVIDIA_GPU_EXISTS=1 + goto gpu_check_end + ) +) +:gpu_check_end +endlocal & set NVIDIA_GPU_EXISTS=%NVIDIA_GPU_EXISTS% + +if NOT "%CUDA_PREFIX%" == "cpu" if "%NVIDIA_GPU_EXISTS%" == "1" ( + echo Checking that CUDA archs are setup correctly + python -c "import torch; torch.randn([3,5]).cuda()" + if ERRORLEVEL 1 exit /b 1 + + echo Checking that magma is available + python -c "import torch; torch.rand(1).cuda(); exit(0 if torch.cuda.has_magma else 1)" + if ERRORLEVEL 1 exit /b 1 + + echo Checking that CuDNN is available + python -c "import torch; exit(0 if torch.backends.cudnn.is_available() else 1)" + if ERRORLEVEL 1 exit /b 1 +) +:smoke_test_end + +echo Not running unit tests. Hopefully these problems are caught by CI +goto test_end + +if "%BUILD_CSPRNG%" == "" ( + cd pytorch\test + python run_test.py -v +) else ( + cd csprng + pytest . +) + +if ERRORLEVEL 1 exit /b 1 + +:test_end + +popd +exit /b 0 diff --git a/packaging/windows/internal/upload.bat b/packaging/windows/internal/upload.bat new file mode 100644 index 0000000..f78fe0b --- /dev/null +++ b/packaging/windows/internal/upload.bat @@ -0,0 +1,96 @@ +@echo off + +IF "%CONDA_UPLOADER_INSTALLATION%" == "" goto precheck_fail +IF "%PYTORCH_FINAL_PACKAGE_DIR%" == "" goto precheck_fail +IF "%today%" == "" goto precheck_fail +IF "%PYTORCH_ANACONDA_USERNAME%" == "" goto precheck_fail +IF "%PYTORCH_ANACONDA_PASSWORD%" == "" goto precheck_fail + +goto precheck_pass + +:precheck_fail + +echo Please run nightly_defaults.bat first. +echo And remember to set `PYTORCH_FINAL_PACKAGE_DIR` +echo Finally, don't forget to set anaconda tokens +exit /b 1 + +:precheck_pass + +pushd %today% + +:: Install anaconda client +set "CONDA_HOME=%CONDA_UPLOADER_INSTALLATION%" +set "tmp_conda=%CONDA_HOME%" +set "miniconda_exe=%CD%\miniconda.exe" +rmdir /s /q "%CONDA_HOME%" +del miniconda.exe +curl -k https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe -o "%miniconda_exe%" +popd + +IF ERRORLEVEL 1 ( + echo Conda download failed + exit /b 1 +) + +call %~dp0\..\..\conda\install_conda.bat + +IF ERRORLEVEL 1 ( + echo Conda installation failed + exit /b 1 +) + +set "ORIG_PATH=%PATH%" +set "PATH=%CONDA_HOME%;%CONDA_HOME%\scripts;%CONDA_HOME%\Library\bin;%PATH%" + +REM conda install -y anaconda-client +pip install git+https://github.com/peterjc123/anaconda-client.git@log_more_meaningfull_errors +IF ERRORLEVEL 1 ( + echo Anaconda client installation failed + exit /b 1 +) + +set PYTORCH_FINAL_PACKAGE= +:: Upload all the packages under `PYTORCH_FINAL_PACKAGE_DIR` +FOR /F "delims=" %%i IN ('where /R %PYTORCH_FINAL_PACKAGE_DIR% *csprng*.tar.bz2') DO ( + set "PYTORCH_FINAL_PACKAGE=%%i" +) + +IF "%PYTORCH_FINAL_PACKAGE%" == "" ( + echo No package to upload + exit /b 0 +) + +:upload + +if "%RETRY_TIMES%" == "" ( + set /a RETRY_TIMES=10 + set /a SLEEP_TIME=2 +) else ( + set /a RETRY_TIMES=%RETRY_TIMES%-1 + set /a SLEEP_TIME=%SLEEP_TIME%*2 +) + +REM bash -c "yes | anaconda login --username "%PYTORCH_ANACONDA_USERNAME%" --password "%PYTORCH_ANACONDA_PASSWORD%"" +anaconda login --username "%PYTORCH_ANACONDA_USERNAME%" --password "%PYTORCH_ANACONDA_PASSWORD%" +IF ERRORLEVEL 1 ( + echo Anaconda client login failed + exit /b 1 +) + +echo Uploading %PYTORCH_FINAL_PACKAGE% to Anaconda Cloud +anaconda upload "%PYTORCH_FINAL_PACKAGE%" -u pytorch-nightly --label main --force --no-progress + +IF ERRORLEVEL 1 ( + echo Anaconda upload retry times remaining: %RETRY_TIMES% + echo Sleep time: %SLEEP_TIME% seconds + IF %RETRY_TIMES% EQU 0 ( + echo Upload failed + exit /b 1 + ) + waitfor SomethingThatIsNeverHappening /t %SLEEP_TIME% 2>nul || ver >nul + goto upload +) ELSE ( + set RETRY_TIMES= + set SLEEP_TIME= +) diff --git a/packaging/windows/internal/vc_env_helper.bat b/packaging/windows/internal/vc_env_helper.bat new file mode 100644 index 0000000..e85a372 --- /dev/null +++ b/packaging/windows/internal/vc_env_helper.bat @@ -0,0 +1,43 @@ +@echo on + +set VC_VERSION_LOWER=16 +set VC_VERSION_UPPER=17 +if "%VC_YEAR%" == "2017" ( + set VC_VERSION_LOWER=15 + set VC_VERSION_UPPER=16 +) + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15INSTALLDIR=%%i" + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto vswhere + ) +) + +:vswhere +if "%VSDEVCMD_ARGS%" == "" ( + call "%VS15VCVARSALL%" x64 || exit /b 1 +) else ( + call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1 +) + +@echo on + +set DISTUTILS_USE_SDK=1 + +set args=%1 +shift +:start +if [%1] == [] goto done +set args=%args% %1 +shift +goto start + +:done +if "%args%" == "" ( + echo Usage: vc_env_helper.bat [command] [args] + echo e.g. vc_env_helper.bat cl /c test.cpp +) + +%args% || exit /b 1 diff --git a/packaging/windows/internal/vc_install_helper.sh b/packaging/windows/internal/vc_install_helper.sh new file mode 100755 index 0000000..cdae180 --- /dev/null +++ b/packaging/windows/internal/vc_install_helper.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -ex + +if [[ "$CU_VERSION" == "cu92" ]]; then + export VC_YEAR=2017 + export VSDEVCMD_ARGS="-vcvars_ver=14.13" + powershell packaging/windows/internal/vs2017_install.ps1 +elif [[ "$CU_VERSION" == "cu100" ]]; then + export VC_YEAR=2017 + export VSDEVCMD_ARGS="" + powershell packaging/windows/internal/vs2017_install.ps1 +else + export VC_YEAR=2019 + export VSDEVCMD_ARGS="" +fi diff --git a/packaging/windows/internal/vs2017_install.ps1 b/packaging/windows/internal/vs2017_install.ps1 new file mode 100644 index 0000000..3e953de --- /dev/null +++ b/packaging/windows/internal/vs2017_install.ps1 @@ -0,0 +1,25 @@ +$VS_DOWNLOAD_LINK = "https://aka.ms/vs/15/release/vs_buildtools.exe" +$VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools", + "--add Microsoft.VisualStudio.Component.VC.Tools.14.13", + "--add Microsoft.Component.MSBuild", + "--add Microsoft.VisualStudio.Component.Roslyn.Compiler", + "--add Microsoft.VisualStudio.Component.TextTemplating", + "--add Microsoft.VisualStudio.Component.VC.CoreIde", + "--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest", + "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", + "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Win81") + +curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe +if ($LASTEXITCODE -ne 0) { + echo "Download of the VS 2017 installer failed" + exit 1 +} + +$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru +Remove-Item -Path vs_installer.exe -Force +$exitCode = $process.ExitCode +if (($exitCode -ne 0) -and ($exitCode -ne 3010)) { + echo "VS 2017 installer exited with code $exitCode, which should be one of [0, 3010]." + exit 1 +} diff --git a/packaging/windows/internal/vs2019_install.ps1 b/packaging/windows/internal/vs2019_install.ps1 new file mode 100644 index 0000000..e436051 --- /dev/null +++ b/packaging/windows/internal/vs2019_install.ps1 @@ -0,0 +1,21 @@ +$VS_DOWNLOAD_LINK = "https://aka.ms/vs/16/release/vs_buildtools.exe" +$VS_INSTALL_ARGS = @("--nocache","--quiet","--wait", "--add Microsoft.VisualStudio.Workload.VCTools", + "--add Microsoft.Component.MSBuild", + "--add Microsoft.VisualStudio.Component.Roslyn.Compiler", + "--add Microsoft.VisualStudio.Component.VC.CoreBuildTools", + "--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest", + "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64") + +curl.exe --retry 3 -kL $VS_DOWNLOAD_LINK --output vs_installer.exe +if ($LASTEXITCODE -ne 0) { + echo "Download of the VS 2019 installer failed" + exit 1 +} + +$process = Start-Process "${PWD}\vs_installer.exe" -ArgumentList $VS_INSTALL_ARGS -NoNewWindow -Wait -PassThru +Remove-Item -Path vs_installer.exe -Force +$exitCode = $process.ExitCode +if (($exitCode -ne 0) -and ($exitCode -ne 3010)) { + echo "VS 2019 installer exited with code $exitCode, which should be one of [0, 3010]." + exit 1 +} diff --git a/packaging/windows/internal/vs_install.bat b/packaging/windows/internal/vs_install.bat new file mode 100644 index 0000000..348a5e3 --- /dev/null +++ b/packaging/windows/internal/vs_install.bat @@ -0,0 +1,14 @@ +@echo off + +set VS_DOWNLOAD_LINK=https://aka.ms/vs/15/release/vs_enterprise.exe +set VS_INSTALL_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise +set VS_INSTALL_ARGS=--nocache --quiet --wait --add Microsoft.VisualStudio.Component.VC.Tools.14.11 +set VSDEVCMD_ARGS=-vcvars_ver=14.11 + +curl -k -L %VS_DOWNLOAD_LINK% --output vs_installer.exe +if errorlevel 1 exit /b 1 + +start /wait vs_installer.exe modify --installPath "%VS_INSTALL_PATH%" %VS_INSTALL_ARGS% +if not errorlevel 0 exit /b 1 +if errorlevel 1 if not errorlevel 3010 exit /b 1 +if errorlevel 3011 exit /b 1 diff --git a/setup.py b/setup.py index cc77d67..58236d0 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ build_cuda = cu_version != 'cpu' CXX_FLAGS = [] -if platform != "darwin": +if platform == 'linux': CXX_FLAGS.append('-fopenmp') NVCC_FLAGS = os.getenv('NVCC_FLAGS', '') From abfe942a2db8a2cfef751b7426d45224ea65ac56 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Jul 2020 20:51:08 -0700 Subject: [PATCH 004/750] 2020-07-30 nightly release (7a034f960f0e125eaad06567601cecefbca9273b) --- .circleci/config.yml | 1026 +++++++++++++++++++++--------------------- 1 file changed, 513 insertions(+), 513 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aadcaf6..21c2d16 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -512,33 +512,33 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_wheel_py3.6_cpu python_version: '3.6' - - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.6_cu92 - python_version: '3.6' - - binary_win_wheel: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.6_cu101 - python_version: '3.6' - - binary_win_wheel: - cu_version: cu102 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.6_cu102 - python_version: '3.6' +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.6_cu92 +# python_version: '3.6' +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.6_cu101 +# python_version: '3.6' +# - binary_win_wheel: +# cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.6_cu102 +# python_version: '3.6' - binary_win_wheel: cu_version: cpu filters: @@ -548,59 +548,59 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_wheel_py3.7_cpu python_version: '3.7' - - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.7_cu92 - python_version: '3.7' - - binary_win_wheel: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.7_cu101 - python_version: '3.7' - - binary_win_wheel: - cu_version: cu102 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.7_cu102 - python_version: '3.7' +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.7_cu92 +# python_version: '3.7' +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.7_cu101 +# python_version: '3.7' +# - binary_win_wheel: +# cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.7_cu102 +# python_version: '3.7' - binary_win_wheel: cu_version: cpu name: binary_win_wheel_py3.8_cpu python_version: '3.8' - - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.8_cu92 - python_version: '3.8' - - binary_win_wheel: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.8_cu101 - python_version: '3.8' - - binary_win_wheel: - cu_version: cu102 - name: binary_win_wheel_py3.8_cu102 - python_version: '3.8' +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.8_cu92 +# python_version: '3.8' +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.8_cu101 +# python_version: '3.8' +# - binary_win_wheel: +# cu_version: cu102 +# name: binary_win_wheel_py3.8_cu102 +# python_version: '3.8' - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.6_cpu @@ -685,33 +685,33 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_conda_py3.6_cpu python_version: '3.6' - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.6_cu92 - python_version: '3.6' - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.6_cu101 - python_version: '3.6' - - binary_win_conda: - cu_version: cu102 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.6_cu102 - python_version: '3.6' +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.6_cu92 +# python_version: '3.6' +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.6_cu101 +# python_version: '3.6' +# - binary_win_conda: +# cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.6_cu102 +# python_version: '3.6' - binary_win_conda: cu_version: cpu filters: @@ -721,59 +721,59 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_conda_py3.7_cpu python_version: '3.7' - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.7_cu92 - python_version: '3.7' - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.7_cu101 - python_version: '3.7' - - binary_win_conda: - cu_version: cu102 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.7_cu102 - python_version: '3.7' +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.7_cu92 +# python_version: '3.7' +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.7_cu101 +# python_version: '3.7' +# - binary_win_conda: +# cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.7_cu102 +# python_version: '3.7' - binary_win_conda: cu_version: cpu name: binary_win_conda_py3.8_cpu python_version: '3.8' - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.8_cu92 - python_version: '3.8' - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: master - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.8_cu101 - python_version: '3.8' - - binary_win_conda: - cu_version: cu102 - name: binary_win_conda_py3.8_cu102 - python_version: '3.8' +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.8_cu92 +# python_version: '3.8' +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.8_cu101 +# python_version: '3.8' +# - binary_win_conda: +# cu_version: cu102 +# name: binary_win_conda_py3.8_cu102 +# python_version: '3.8' # - python_lint # - python_type_check # - clang_format @@ -1189,35 +1189,75 @@ workflows: requires: - nightly_binary_win_wheel_py3.6_cpu subfolder: cpu/ +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu92 +# python_version: '3.6' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu92_upload +# requires: +# - nightly_binary_win_wheel_py3.6_cu92 +# subfolder: cu92/ +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu101 +# python_version: '3.6' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu101_upload +# requires: +# - nightly_binary_win_wheel_py3.6_cu101 +# subfolder: cu101/ +# - binary_win_wheel: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu102 +# python_version: '3.6' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.6_cu102_upload +# requires: +# - nightly_binary_win_wheel_py3.6_cu102 +# subfolder: cu102/ - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu92 - python_version: '3.6' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu92_upload - requires: - - nightly_binary_win_wheel_py3.6_cu92 - subfolder: cu92/ - - binary_win_wheel: - cu_version: cu101 + cu_version: cpu filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu101 - python_version: '3.6' + name: nightly_binary_win_wheel_py3.7_cpu + python_version: '3.7' - binary_wheel_upload: context: org-member filters: @@ -1225,19 +1265,79 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu101_upload + name: nightly_binary_win_wheel_py3.7_cpu_upload requires: - - nightly_binary_win_wheel_py3.6_cu101 - subfolder: cu101/ + - nightly_binary_win_wheel_py3.7_cpu + subfolder: cpu/ +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu92 +# python_version: '3.7' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu92_upload +# requires: +# - nightly_binary_win_wheel_py3.7_cu92 +# subfolder: cu92/ +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu101 +# python_version: '3.7' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu101_upload +# requires: +# - nightly_binary_win_wheel_py3.7_cu101 +# subfolder: cu101/ +# - binary_win_wheel: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu102 +# python_version: '3.7' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.7_cu102_upload +# requires: +# - nightly_binary_win_wheel_py3.7_cu102 +# subfolder: cu102/ - binary_win_wheel: - cu_version: cu102 + cu_version: cpu filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu102 - python_version: '3.6' + name: nightly_binary_win_wheel_py3.8_cpu + python_version: '3.8' - binary_wheel_upload: context: org-member filters: @@ -1245,170 +1345,70 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu102_upload - requires: - - nightly_binary_win_wheel_py3.6_cu102 - subfolder: cu102/ - - binary_win_wheel: - cu_version: cpu - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cpu - python_version: '3.7' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cpu_upload - requires: - - nightly_binary_win_wheel_py3.7_cpu - subfolder: cpu/ - - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu92 - python_version: '3.7' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu92_upload - requires: - - nightly_binary_win_wheel_py3.7_cu92 - subfolder: cu92/ - - binary_win_wheel: - cu_version: cu101 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu101 - python_version: '3.7' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu101_upload - requires: - - nightly_binary_win_wheel_py3.7_cu101 - subfolder: cu101/ - - binary_win_wheel: - cu_version: cu102 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu102 - python_version: '3.7' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu102_upload - requires: - - nightly_binary_win_wheel_py3.7_cu102 - subfolder: cu102/ - - binary_win_wheel: - cu_version: cpu - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cpu - python_version: '3.8' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cpu_upload + name: nightly_binary_win_wheel_py3.8_cpu_upload requires: - nightly_binary_win_wheel_py3.8_cpu subfolder: cpu/ - - binary_win_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu92 - python_version: '3.8' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu92_upload - requires: - - nightly_binary_win_wheel_py3.8_cu92 - subfolder: cu92/ - - binary_win_wheel: - cu_version: cu101 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu101 - python_version: '3.8' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu101_upload - requires: - - nightly_binary_win_wheel_py3.8_cu101 - subfolder: cu101/ - - binary_win_wheel: - cu_version: cu102 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu102 - python_version: '3.8' - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu102_upload - requires: - - nightly_binary_win_wheel_py3.8_cu102 - subfolder: cu102/ +# - binary_win_wheel: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu92 +# python_version: '3.8' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu92_upload +# requires: +# - nightly_binary_win_wheel_py3.8_cu92 +# subfolder: cu92/ +# - binary_win_wheel: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu101 +# python_version: '3.8' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu101_upload +# requires: +# - nightly_binary_win_wheel_py3.8_cu101 +# subfolder: cu101/ +# - binary_win_wheel: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu102 +# python_version: '3.8' +# - binary_wheel_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_wheel_py3.8_cu102_upload +# requires: +# - nightly_binary_win_wheel_py3.8_cu102 +# subfolder: cu102/ - binary_linux_conda: cu_version: cpu filters: @@ -1728,63 +1728,63 @@ workflows: name: nightly_binary_win_conda_py3.6_cpu_upload requires: - nightly_binary_win_conda_py3.6_cpu - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu92 - python_version: '3.6' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu92_upload - requires: - - nightly_binary_win_conda_py3.6_cu92 - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu101 - python_version: '3.6' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu101_upload - requires: - - nightly_binary_win_conda_py3.6_cu101 - - binary_win_conda: - cu_version: cu102 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu102 - python_version: '3.6' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu102_upload - requires: - - nightly_binary_win_conda_py3.6_cu102 +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu92 +# python_version: '3.6' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu92_upload +# requires: +# - nightly_binary_win_conda_py3.6_cu92 +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu101 +# python_version: '3.6' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu101_upload +# requires: +# - nightly_binary_win_conda_py3.6_cu101 +# - binary_win_conda: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu102 +# python_version: '3.6' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu102_upload +# requires: +# - nightly_binary_win_conda_py3.6_cu102 - binary_win_conda: cu_version: cpu filters: @@ -1804,63 +1804,63 @@ workflows: name: nightly_binary_win_conda_py3.7_cpu_upload requires: - nightly_binary_win_conda_py3.7_cpu - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu92 - python_version: '3.7' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu92_upload - requires: - - nightly_binary_win_conda_py3.7_cu92 - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu101 - python_version: '3.7' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu101_upload - requires: - - nightly_binary_win_conda_py3.7_cu101 - - binary_win_conda: - cu_version: cu102 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu102 - python_version: '3.7' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu102_upload - requires: - - nightly_binary_win_conda_py3.7_cu102 +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu92 +# python_version: '3.7' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu92_upload +# requires: +# - nightly_binary_win_conda_py3.7_cu92 +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu101 +# python_version: '3.7' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu101_upload +# requires: +# - nightly_binary_win_conda_py3.7_cu101 +# - binary_win_conda: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu102 +# python_version: '3.7' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu102_upload +# requires: +# - nightly_binary_win_conda_py3.7_cu102 - binary_win_conda: cu_version: cpu filters: @@ -1880,60 +1880,60 @@ workflows: name: nightly_binary_win_conda_py3.8_cpu_upload requires: - nightly_binary_win_conda_py3.8_cpu - - binary_win_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu92 - python_version: '3.8' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu92_upload - requires: - - nightly_binary_win_conda_py3.8_cu92 - - binary_win_conda: - cu_version: cu101 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu101 - python_version: '3.8' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu101_upload - requires: - - nightly_binary_win_conda_py3.8_cu101 - - binary_win_conda: - cu_version: cu102 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu102 - python_version: '3.8' - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu102_upload - requires: - - nightly_binary_win_conda_py3.8_cu102 +# - binary_win_conda: +# cu_version: cu92 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu92 +# python_version: '3.8' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu92_upload +# requires: +# - nightly_binary_win_conda_py3.8_cu92 +# - binary_win_conda: +# cu_version: cu101 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu101 +# python_version: '3.8' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu101_upload +# requires: +# - nightly_binary_win_conda_py3.8_cu101 +# - binary_win_conda: +# cu_version: cu102 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu102 +# python_version: '3.8' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu102_upload +# requires: +# - nightly_binary_win_conda_py3.8_cu102 From ce254e9b6e36096442dd2c1ba0adaae12d859540 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 31 Jul 2020 04:30:51 -0700 Subject: [PATCH 005/750] 2020-07-31 nightly release (7a034f960f0e125eaad06567601cecefbca9273b) From 726a033b356da0d07a0a5413eed3bf41ba3ad264 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 1 Aug 2020 04:30:37 -0700 Subject: [PATCH 006/750] 2020-08-01 nightly release (f078905cb16e14ac159aae4126847da8e27049ab) --- .gitignore | 2 +- README.md | 129 ++++++++++++------ packaging/build_conda.sh | 2 +- packaging/pkg_helpers.bash | 6 +- .../conda_build_config.yaml | 0 .../{torch_csprng => torchcsprng}/meta.yaml | 4 +- packaging/windows/internal/build_conda.bat | 2 +- packaging/windows/internal/build_wheels.bat | 2 +- packaging/windows/internal/clone.bat | 2 +- .../windows/internal/nightly_defaults.bat | 16 +-- packaging/windows/internal/test.bat | 2 +- setup.py | 4 +- test/test_csprng.py | 2 +- .../csrc/OffsetCalculator.cuh | 0 .../csrc/THCIntegerDivider.cuh | 0 {torch_csprng => torchcsprng}/csrc/aes.h | 0 .../csrc/block_cipher.h | 0 {torch_csprng => torchcsprng}/csrc/csprng.cpp | 0 {torch_csprng => torchcsprng}/csrc/csprng.cu | 0 {torch_csprng => torchcsprng}/csrc/csprng.h | 0 {torch_csprng => torchcsprng}/csrc/macros.h | 0 21 files changed, 112 insertions(+), 61 deletions(-) rename packaging/{torch_csprng => torchcsprng}/conda_build_config.yaml (100%) rename packaging/{torch_csprng => torchcsprng}/meta.yaml (96%) rename {torch_csprng => torchcsprng}/csrc/OffsetCalculator.cuh (100%) rename {torch_csprng => torchcsprng}/csrc/THCIntegerDivider.cuh (100%) rename {torch_csprng => torchcsprng}/csrc/aes.h (100%) rename {torch_csprng => torchcsprng}/csrc/block_cipher.h (100%) rename {torch_csprng => torchcsprng}/csrc/csprng.cpp (100%) rename {torch_csprng => torchcsprng}/csrc/csprng.cu (100%) rename {torch_csprng => torchcsprng}/csrc/csprng.h (100%) rename {torch_csprng => torchcsprng}/csrc/macros.h (100%) diff --git a/.gitignore b/.gitignore index 4404a2b..e72bf2c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,6 @@ build/ *.egg-info/ .idea .vscode -torch_csprng/version.py +torchcsprng/version.py */__pycache__ *.so diff --git a/README.md b/README.md index 792c546..5c7a1e5 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ Advantages: CSPRNG exposes two methods to create crypto-secure and non-crypto-secure PRNGs: -| Method to create PRNG | Is crypto-secure? | Has seed? | Underlying implementation | -|----------------------------------------------------|-------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------| -| create_random_device_generator(token: string=None) | yes | no | See [std::random_device](https://en.cppreference.com/w/cpp/numeric/random/random_device) and [it's constructor](https://en.cppreference.com/w/cpp/numeric/random/random_device/random_device). The implementation in libstdc++ expects token to name the source of random bytes. Possible token values include "default", "rand_s", "rdseed", "rdrand", "rdrnd", "/dev/urandom", "/dev/random", "mt19937", and integer string specifying the seed of the mt19937 engine. (Token values other than "default" are only valid for certain targets.) If token=None then constructs a new std::random_device object with an implementation-defined token. | -| create_mt19937_generator(seed: int=None) | no | yes | See [std::mt19937](https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine) and [it's constructor](https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine/mersenne_twister_engine). Constructs a mersenne_twister_engine object, and initializes its internal state sequence to pseudo-random values. If seed=None then seeds the engine with default_seed.| +| Method to create PRNG | Is crypto-secure? | Has seed? | Underlying implementation | +|----------------------------------------------------|-------------------|-----------|---------------------------| +| create_random_device_generator(token: string=None) | yes | no | See [std::random_device](https://en.cppreference.com/w/cpp/numeric/random/random_device) and [its constructor](https://en.cppreference.com/w/cpp/numeric/random/random_device/random_device). The implementation in libstdc++ expects token to name the source of random bytes. Possible token values include "default", "rand_s", "rdseed", "rdrand", "rdrnd", "/dev/urandom", "/dev/random", "mt19937", and integer string specifying the seed of the mt19937 engine. (Token values other than "default" are only valid for certain targets.) If token=None then constructs a new std::random_device object with an implementation-defined token. | +| create_mt19937_generator(seed: int=None) | no | yes | See [std::mt19937](https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine) and [its constructor](https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine/mersenne_twister_engine). Constructs a mersenne_twister_engine object, and initializes its internal state sequence to pseudo-random values. If seed=None then seeds the engine with default_seed.| The following list of methods supports all forementioned PRNGs: @@ -43,67 +43,118 @@ The following list of methods supports all forementioned PRNGs: | geometric_(p) | yes | yes | | exponential_(lambda) | yes | yes | -## How to build +## Installation -Since CSPRNG is C++/CUDA extension it uses setuptools, just run `python setup.py install` to build and install it. +CSPRNG works on the following operating systems and can be used with PyTorch tensors on the following devices: -## How to use +| Tensor Device Type | Linux | macOS | MS Window | +|--------------------|-----------|---------------|-----------| +| CPU | Supported | Supported | Supported | +| CUDA | Supported | Not Supported | Planned* | +### Binaries + +Anaconda: + +```console +conda install torchcsprng -c pytorch +``` +for nightly builds: +```console +conda install torchcsprng -c pytorch-nightly +``` + +pip: + +```console +pip install torchcsprng +``` +for nightly builds: +```console +pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html +pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html +pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html +pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html +``` + +### From Source + +CSPRNG is a Python C++/CUDA extension that depends on PyTorch. In order to build CSPRNG from source it is required to have Python(>=3.6) with PyTorch(>=1.6.0) installed and C++ compiler(gcc/clang for Linux, XCode for macOS, Visual Studio for MS Windows). +To build CSPRNG run the following: +```console +python setup.py install +``` +By default, GPU support is built if CUDA is found and torch.cuda.is_available() is true. It's possible to force building GPU support by setting FORCE_CUDA=1 environment variable, which is useful when building a docker image. + +## Getting Started + +CSPRNG API is available in `torchcsprng` module: ```python import torch -import torch_csprng as csprng - -# Create crypto-secure PRNG from /dev/urandom: +import torchcsprng as csprng +``` +Create crypto-secure PRNG from /dev/urandom: +```python urandom_gen = csprng.create_random_device_generator('/dev/urandom') +``` -# Create empty boolean tensor on CUDA and initialize it with random values from urandom_gen: -print(torch.empty(10, dtype=torch.bool, device='cuda').random_(generator=urandom_gen)) +Create empty boolean tensor on CUDA and initialize it with random values from urandom_gen: +```python +torch.empty(10, dtype=torch.bool, device='cuda').random_(generator=urandom_gen) +``` +``` tensor([ True, False, False, True, False, False, False, True, False, False], device='cuda:0') +``` -# Create empty int16 tensor on CUDA and initialize it with random values in range [0, 100) from urandom_gen: -print(torch.empty(10, dtype=torch.int16, device='cuda').random_(100, generator=urandom_gen)) +Create empty int16 tensor on CUDA and initialize it with random values in range [0, 100) from urandom_gen: +```python +torch.empty(10, dtype=torch.int16, device='cuda').random_(100, generator=urandom_gen) +``` +``` tensor([59, 20, 68, 51, 18, 37, 7, 54, 74, 85], device='cuda:0', dtype=torch.int16) +``` -# Create non-crypto-secure MT19937 PRNG: +Create non-crypto-secure MT19937 PRNG: +```python mt19937_gen = csprng.create_mt19937_generator() - -print(torch.empty(10, dtype=torch.int64, device='cuda').random_(torch.iinfo(torch.int64).min, to=None, generator=mt19937_gen)) +torch.empty(10, dtype=torch.int64, device='cuda').random_(torch.iinfo(torch.int64).min, to=None, generator=mt19937_gen) +``` +``` tensor([-7584783661268263470, 2477984957619728163, -3472586837228887516, -5174704429717287072, 4125764479102447192, -4763846282056057972, -182922600982469112, -498242863868415842, 728545841957750221, 7740902737283645074], device='cuda:0') +``` -# Create crypto-secure PRNG from default random device: +Create crypto-secure PRNG from default random device: +```python default_device_gen = csprng.create_random_device_generator() - -print(torch.randn(10, device='cuda', generator=default_device_gen)) +torch.randn(10, device='cuda', generator=default_device_gen) +``` +``` tensor([ 1.2885, 0.3240, -1.1813, 0.8629, 0.5714, 2.3720, -0.5627, -0.5551, -0.6304, 0.1090], device='cuda:0') +``` -# Create non-crypto-secure MT19937 PRNG with seed +Create non-crypto-secure MT19937 PRNG with seed: +```python mt19937_gen = csprng.create_mt19937_generator(42) - -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) +torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen) +``` +``` tensor([ 7., 1., 8., 1., 11., 3., 1., 1., 5., 10.], device='cuda:0') +``` -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) -tensor([ 1., 1., 1., 6., 1., 13., 5., 1., 3., 4.], device='cuda:0') - -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) -tensor([14., 5., 4., 5., 1., 1., 8., 1., 7., 10.], device='cuda:0') - -# Recreate MT19937 PRNG with the same seed +Recreate MT19937 PRNG with the same seed: +```python mt19937_gen = csprng.create_mt19937_generator(42) - -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) +torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen) +``` +``` tensor([ 7., 1., 8., 1., 11., 3., 1., 1., 5., 10.], device='cuda:0') - -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) -tensor([ 1., 1., 1., 6., 1., 13., 5., 1., 3., 4.], device='cuda:0') - -print(torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen)) -tensor([14., 5., 4., 5., 1., 1., 8., 1., 7., 10.], device='cuda:0') - ``` +## License + +CSPRNG is BSD-licensed. diff --git a/packaging/build_conda.sh b/packaging/build_conda.sh index c628f6e..f7a1f35 100755 --- a/packaging/build_conda.sh +++ b/packaging/build_conda.sh @@ -11,4 +11,4 @@ setup_conda_pytorch_constraint setup_conda_cudatoolkit_constraint setup_visual_studio_constraint setup_junit_results_folder -conda build $CONDA_CHANNEL_FLAGS -c defaults -c conda-forge --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torch_csprng +conda build $CONDA_CHANNEL_FLAGS -c defaults -c conda-forge --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchcsprng diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 8181bf2..6a1ea1a 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -14,8 +14,8 @@ # PYTORCH_VERSION_SUFFIX (e.g., +cpu) # WHEEL_DIR (e.g., cu100/) # CUDA_HOME (e.g., /usr/local/cuda-9.2, respected by torch.utils.cpp_extension) -# FORCE_CUDA (respected by torch_csprng setup.py) -# NVCC_FLAGS (respected by torch_csprng setup.py) +# FORCE_CUDA (respected by torchcsprng setup.py) +# NVCC_FLAGS (respected by torchcsprng setup.py) # # Precondition: CUDA versions are installed in their conventional locations in # /usr/local/cuda-* @@ -294,7 +294,7 @@ setup_visual_studio_constraint() { if [[ "$OSTYPE" == "msys" ]]; then export VSTOOLCHAIN_PACKAGE=vs$VC_YEAR conda build $CONDA_CHANNEL_FLAGS --no-anaconda-upload packaging/$VSTOOLCHAIN_PACKAGE - cp packaging/$VSTOOLCHAIN_PACKAGE/conda_build_config.yaml packaging/torch_csprng/conda_build_config.yaml + cp packaging/$VSTOOLCHAIN_PACKAGE/conda_build_config.yaml packaging/torchcsprng/conda_build_config.yaml fi } diff --git a/packaging/torch_csprng/conda_build_config.yaml b/packaging/torchcsprng/conda_build_config.yaml similarity index 100% rename from packaging/torch_csprng/conda_build_config.yaml rename to packaging/torchcsprng/conda_build_config.yaml diff --git a/packaging/torch_csprng/meta.yaml b/packaging/torchcsprng/meta.yaml similarity index 96% rename from packaging/torch_csprng/meta.yaml rename to packaging/torchcsprng/meta.yaml index 41be147..29d9590 100644 --- a/packaging/torch_csprng/meta.yaml +++ b/packaging/torchcsprng/meta.yaml @@ -1,5 +1,5 @@ package: - name: torch_csprng + name: torchcsprng version: "{{ environ.get('BUILD_VERSION') }}" source: @@ -39,7 +39,7 @@ build: #test: # imports: # - torch -# - torch_csprng +# - torchcsprng # source_files: # - test # requires: diff --git a/packaging/windows/internal/build_conda.bat b/packaging/windows/internal/build_conda.bat index a5e5c43..6ffd67b 100644 --- a/packaging/windows/internal/build_conda.bat +++ b/packaging/windows/internal/build_conda.bat @@ -11,5 +11,5 @@ if errorlevel 1 exit /b 1 set PYTORCH_FINAL_PACKAGE_DIR=%CD%\packaging\windows\output if not exist "%PYTORCH_FINAL_PACKAGE_DIR%" mkdir %PYTORCH_FINAL_PACKAGE_DIR% -bash ./packaging/conda/build_csprng.sh %CUDA_VERSION% %TORCH_CSPRNG_BUILD_VERSION% %TORCH_CSPRNG_BUILD_NUMBER% +bash ./packaging/conda/build_csprng.sh %CUDA_VERSION% %TORCHCSPRNG_BUILD_VERSION% %TORCHCSPRNG_BUILD_NUMBER% if errorlevel 1 exit /b 1 diff --git a/packaging/windows/internal/build_wheels.bat b/packaging/windows/internal/build_wheels.bat index 6d09d1a..876b8b0 100644 --- a/packaging/windows/internal/build_wheels.bat +++ b/packaging/windows/internal/build_wheels.bat @@ -8,5 +8,5 @@ if errorlevel 1 exit /b 1 call packaging/windows/internal/nightly_defaults.bat Wheels if errorlevel 1 exit /b 1 -call packaging/windows/build_csprng.bat %CUDA_VERSION% %TORCH_CSPRNG_BUILD_VERSION% %TORCH_CSPRNG_BUILD_NUMBER% +call packaging/windows/build_csprng.bat %CUDA_VERSION% %TORCHCSPRNG_BUILD_VERSION% %TORCHCSPRNG_BUILD_NUMBER% if errorlevel 1 exit /b 1 diff --git a/packaging/windows/internal/clone.bat b/packaging/windows/internal/clone.bat index fade37c..758527c 100644 --- a/packaging/windows/internal/clone.bat +++ b/packaging/windows/internal/clone.bat @@ -45,7 +45,7 @@ set PYTORCH_BRANCH=%last_commit% :latest_end IF "%PYTORCH_BRANCH%" == "" ( - set PYTORCH_BRANCH=v%TORCH_CSPRNG_BUILD_VERSION% + set PYTORCH_BRANCH=v%TORCHCSPRNG_BUILD_VERSION% ) git checkout %PYTORCH_BRANCH% IF ERRORLEVEL 1 git checkout tags/%PYTORCH_BRANCH% diff --git a/packaging/windows/internal/nightly_defaults.bat b/packaging/windows/internal/nightly_defaults.bat index dcef72f..73dc518 100644 --- a/packaging/windows/internal/nightly_defaults.bat +++ b/packaging/windows/internal/nightly_defaults.bat @@ -144,11 +144,11 @@ if "%CUDA_VERSION%" == "cpu" ( :: pytorch-nightly==1.0.0.dev20180908 :: or in manylinux like :: torch_nightly-1.0.0.dev20180908-cp27-cp27m-linux_x86_64.whl -if "%TORCH_CSPRNG_BUILD_VERSION%" == "" set TORCH_CSPRNG_BUILD_VERSION=0.8.0.dev%NIGHTLIES_DATE_COMPACT% +if "%TORCHCSPRNG_BUILD_VERSION%" == "" set TORCHCSPRNG_BUILD_VERSION=0.8.0.dev%NIGHTLIES_DATE_COMPACT% if "%~1" == "Wheels" ( if not "%CUDA_VERSION%" == "102" ( - set TORCH_CSPRNG_BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION%+%_DESIRED_CUDA% + set TORCHCSPRNG_BUILD_VERSION=%TORCHCSPRNG_BUILD_VERSION%+%_DESIRED_CUDA% ) ) @@ -159,24 +159,24 @@ if "%~1" == "Wheels" ( :: be set to '0' only if OVERRIDE_PACKAGE_VERSION is being used to bypass :: all the version string logic in downstream scripts. Since we use the :: override below, exporting this shouldn't actually matter. -if "%TORCH_CSPRNG_BUILD_NUMBER%" == "" set /a TORCH_CSPRNG_BUILD_NUMBER=1 -if %TORCH_CSPRNG_BUILD_NUMBER% GTR 1 set TORCH_CSPRNG_BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION%%TORCH_CSPRNG_BUILD_NUMBER% +if "%TORCHCSPRNG_BUILD_NUMBER%" == "" set /a TORCHCSPRNG_BUILD_NUMBER=1 +if %TORCHCSPRNG_BUILD_NUMBER% GTR 1 set TORCHCSPRNG_BUILD_VERSION=%TORCHCSPRNG_BUILD_VERSION%%TORCHCSPRNG_BUILD_NUMBER% :: The nightly builds use their own versioning logic, so we override whatever :: logic is in setup.py or other scripts :: TODO: Not supported yet -set OVERRIDE_PACKAGE_VERSION=%TORCH_CSPRNG_BUILD_VERSION% -set BUILD_VERSION=%TORCH_CSPRNG_BUILD_VERSION% +set OVERRIDE_PACKAGE_VERSION=%TORCHCSPRNG_BUILD_VERSION% +set BUILD_VERSION=%TORCHCSPRNG_BUILD_VERSION% :: Build folder for conda builds to use -if "%TORCH_CONDA_BUILD_FOLDER%" == "" set TORCH_CONDA_BUILD_FOLDER=torch_csprng +if "%TORCH_CONDA_BUILD_FOLDER%" == "" set TORCH_CONDA_BUILD_FOLDER=torchcsprng :: TORCH_PACKAGE_NAME :: The name of the package to upload. This should probably be pytorch or :: pytorch-nightly. N.B. that pip will change all '-' to '_' but conda will :: not. This is dealt with in downstream scripts. :: TODO: Not supported yet -if "%TORCH_PACKAGE_NAME%" == "" set TORCH_PACKAGE_NAME=torch_csprng +if "%TORCH_PACKAGE_NAME%" == "" set TORCH_PACKAGE_NAME=torchcsprng :: PIP_UPLOAD_FOLDER should end in a slash. This is to handle it being empty :: (when uploading to e.g. whl/cpu/) and also to handle nightlies (when diff --git a/packaging/windows/internal/test.bat b/packaging/windows/internal/test.bat index 2f6497c..8e6878b 100644 --- a/packaging/windows/internal/test.bat +++ b/packaging/windows/internal/test.bat @@ -17,7 +17,7 @@ if ERRORLEVEL 1 exit /b 1 if NOT "%BUILD_CSPRNG%" == "" ( echo Smoke testing imports - python -c "import torch_csprng" + python -c "import torchcsprng" if ERRORLEVEL 1 exit /b 1 goto smoke_test_end ) diff --git a/setup.py b/setup.py index 58236d0..0141154 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ NVCC_FLAGS.append('-fopenmp') # NVCC_FLAGS = ['--expt-extended-lambda', '-Xcompiler', '-fopenmp'] -module_name = 'torch_csprng' +module_name = 'torchcsprng' this_dir = os.path.dirname(os.path.abspath(__file__)) extensions_dir = os.path.join(this_dir, module_name, 'csrc') @@ -51,7 +51,7 @@ version = open('version.txt', 'r').read().strip() sha = 'Unknown' -package_name = 'pytorch_csprng' +package_name = 'torchcsprng' try: sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=this_dir).decode('ascii').strip() diff --git a/test/test_csprng.py b/test/test_csprng.py index 8447458..7f708ab 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -7,7 +7,7 @@ import time try: - import torch_csprng as csprng + import torchcsprng as csprng except ImportError: raise RuntimeError("CSPRNG not available") diff --git a/torch_csprng/csrc/OffsetCalculator.cuh b/torchcsprng/csrc/OffsetCalculator.cuh similarity index 100% rename from torch_csprng/csrc/OffsetCalculator.cuh rename to torchcsprng/csrc/OffsetCalculator.cuh diff --git a/torch_csprng/csrc/THCIntegerDivider.cuh b/torchcsprng/csrc/THCIntegerDivider.cuh similarity index 100% rename from torch_csprng/csrc/THCIntegerDivider.cuh rename to torchcsprng/csrc/THCIntegerDivider.cuh diff --git a/torch_csprng/csrc/aes.h b/torchcsprng/csrc/aes.h similarity index 100% rename from torch_csprng/csrc/aes.h rename to torchcsprng/csrc/aes.h diff --git a/torch_csprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h similarity index 100% rename from torch_csprng/csrc/block_cipher.h rename to torchcsprng/csrc/block_cipher.h diff --git a/torch_csprng/csrc/csprng.cpp b/torchcsprng/csrc/csprng.cpp similarity index 100% rename from torch_csprng/csrc/csprng.cpp rename to torchcsprng/csrc/csprng.cpp diff --git a/torch_csprng/csrc/csprng.cu b/torchcsprng/csrc/csprng.cu similarity index 100% rename from torch_csprng/csrc/csprng.cu rename to torchcsprng/csrc/csprng.cu diff --git a/torch_csprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h similarity index 100% rename from torch_csprng/csrc/csprng.h rename to torchcsprng/csrc/csprng.h diff --git a/torch_csprng/csrc/macros.h b/torchcsprng/csrc/macros.h similarity index 100% rename from torch_csprng/csrc/macros.h rename to torchcsprng/csrc/macros.h From b380c866171e5ec4a0a4522c405846278a107aa8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 1 Aug 2020 20:05:32 -0700 Subject: [PATCH 007/750] 2020-08-01 nightly release (1fdb95ef1ea708a327b4760deea58124a11be5fd) --- packaging/torchcsprng/bld.bat | 27 +++++++++++++++++++++++++++ torchcsprng/__init__.py | 1 + 2 files changed, 28 insertions(+) create mode 100644 packaging/torchcsprng/bld.bat create mode 100644 torchcsprng/__init__.py diff --git a/packaging/torchcsprng/bld.bat b/packaging/torchcsprng/bld.bat new file mode 100644 index 0000000..8c7c833 --- /dev/null +++ b/packaging/torchcsprng/bld.bat @@ -0,0 +1,27 @@ +@echo on + +set TORCHCSPRNG_BUILD_VERSION=%PKG_VERSION% +set TORCHCSPRNG_BUILD_NUMBER=%PKG_BUILDNUM% + +set build_with_cuda= + +if "%CUDA_VERSION%" == "None" goto cuda_flags_end +if "%CUDA_VERSION%" == "cpu" goto cuda_flags_end +if "%CUDA_VERSION%" == "" goto cuda_flags_end + +set build_with_cuda=1 +set desired_cuda=%CUDA_VERSION:~0,-1%.%CUDA_VERSION:~-1,1% + +set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v%desired_cuda% +set CUDA_BIN_PATH=%CUDA_PATH%\bin +set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr +if "%desired_cuda%" == "9.0" set NVCC_FLAGS=%NVCC_FLAGS% -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50 +if "%desired_cuda%" == "9.2" set NVCC_FLAGS=%NVCC_FLAGS% -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50 +if "%desired_cuda%" == "10.0" set NVCC_FLAGS=%NVCC_FLAGS% -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 +if "%desired_cuda%" == "10.1" set NVCC_FLAGS=%NVCC_FLAGS% -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 +if "%desired_cuda%" == "10.2" set NVCC_FLAGS=%NVCC_FLAGS% -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 + +:cuda_flags_end + +python setup.py install --single-version-externally-managed --record=record.txt +if errorlevel 1 exit /b 1 diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py new file mode 100644 index 0000000..aaa3285 --- /dev/null +++ b/torchcsprng/__init__.py @@ -0,0 +1 @@ +import torch From 3bf760b7c77193d47c8adcee514d15ae467cb93e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 2 Aug 2020 04:30:38 -0700 Subject: [PATCH 008/750] 2020-08-02 nightly release (b08182d30bd85c339e64df18c18dd777f63feab8) --- packaging/README.md | 90 +++++++ packaging/conda/build_csprng.sh | 229 ++++++++++++++++++ packaging/conda/install_conda.bat | 1 + packaging/conda/switch_cuda_version.sh | 28 +++ packaging/wheel/linux_manywheel.sh | 62 +++++ packaging/wheel/osx_wheel.sh | 52 ++++ packaging/windows/azure-pipelines-ci.yml | 11 + packaging/windows/azure-pipelines.yml | 35 +++ packaging/windows/build_csprng.bat | 145 +++++++++++ packaging/windows/cpu.bat | 37 +++ packaging/windows/cuda101.bat | 59 +++++ packaging/windows/cuda102.bat | 59 +++++ packaging/windows/cuda92.bat | 59 +++++ packaging/windows/old/cuda100.bat | 59 +++++ packaging/windows/old/cuda90.bat | 59 +++++ packaging/windows/templates/auth_task.yml | 17 ++ packaging/windows/templates/build_conda.yml | 15 ++ packaging/windows/templates/build_task.yml | 161 ++++++++++++ packaging/windows/templates/build_wheels.yml | 9 + .../windows/templates/linux_build_task.yml | 38 +++ .../templates/override_pytorch_version.yml | 6 + .../windows/templates/publish_packages.yml | 8 + .../templates/publish_test_results.yml | 6 + .../templates/setup_env_for_msagent.yml | 25 ++ .../templates/setup_nightly_variables.yml | 11 + .../windows/templates/upload_to_conda.yml | 10 + packaging/windows/templates/upload_to_s3.yml | 15 ++ packaging/windows/templates/vsts_auth.yml | 8 + setup.py | 63 +++-- 29 files changed, 1354 insertions(+), 23 deletions(-) create mode 100644 packaging/README.md create mode 100755 packaging/conda/build_csprng.sh create mode 100644 packaging/conda/install_conda.bat create mode 100755 packaging/conda/switch_cuda_version.sh create mode 100644 packaging/wheel/linux_manywheel.sh create mode 100644 packaging/wheel/osx_wheel.sh create mode 100644 packaging/windows/azure-pipelines-ci.yml create mode 100644 packaging/windows/azure-pipelines.yml create mode 100644 packaging/windows/build_csprng.bat create mode 100644 packaging/windows/cpu.bat create mode 100644 packaging/windows/cuda101.bat create mode 100644 packaging/windows/cuda102.bat create mode 100644 packaging/windows/cuda92.bat create mode 100644 packaging/windows/old/cuda100.bat create mode 100644 packaging/windows/old/cuda90.bat create mode 100644 packaging/windows/templates/auth_task.yml create mode 100644 packaging/windows/templates/build_conda.yml create mode 100644 packaging/windows/templates/build_task.yml create mode 100644 packaging/windows/templates/build_wheels.yml create mode 100644 packaging/windows/templates/linux_build_task.yml create mode 100644 packaging/windows/templates/override_pytorch_version.yml create mode 100644 packaging/windows/templates/publish_packages.yml create mode 100644 packaging/windows/templates/publish_test_results.yml create mode 100644 packaging/windows/templates/setup_env_for_msagent.yml create mode 100644 packaging/windows/templates/setup_nightly_variables.yml create mode 100644 packaging/windows/templates/upload_to_conda.yml create mode 100644 packaging/windows/templates/upload_to_s3.yml create mode 100644 packaging/windows/templates/vsts_auth.yml diff --git a/packaging/README.md b/packaging/README.md new file mode 100644 index 0000000..20ff064 --- /dev/null +++ b/packaging/README.md @@ -0,0 +1,90 @@ +# Building torchcsprng packages for release + +## Anaconda packages + +### Linux + +```bash +nvidia-docker run -it --ipc=host --rm -v $(pwd):/remote soumith/conda-cuda bash +pushd remote/conda + +./build_csprng.sh 9.0 +./build_csprng.sh 10.0 +./build_csprng.sh cpu + +# copy packages over to /remote +# exit docker +# anaconda upload -u pytorch torchcsprng*.bz2 +``` + +### OSX + +```bash +# create a fresh anaconda environment / install and activate it +conda install -y conda-build anaconda-client +./build_csprng.sh cpu + +# copy packages over to /remote +# exit docker +# anaconda upload -u pytorch torchcsprng*.bz2 +``` + +### Windows + +```bash +# Open `Git Bash` and change dir to `conda` +./build_csprng.sh 9.0 +./build_csprng.sh 10.0 +./build_csprng.sh cpu + +# copy packages to a output directory +# anaconda upload -u pytorch torchcsprng*.bz2 +``` + +## Wheels + +### Linux + +pushd wheel + +```bash +nvidia-docker run -it --ipc=host --rm -v $(pwd):/remote soumith/manylinux-cuda90:latest bash +cd remote +./linux_manywheel.sh cu90 + +rm -rf /usr/local/cuda* +./linux_manywheel.sh cpu +``` + +```bash +nvidia-docker run -it --ipc=host --rm -v $(pwd):/remote soumith/manylinux-cuda100:latest bash +cd remote +./linux_manywheel.sh cu100 +``` + +wheels are in the folders `cpu`, `cu90`, `cu100`. + +You can upload the `cu90` wheels to twine with `twine upload *.whl`. +Which wheels we upload depends on which wheels PyTorch uploads as default, and right now, it's `cu90`. + +### OSX + +```bash +pushd wheel +./osx_wheel.sh +``` + +### Windows + +```cmd +set PYTORCH_REPO=pytorch + +pushd windows +call build_csprng.bat 90 0.3.0 1 +call build_csprng.bat 100 0.3.0 1 +call build_csprng.bat cpu 0.3.0 1 +``` + +wheels are in the current folder. + +You can upload them to twine with `twine upload *.whl` diff --git a/packaging/conda/build_csprng.sh b/packaging/conda/build_csprng.sh new file mode 100755 index 0000000..56c3037 --- /dev/null +++ b/packaging/conda/build_csprng.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash +if [[ -x "/remote/anaconda_token" ]]; then + . /remote/anaconda_token || true +fi + +set -ex + +if [[ "$CIRCLECI" == 'true' ]]; then + export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.:$PATH" +fi + +# Function to retry functions that sometimes timeout or have flaky failures +retry () { + $* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*) +} + +# Parse arguments and determmine version +########################################################### +if [[ -n "$DESIRED_CUDA" && -n "$TORCHCSPRNG_BUILD_VERSION" && -n "$TORCHCSPRNG_BUILD_NUMBER" ]]; then + desired_cuda="$DESIRED_CUDA" + build_version="$PYTORCH_BUILD_VERSION" + build_number="$PYTORCH_BUILD_NUMBER" +else + if [ "$#" -ne 3 ]; then + echo "Illegal number of parameters. Pass cuda version, pytorch version, build number" + echo "CUDA version should be Mm with no dot, e.g. '80'" + echo "DESIRED_PYTHON should be M.m, e.g. '2.7'" + exit 1 + fi + + desired_cuda="$1" + build_version="$2" + build_number="$3" +fi +if [[ "$desired_cuda" != cpu ]]; then + desired_cuda="$(echo $desired_cuda | tr -d cuda. )" +fi +echo "Building cuda version $desired_cuda and torchcsprng version: $build_version build_number: $build_number" + +if [[ "$desired_cuda" == 'cpu' ]]; then + cpu_only=1 + cuver="cpu" +else + # Switch desired_cuda to be M.m to be consistent with other scripts in + # pytorch/builder + export FORCE_CUDA=1 + cuda_nodot="$desired_cuda" + + if [[ ${#cuda_nodot} -eq 2 ]]; then + desired_cuda="${desired_cuda:0:1}.${desired_cuda:1:1}" + elif [[ ${#cuda_nodot} -eq 3 ]]; then + desired_cuda="${desired_cuda:0:2}.${desired_cuda:2:1}" + else + echo "unknown cuda version $cuda_nodot" + exit 1 + fi + + cuver="cu$cuda_nodot" +fi + +export TORCHCSPRNG_BUILD_VERSION=$build_version +export TORCHCSPRNG_BUILD_NUMBER=$build_number + +if [[ -z "$DESIRED_PYTHON" ]]; then + DESIRED_PYTHON=('3.5' '3.6' '3.7') +fi + +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +if [[ -z "$WIN_PACKAGE_WORK_DIR" ]]; then + WIN_PACKAGE_WORK_DIR="$(echo $(pwd -W) | tr '/' '\\')\\tmp_conda_$(date +%H%M%S)" +fi + +mkdir -p "$WIN_PACKAGE_WORK_DIR" || true +csprng_rootdir="$(realpath ${WIN_PACKAGE_WORK_DIR})/torchcsprng-src" +git config --system core.longpaths true + +if [[ ! -d "$csprng_rootdir" ]]; then + rm -rf "$csprng_rootdir" + git clone "https://github.com/pytorch/csprng" "$csprng_rootdir" + pushd "$csprng_rootdir" + git checkout $PYTORCH_BRANCH + popd +fi + +cd "$SOURCE_DIR" + +export tmp_conda="${WIN_PACKAGE_WORK_DIR}\\conda" +export miniconda_exe="${WIN_PACKAGE_WORK_DIR}\\miniconda.exe" +rm -rf "$tmp_conda" +rm -f "$miniconda_exe" +curl -sSk https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o "$miniconda_exe" +"$SOURCE_DIR/install_conda.bat" && rm "$miniconda_exe" +pushd $tmp_conda +export PATH="$(pwd):$(pwd)/Library/usr/bin:$(pwd)/Library/bin:$(pwd)/Scripts:$(pwd)/bin:$PATH" +popd +retry conda install -yq conda-build + +ANACONDA_USER=pytorch-nightly +conda config --set anaconda_upload no + + +export TORCHCSPRNG_PACKAGE_SUFFIX="" +if [[ "$desired_cuda" == 'cpu' ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="" + export CONDA_CPUONLY_FEATURE="- cpuonly # [not osx]" + export CUDA_VERSION="None" +else + export CONDA_CPUONLY_FEATURE="" + . ./switch_cuda_version.sh $desired_cuda + if [[ "$desired_cuda" == "10.2" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=10.2,<10.3 # [not osx]" + elif [[ "$desired_cuda" == "10.1" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=10.1,<10.2 # [not osx]" + elif [[ "$desired_cuda" == "10.0" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=10.0,<10.1 # [not osx]" + elif [[ "$desired_cuda" == "9.2" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=9.2,<9.3 # [not osx]" + elif [[ "$desired_cuda" == "9.0" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=9.0,<9.1 # [not osx]" + elif [[ "$desired_cuda" == "8.0" ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=8.0,<8.1 # [not osx]" + else + echo "unhandled desired_cuda: $desired_cuda" + exit 1 + fi +fi + +if [[ -z "$PYTORCH_VERSION" ]]; then + export CONDA_CHANNEL_FLAGS="-c pytorch-nightly" + export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | \ + python -c "import os, sys, json, re; cuver = '$cuver'; \ + cuver = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \ + print(re.sub(r'\\+.*$', '', \ + [x['version'] for x in json.load(sys.stdin)['pytorch'] \ + if (x['platform'] == 'darwin' or cuver in x['fn']) \ + and 'py' + os.environ['DESIRED_PYTHON'] in x['fn']][-1]))")" + if [[ -z "$PYTORCH_VERSION" ]]; then + echo "PyTorch version auto detection failed" + echo "No package found for desired_cuda=$desired_cuda and DESIRED_PYTHON=$DESIRED_PYTHON" + exit 1 + fi +else + export CONDA_CHANNEL_FLAGS="-c pytorch -c pytorch-nightly" +fi +if [[ "$desired_cuda" == 'cpu' ]]; then + export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==$PYTORCH_VERSION" + export CONDA_PYTORCH_CONSTRAINT="- pytorch==$PYTORCH_VERSION" +else + export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==${PYTORCH_VERSION}" + export CONDA_PYTORCH_CONSTRAINT="- pytorch==${PYTORCH_VERSION}" +fi + +# Loop through all Python versions to build a package for each +for py_ver in "${DESIRED_PYTHON[@]}"; do + build_string="py${py_ver}_${build_string_suffix}" + folder_tag="${build_string}_$(date +'%Y%m%d')" + + # Create the conda package into this temporary folder. This is so we can find + # the package afterwards, as there's no easy way to extract the final filename + # from conda-build + output_folder="out_$folder_tag" + rm -rf "$output_folder" + mkdir "$output_folder" + + if [[ "$py_ver" == 3.5 ]]; then + export CONDA_TYPING_CONSTRAINT="- typing" + else + export CONDA_TYPING_CONSTRAINT="" + fi + + export VSTOOLCHAIN_PACKAGE=vs2017 + + # We need to build the compiler activation scripts first on Windows + time VSDEVCMD_ARGS=${VSDEVCMD_ARGS[@]} \ + conda build -c "$ANACONDA_USER" \ + --no-anaconda-upload \ + --output-folder "$output_folder" \ + ../$VSTOOLCHAIN_PACKAGE + + cp ../$VSTOOLCHAIN_PACKAGE/conda_build_config.yaml ../torchcsprng/conda_build_config.yaml + + conda config --set anaconda_upload no + echo "Calling conda-build at $(date)" + if [[ "$desired_cuda" == "9.2" ]]; then + time CMAKE_ARGS=${CMAKE_ARGS[@]} \ + BUILD_VERSION="$TORCHCSPRNG_BUILD_VERSION" \ + CU_VERSION="$cuver" \ + SOURCE_ROOT_DIR="$csprng_rootdir" \ + conda build -c "$ANACONDA_USER" \ + -c defaults \ + -c conda-forge \ + -c "numba/label/dev" \ + --no-anaconda-upload \ + --python "$py_ver" \ + --output-folder "$output_folder" \ + --no-verify \ + --no-test \ + ../torchcsprng + else + time CMAKE_ARGS=${CMAKE_ARGS[@]} \ + BUILD_VERSION="$TORCHCSPRNG_BUILD_VERSION" \ + CU_VERSION="$cuver" \ + SOURCE_ROOT_DIR="$csprng_rootdir" \ + conda build -c "$ANACONDA_USER" \ + -c defaults \ + -c conda-forge \ + --no-anaconda-upload \ + --python "$py_ver" \ + --output-folder "$output_folder" \ + --no-verify \ + --no-test \ + ../torchcsprng + fi + echo "Finished conda-build at $(date)" + + # Extract the package for testing + ls -lah "$output_folder" + built_package="$(find $output_folder/ -name '*torchcsprng*.tar.bz2')" + + # Copy the built package to the host machine for persistence before testing + if [[ -n "$PYTORCH_FINAL_PACKAGE_DIR" ]]; then + mkdir -p "$PYTORCH_FINAL_PACKAGE_DIR" || true + cp "$built_package" "$PYTORCH_FINAL_PACKAGE_DIR/" + fi +done + + +set +e diff --git a/packaging/conda/install_conda.bat b/packaging/conda/install_conda.bat new file mode 100644 index 0000000..6052ad0 --- /dev/null +++ b/packaging/conda/install_conda.bat @@ -0,0 +1 @@ +start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda% diff --git a/packaging/conda/switch_cuda_version.sh b/packaging/conda/switch_cuda_version.sh new file mode 100755 index 0000000..342def9 --- /dev/null +++ b/packaging/conda/switch_cuda_version.sh @@ -0,0 +1,28 @@ +if [[ "$OSTYPE" == "msys" ]]; then + CUDA_DIR="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v$1" +else + CUDA_DIR="/usr/local/cuda-$1" +fi + +if ! ls "$CUDA_DIR" +then + echo "folder $CUDA_DIR not found to switch" +fi + +echo "Switching symlink to $CUDA_DIR" +mkdir -p /usr/local +rm -fr /usr/local/cuda +ln -s "$CUDA_DIR" /usr/local/cuda + +if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_VERSION=`ls /usr/local/cuda/bin/cudart64*.dll | head -1 | tr '._' ' ' | cut -d ' ' -f2` + export CUDNN_VERSION=`ls /usr/local/cuda/bin/cudnn64*.dll | head -1 | tr '._' ' ' | cut -d ' ' -f2` +else + export CUDA_VERSION=$(ls /usr/local/cuda/lib64/libcudart.so.*|sort|tac | head -1 | rev | cut -d"." -f -3 | rev) + export CUDNN_VERSION=$(ls /usr/local/cuda/lib64/libcudnn.so.*|sort|tac | head -1 | rev | cut -d"." -f -3 | rev) +fi + +ls -alh /usr/local/cuda + +echo "CUDA_VERSION=$CUDA_VERSION" +echo "CUDNN_VERSION=$CUDNN_VERSION" diff --git a/packaging/wheel/linux_manywheel.sh b/packaging/wheel/linux_manywheel.sh new file mode 100644 index 0000000..d6471aa --- /dev/null +++ b/packaging/wheel/linux_manywheel.sh @@ -0,0 +1,62 @@ +#!/bin/bash +set -ex + +if [ "$#" -ne 1 ]; then + echo "Illegal number of parameters. Pass cuda version" + echo "CUDA version should be cu92, cu100 or cpu" + exit 1 +fi +export CUVER="$1" # cu[0-9]* cpu + +if [[ "$CUVER" == "cu102" ]]; then + cu_suffix="" +else + cu_suffix="+$CUVER" +fi + +export TORCHCSPRNG_BUILD_VERSION="0.4.0.dev$(date "+%Y%m%d")${cu_suffix}" +export TORCHCSPRNG_BUILD_NUMBER="1" +export TORCHCSPRNG_LOCAL_VERSION_LABEL="$CUVER" +export OUT_DIR="/remote/$CUVER" + +pushd /opt/python +DESIRED_PYTHON=(*/) +popd +for desired_py in "${DESIRED_PYTHON[@]}"; do + python_installations+=("/opt/python/$desired_py") +done + +OLD_PATH=$PATH +cd /tmp +rm -rf csprng +git clone https://github.com/pytorch/csprng + +cd /tmp/csprng + +for PYDIR in "${python_installations[@]}"; do + export PATH=$PYDIR/bin:$OLD_PATH + pip install --upgrade pip + pip install numpy pyyaml future + + pip uninstall -y torch || true + pip uninstall -y torch_nightly || true + + export TORCHCSPRNG_PYTORCH_DEPENDENCY_NAME=torch_nightly + pip install torch_nightly -f https://download.pytorch.org/whl/nightly/$CUVER/torch_nightly.html + # CPU/CUDA variants of PyTorch have ABI compatible PyTorch for + # the CPU only bits. Therefore, we + # strip off the local package qualifier, but ONLY if we're + # doing a CPU build. + if [[ "$CUVER" == "cpu" ]]; then + export TORCHCSPRNG_PYTORCH_DEPENDENCY_VERSION="$(pip show torch_nightly | grep ^Version: | sed 's/Version: \+//' | sed 's/+.\+//')" + else + export TORCHCSPRNG_PYTORCH_DEPENDENCY_VERSION="$(pip show torch_nightly | grep ^Version: | sed 's/Version: \+//')" + fi + echo "Building against ${TORCHCSPRNG_PYTORCH_DEPENDENCY_VERSION}" + + pip install ninja + python setup.py clean + python setup.py bdist_wheel + mkdir -p $OUT_DIR + cp dist/*.whl $OUT_DIR/ +done diff --git a/packaging/wheel/osx_wheel.sh b/packaging/wheel/osx_wheel.sh new file mode 100644 index 0000000..80d9f06 --- /dev/null +++ b/packaging/wheel/osx_wheel.sh @@ -0,0 +1,52 @@ +if [[ ":$PATH:" == *"conda"* ]]; then + echo "existing anaconda install in PATH, remove it and run script" + exit 1 +fi +# download and activate anaconda +rm -rf ~/minconda_wheel_env_tmp +wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh && \ + chmod +x Miniconda3-latest-MacOSX-x86_64.sh && \ + ./Miniconda3-latest-MacOSX-x86_64.sh -b -p ~/minconda_wheel_env_tmp && \ + rm Miniconda3-latest-MacOSX-x86_64.sh + +. ~/minconda_wheel_env_tmp/bin/activate + + +export TORCHCSPRNG_BUILD_VERSION="0.4.0.dev$(date "+%Y%m%d")" +export TORCHCSPRNG_BUILD_NUMBER="1" +export OUT_DIR=~/torchcsprng_wheels + +export MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ + +pushd /tmp +rm -rf csprng +git clone https://github.com/pytorch/csprng +pushd csprng + +desired_pythons=( "2.7" "3.5" "3.6" "3.7" ) +# for each python +for desired_python in "${desired_pythons[@]}" +do + # create and activate python env + env_name="env$desired_python" + conda create -yn $env_name python="$desired_python" + conda activate $env_name + + pip uninstall -y torch || true + pip uninstall -y torch_nightly || true + + export TORCHCSPRNG_PYTORCH_DEPENDENCY_NAME=torch_nightly + pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html + export TORCHCSPRNG_PYTORCH_DEPENDENCY_VERSION="$(pip show torch_nightly | grep ^Version: | sed 's/Version: *//')" + echo "Building against ${TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION}" + + # install torchcsprng dependencies + pip install ninja scipy pytest + + python setup.py clean + python setup.py bdist_wheel + mkdir -p $OUT_DIR + cp dist/*.whl $OUT_DIR/ +done +popd +popd diff --git a/packaging/windows/azure-pipelines-ci.yml b/packaging/windows/azure-pipelines-ci.yml new file mode 100644 index 0000000..6f9f346 --- /dev/null +++ b/packaging/windows/azure-pipelines-ci.yml @@ -0,0 +1,11 @@ + +# Turn off auto builds for commits +trigger: none +pr: none + +jobs: +- template: templates/build_task.yml + parameters: + package: 'Wheels' + spec: 'CPU' + msagent: true diff --git a/packaging/windows/azure-pipelines.yml b/packaging/windows/azure-pipelines.yml new file mode 100644 index 0000000..d024057 --- /dev/null +++ b/packaging/windows/azure-pipelines.yml @@ -0,0 +1,35 @@ + +# Turn off auto builds for commits +trigger: none +pr: none + +jobs: +- template: templates/auth_task.yml + +- template: templates/build_task.yml + parameters: + package: 'Wheels' + spec: 'CPU' + msagent: true + +- template: templates/build_task.yml + parameters: + package: 'Conda' + spec: 'CPU' + msagent: true + +- template: templates/build_task.yml + parameters: + package: 'Wheels' + spec: 'CUDA' + msagent: true + +- template: templates/build_task.yml + parameters: + package: 'Conda' + spec: 'CUDA' + msagent: true + +- template: templates/linux_build_task.yml + parameters: + msagent: $(ms.hosted.agent.cpu) diff --git a/packaging/windows/build_csprng.bat b/packaging/windows/build_csprng.bat new file mode 100644 index 0000000..85aec48 --- /dev/null +++ b/packaging/windows/build_csprng.bat @@ -0,0 +1,145 @@ +@echo off + +:: This script parses args, installs required libraries (miniconda, MKL, +:: Magma), and then delegates to cpu.bat, cuda80.bat, etc. + +IF NOT "%CUDA_VERSION%" == "" IF NOT "%TORCHCSPRNG_BUILD_VERSION%" == "" if NOT "%TORCHCSPRNG_BUILD_NUMBER%" == "" goto env_end +if "%~1"=="" goto arg_error +if "%~2"=="" goto arg_error +if "%~3"=="" goto arg_error +if NOT "%~4"=="" goto arg_error +goto arg_end + +:arg_error + +echo Illegal number of parameters. Pass cuda version, pytorch version, build number +echo CUDA version should be Mm with no dot, e.g. '80' +echo DESIRED_PYTHON should be M.m, e.g. '2.7' +exit /b 1 + +:arg_end + +set CUDA_VERSION=%~1 +set TORCHCSPRNG_BUILD_VERSION=%~2 +set TORCHCSPRNG_BUILD_NUMBER=%~3 + +set BUILD_VERSION=%TORCHCSPRNG_BUILD_VERSION% + +:env_end + +if NOT "%CUDA_VERSION%" == "cpu" ( + set CUDA_PREFIX=cuda%CUDA_VERSION% + set CUVER=cu%CUDA_VERSION% + set FORCE_CUDA=1 +) else ( + set CUDA_PREFIX=cpu + set CUVER=cpu +) + +set BUILD_CSPRNG=1 +REM set TORCH_WHEEL=torch -f https://download.pytorch.org/whl/%CUVER%/stable.html --no-index + +IF "%DESIRED_PYTHON%" == "" set DESIRED_PYTHON=3.5;3.6;3.7 +set DESIRED_PYTHON_PREFIX=%DESIRED_PYTHON:.=% +set DESIRED_PYTHON_PREFIX=py%DESIRED_PYTHON_PREFIX:;=;py% + +set SRC_DIR=%~dp0 +pushd %SRC_DIR% + +:: Install Miniconda3 +set "CONDA_HOME=%CD%\conda" +set "tmp_conda=%CONDA_HOME%" +set "miniconda_exe=%CD%\miniconda.exe" +rmdir /s /q conda +del miniconda.exe +curl -k https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o "%miniconda_exe%" +call ..\conda\install_conda.bat +IF ERRORLEVEL 1 exit /b 1 +set "ORIG_PATH=%PATH%" +set "PATH=%CONDA_HOME%;%CONDA_HOME%\scripts;%CONDA_HOME%\Library\bin;%PATH%" + +:: Create a new conda environment +setlocal EnableDelayedExpansion +FOR %%v IN (%DESIRED_PYTHON%) DO ( + set PYTHON_VERSION_STR=%%v + set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=! + conda remove -n py!PYTHON_VERSION_STR! --all -y || rmdir %CONDA_HOME%\envs\py!PYTHON_VERSION_STR! /s + conda create -n py!PYTHON_VERSION_STR! -y -q -c defaults -c conda-forge numpy>=1.11 mkl>=2018 python=%%v ca-certificates scipy +) + +:: Uncomment for stable releases +:: FOR %%v IN (%DESIRED_PYTHON%) DO ( +:: set PYTHON_VERSION_STR=%%v +:: set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=! +:: set "PATH=%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!;%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!\scripts;%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!\Library\bin;%ORIG_PATH%" + +:: if "%CUDA_VERSION%" == "100" ( +:: set TORCH_WHEEL=https://download.pytorch.org/whl/%CUVER%/torch-1.2.0-cp!PYTHON_VERSION_STR!-cp!PYTHON_VERSION_STR!m-win_amd64.whl +:: ) else ( +:: set TORCH_WHEEL=https://download.pytorch.org/whl/%CUVER%/torch-1.2.0%%2B%CUVER%-cp!PYTHON_VERSION_STR!-cp!PYTHON_VERSION_STR!m-win_amd64.whl +:: ) +:: echo Installing !TORCH_WHEEL!... +:: pip install "!TORCH_WHEEL!" +:: ) + +:: Uncomment for nightly releases +FOR %%v IN (%DESIRED_PYTHON%) DO ( + set PYTHON_VERSION_STR=%%v + set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=! + set "PATH=%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!;%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!\scripts;%CONDA_HOME%\envs\py!PYTHON_VERSION_STR!\Library\bin;%ORIG_PATH%" + + set TORCH_WHEEL=torch --pre -f https://download.pytorch.org/whl/nightly/%CUVER%/torch_nightly.html + echo Installing !TORCH_WHEEL!... + pip install !TORCH_WHEEL! +) + +endlocal + +if "%DEBUG%" == "1" ( + set BUILD_TYPE=debug +) ELSE ( + set BUILD_TYPE=release +) + +:: Install sccache +if "%USE_SCCACHE%" == "1" ( + mkdir %CD%\tmp_bin + curl -k https://s3.amazonaws.com/ossci-windows/sccache.exe --output %CD%\tmp_bin\sccache.exe + if not "%CUDA_VERSION%" == "" ( + copy %CD%\tmp_bin\sccache.exe %CD%\tmp_bin\nvcc.exe + + set CUDA_NVCC_EXECUTABLE=%CD%\tmp_bin\nvcc + set "PATH=%CD%\tmp_bin;%PATH%" + ) +) + +for %%v in (%DESIRED_PYTHON_PREFIX%) do ( + :: Activate Python Environment + set PYTHON_PREFIX=%%v + set "PATH=%CONDA_HOME%\envs\%%v;%CONDA_HOME%\envs\%%v\scripts;%CONDA_HOME%\envs\%%v\Library\bin;%ORIG_PATH%" + if defined INCLUDE ( + set "INCLUDE=%INCLUDE%;%CONDA_HOME%\envs\%%v\Library\include" + ) else ( + set "INCLUDE=%CONDA_HOME%\envs\%%v\Library\include" + ) + if defined LIB ( + set "LIB=%LIB%;%CONDA_HOME%\envs\%%v\Library\lib" + ) else ( + set "LIB=%CONDA_HOME%\envs\%%v\Library\lib" + ) + @setlocal + :: Set Flags + if NOT "%CUDA_VERSION%"=="cpu" ( + set CUDNN_VERSION=7 + ) + call %CUDA_PREFIX%.bat + IF ERRORLEVEL 1 exit /b 1 + call internal\test.bat + IF ERRORLEVEL 1 exit /b 1 + @endlocal +) + +set "PATH=%ORIG_PATH%" +popd + +IF ERRORLEVEL 1 exit /b 1 diff --git a/packaging/windows/cpu.bat b/packaging/windows/cpu.bat new file mode 100644 index 0000000..1897fb5 --- /dev/null +++ b/packaging/windows/cpu.bat @@ -0,0 +1,37 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +echo Disabling CUDA +set NO_CUDA=1 +set USE_CUDA=0 + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy_cpu.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/cuda101.bat b/packaging/windows/cuda101.bat new file mode 100644 index 0000000..016baec --- /dev/null +++ b/packaging/windows/cuda101.bat @@ -0,0 +1,59 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +set NO_CUDA= +set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 + +IF "%NVTOOLSEXT_PATH%"=="" ( + echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing + exit /b 1 + goto optcheck +) + +IF "%CUDA_PATH_V10_1%"=="" ( + echo CUDA 10.1 not found, failing + exit /b 1 +) ELSE ( + IF "%BUILD_CSPRNG%" == "" ( + set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0;7.5 + set TORCH_NVCC_FLAGS=-Xfatbin -compress-all + ) ELSE ( + set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 + ) + + set "CUDA_PATH=%CUDA_PATH_V10_1%" + set "PATH=%CUDA_PATH_V10_1%\bin;%PATH%" +) + +:optcheck + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/cuda102.bat b/packaging/windows/cuda102.bat new file mode 100644 index 0000000..d5a0bdf --- /dev/null +++ b/packaging/windows/cuda102.bat @@ -0,0 +1,59 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +set NO_CUDA= +set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 + +IF "%NVTOOLSEXT_PATH%"=="" ( + echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing + exit /b 1 + goto optcheck +) + +IF "%CUDA_PATH_V10_2%"=="" ( + echo CUDA 10.2 not found, failing + exit /b 1 +) ELSE ( + IF "%BUILD_CSPRNG%" == "" ( + set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0;7.5 + set TORCH_NVCC_FLAGS=-Xfatbin -compress-all + ) ELSE ( + set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 + ) + + set "CUDA_PATH=%CUDA_PATH_V10_2%" + set "PATH=%CUDA_PATH_V10_2%\bin;%PATH%" +) + +:optcheck + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/cuda92.bat b/packaging/windows/cuda92.bat new file mode 100644 index 0000000..7f520da --- /dev/null +++ b/packaging/windows/cuda92.bat @@ -0,0 +1,59 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +set USE_CUDA= +set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 + +IF "%NVTOOLSEXT_PATH%"=="" ( + echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing + exit /b 1 + goto optcheck +) + +IF "%CUDA_PATH_V9_2%"=="" ( + echo CUDA 9.2 not found, failing + exit /b 1 +) ELSE ( + IF "%BUILD_CSPRNG%" == "" ( + set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0 + set TORCH_NVCC_FLAGS=-Xfatbin -compress-all + ) ELSE ( + set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50 + ) + + set "CUDA_PATH=%CUDA_PATH_V9_2%" + set "PATH=%CUDA_PATH_V9_2%\bin;%PATH%" +) + +:optcheck + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/old/cuda100.bat b/packaging/windows/old/cuda100.bat new file mode 100644 index 0000000..f088bca --- /dev/null +++ b/packaging/windows/old/cuda100.bat @@ -0,0 +1,59 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +set NO_CUDA= +set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 + +IF "%NVTOOLSEXT_PATH%"=="" ( + echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing + exit /b 1 + goto optcheck +) + +IF "%CUDA_PATH_V10_0%"=="" ( + echo CUDA 10.0 not found, failing + exit /b 1 +) ELSE ( + IF "%BUILD_CSPRNG%" == "" ( + set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;6.1;7.0;7.5 + set TORCH_NVCC_FLAGS=-Xfatbin -compress-all + ) ELSE ( + set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_50,code=compute_50 + ) + + set "CUDA_PATH=%CUDA_PATH_V10_0%" + set "PATH=%CUDA_PATH_V10_0%\bin;%PATH%" +) + +:optcheck + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/old/cuda90.bat b/packaging/windows/old/cuda90.bat new file mode 100644 index 0000000..520b794 --- /dev/null +++ b/packaging/windows/old/cuda90.bat @@ -0,0 +1,59 @@ +@echo off + +IF NOT "%BUILD_CSPRNG%" == "" ( + set MODULE_NAME=csprng +) ELSE ( + set MODULE_NAME=pytorch +) + +IF NOT EXIST "setup.py" IF NOT EXIST "%MODULE_NAME%" ( + call internal\clone.bat + cd .. + IF ERRORLEVEL 1 goto eof +) ELSE ( + call internal\clean.bat +) + +call internal\check_deps.bat +IF ERRORLEVEL 1 goto eof + +REM Check for optional components + +set NO_CUDA= +set CMAKE_GENERATOR=Visual Studio 15 2017 Win64 + +IF "%NVTOOLSEXT_PATH%"=="" ( + echo NVTX ^(Visual Studio Extension ^for CUDA^) ^not installed, failing + exit /b 1 + goto optcheck +) + +IF "%CUDA_PATH_V9_0%"=="" ( + echo CUDA 9 not found, failing + exit /b 1 +) ELSE ( + IF "%BUILD_CSPRNG%" == "" ( + set TORCH_CUDA_ARCH_LIST=3.5;5.0+PTX;6.0;7.0 + set TORCH_NVCC_FLAGS=-Xfatbin -compress-all + ) ELSE ( + set NVCC_FLAGS=-D__CUDA_NO_HALF_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_50,code=compute_50 + ) + + set "CUDA_PATH=%CUDA_PATH_V9_0%" + set "PATH=%CUDA_PATH_V9_0%\bin;%PATH%" +) + +:optcheck + +IF "%BUILD_CSPRNG%" == "" ( + call internal\check_opts.bat + IF ERRORLEVEL 1 goto eof + + call internal\copy.bat + IF ERRORLEVEL 1 goto eof +) + +call internal\setup.bat +IF ERRORLEVEL 1 goto eof + +:eof diff --git a/packaging/windows/templates/auth_task.yml b/packaging/windows/templates/auth_task.yml new file mode 100644 index 0000000..7554ffa --- /dev/null +++ b/packaging/windows/templates/auth_task.yml @@ -0,0 +1,17 @@ +jobs: +- job: 'VSTS_Auth_Task' + timeoutInMinutes: 5 + cancelTimeoutInMinutes: 5 + variables: + - group: 'peterjc-vsts-token' + + pool: + vmImage: 'vs2017-win2016' + + steps: + - checkout: self + clean: true + + - template: vsts_auth.yml + parameters: + auth: $(vsts_auth) diff --git a/packaging/windows/templates/build_conda.yml b/packaging/windows/templates/build_conda.yml new file mode 100644 index 0000000..ce29c06 --- /dev/null +++ b/packaging/windows/templates/build_conda.yml @@ -0,0 +1,15 @@ +parameters: + msagent: false + +steps: +- bash: 'find . -name "*.sh" -exec dos2unix {} +' + displayName: Replace file endings + +- script: 'if not exist %PYTORCH_FINAL_PACKAGE_DIR% mkdir %PYTORCH_FINAL_PACKAGE_DIR%' + displayName: 'Create final package directory' + +- bash: './packaging/conda/build_csprng.sh $CUDA_VERSION $TORCHCSPRNG_BUILD_VERSION $TORCHCSPRNG_BUILD_NUMBER' + displayName: Build + env: + ${{ if eq(parameters.msagent, 'true') }}: + MAX_JOBS: 2 diff --git a/packaging/windows/templates/build_task.yml b/packaging/windows/templates/build_task.yml new file mode 100644 index 0000000..124e4a1 --- /dev/null +++ b/packaging/windows/templates/build_task.yml @@ -0,0 +1,161 @@ +parameters: + package: '' + spec: '' + jobDesc: '' + packageDesc: '' + msagent: true + cpuEnabled: true + cudaEnabled: true + condaEnabled: true + wheelsEnabled: true + override: false + +jobs: +- job: 'Windows_${{ parameters.spec }}_${{ parameters.package }}_Build' + timeoutInMinutes: 60 + cancelTimeoutInMinutes: 5 + condition: > + or(and(eq('${{ parameters.package }}', 'Conda'), eq('${{ parameters.spec }}', 'CPU'), + eq('${{ parameters.condaEnabled }}', 'true'), eq('${{ parameters.cpuEnabled }}', 'true')), + and(eq('${{ parameters.package }}', 'Wheels'), eq('${{ parameters.spec }}', 'CPU'), + eq('${{ parameters.wheelsEnabled }}', 'true'), eq('${{ parameters.cpuEnabled }}', 'true')), + and(eq('${{ parameters.package }}', 'Conda'), eq('${{ parameters.spec }}', 'CUDA'), + eq('${{ parameters.condaEnabled }}', 'true'), eq('${{ parameters.cudaEnabled }}', 'true')), + and(eq('${{ parameters.package }}', 'Wheels'), eq('${{ parameters.spec }}', 'CUDA'), + eq('${{ parameters.wheelsEnabled }}', 'true'), eq('${{ parameters.cudaEnabled }}', 'true'))) + variables: + - ${{ if eq(parameters.override, 'true') }}: + - name: TORCHCSPRNG_BUILD_NUMBER + value: 1 + - name: PYTORCH_REPO + value: 'pytorch' + - name: PYTORCH_BRANCH + value: 'v0.4.0' + - ${{ if eq(parameters.msagent, 'true') }}: + - name: USE_SCCACHE + value: 0 + - ${{ if eq(parameters.msagent, 'false') }}: + - name: USE_SCCACHE + value: 1 + - ${{ if eq(parameters.package, 'Conda') }}: + - group: peterjc_anaconda_token + - name: PYTORCH_FINAL_PACKAGE_DIR + value: '$(Build.Repository.LocalPath)\packaging\windows\output' + + strategy: + maxParallel: 10 + matrix: + ${{ if eq(parameters.spec, 'CPU') }}: + PY3.5: + DESIRED_PYTHON: 3.5 + CUDA_VERSION: cpu + PY3.6: + DESIRED_PYTHON: 3.6 + CUDA_VERSION: cpu + PY3.7: + DESIRED_PYTHON: 3.7 + CUDA_VERSION: cpu + PY3.8: + DESIRED_PYTHON: 3.8 + CUDA_VERSION: cpu + ${{ if ne(parameters.spec, 'CPU') }}: + PY3.5_92: + DESIRED_PYTHON: 3.5 + CUDA_VERSION: 92 + PY3.6_92: + DESIRED_PYTHON: 3.6 + CUDA_VERSION: 92 + PY3.7_92: + DESIRED_PYTHON: 3.7 + CUDA_VERSION: 92 + PY3.8_92: + DESIRED_PYTHON: 3.8 + CUDA_VERSION: 92 + PY3.5_101: + DESIRED_PYTHON: 3.5 + CUDA_VERSION: 101 + PY3.6_101: + DESIRED_PYTHON: 3.6 + CUDA_VERSION: 101 + PY3.7_101: + DESIRED_PYTHON: 3.7 + CUDA_VERSION: 101 + PY3.8_101: + DESIRED_PYTHON: 3.8 + CUDA_VERSION: 101 + PY3.5_102: + DESIRED_PYTHON: 3.5 + CUDA_VERSION: 102 + PY3.6_102: + DESIRED_PYTHON: 3.6 + CUDA_VERSION: 102 + PY3.7_102: + DESIRED_PYTHON: 3.7 + CUDA_VERSION: 102 + PY3.8_102: + DESIRED_PYTHON: 3.8 + CUDA_VERSION: 102 + + pool: + ${{ if eq(parameters.msagent, 'true') }}: + vmImage: 'vs2017-win2016' + ${{ if eq(parameters.msagent, 'false') }}: + name: 'release' + + steps: + - checkout: self + clean: true + + - template: setup_env_for_msagent.yml + parameters: + msagent: ${{ parameters.msagent }} + + # - ${{ if and(eq(parameters.override, 'true'), eq(parameters.package, 'Wheels')) }}: + # - template: override_pytorch_version.yml + + - template: setup_nightly_variables.yml + parameters: + package: ${{ parameters.package }} + + - ${{ if eq(parameters.package, 'Wheels') }}: + - template: build_wheels.yml + parameters: + msagent: ${{ parameters.msagent }} + + - ${{ if eq(parameters.package, 'Conda') }}: + - template: build_conda.yml + parameters: + msagent: ${{ parameters.msagent }} + + - ${{ if or(eq(parameters.package, 'Wheels'), eq(parameters.package, 'Conda')) }}: + - template: publish_test_results.yml + parameters: + msagent: ${{ parameters.msagent }} + + # If you want to upload binaries to S3 & Anaconda Cloud, please uncomment this section. + - ${{ if and(eq(parameters.package, 'Wheels'), eq(parameters.spec, 'CPU')) }}: + - template: upload_to_s3.yml + parameters: + cuVer: '$(CUDA_VERSION)' + cudaVer: '$(CUDA_VERSION)' + + - ${{ if and(eq(parameters.package, 'Wheels'), ne(parameters.spec, 'CPU')) }}: + - template: upload_to_s3.yml + parameters: + cuVer: 'cu$(CUDA_VERSION)' + cudaVer: 'cuda$(CUDA_VERSION)' + + - ${{ if eq(parameters.package, 'Conda') }}: + - template: upload_to_conda.yml + parameters: + user: $(peterjc_conda_username) + pass: $(peterjc_conda_password) + + # If you want to upload binaries to Azure Git, please uncomment this section. + # - ${{ if or(eq(parameters.package, 'Wheels'), eq(parameters.package, 'Conda')) }}: + # - template: publish_test_results.yml + # parameters: + # msagent: ${{ parameters.msagent }} + # - template: publish_packages.yml + # parameters: + # package: ${{ parameters.package }} diff --git a/packaging/windows/templates/build_wheels.yml b/packaging/windows/templates/build_wheels.yml new file mode 100644 index 0000000..8393fdb --- /dev/null +++ b/packaging/windows/templates/build_wheels.yml @@ -0,0 +1,9 @@ +parameters: + msagent: false + +steps: +- script: 'call packaging/windows/build_csprng.bat %CUDA_VERSION% %TORCHCSPRNG_BUILD_VERSION% %TORCHCSPRNG_BUILD_NUMBER%' + displayName: Build + env: + ${{ if eq(parameters.msagent, 'true') }}: + MAX_JOBS: 2 diff --git a/packaging/windows/templates/linux_build_task.yml b/packaging/windows/templates/linux_build_task.yml new file mode 100644 index 0000000..0b32892 --- /dev/null +++ b/packaging/windows/templates/linux_build_task.yml @@ -0,0 +1,38 @@ +parameters: + msagent: true + enabled: false + +jobs: +- job: 'Linux_CPU_Conda_Build' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 5 + condition: ${{ eq(parameters.enabled, 'true') }} + variables: + CUDA_VERSION: cpu + TORCH_CONDA_BUILD_FOLDER: pytorch-nightly + PYTORCH_FINAL_PACKAGE_DIR: '$(Build.Repository.LocalPath)/output' + + strategy: + maxParallel: 10 + matrix: + PY3.5: + DESIRED_PYTHON: 3.5 + + pool: + vmImage: 'ubuntu-16.04' + + steps: + - checkout: self + clean: true + + - script: 'sudo apt-get install p7zip-full' + displayName: 'Install 7Zip' + + - task: CondaEnvironment@1 + displayName: 'Install conda-build' + inputs: + packageSpecs: 'conda-build' + + - template: build_conda.yml + parameters: + msagent: ${{ parameters.msagent }} diff --git a/packaging/windows/templates/override_pytorch_version.yml b/packaging/windows/templates/override_pytorch_version.yml new file mode 100644 index 0000000..8af93ae --- /dev/null +++ b/packaging/windows/templates/override_pytorch_version.yml @@ -0,0 +1,6 @@ +steps: +- script: 'windows/internal/override_pytorch_version.bat' + displayName: 'Override PyTorch Build Version for Wheels' + +- script: 'echo $(PYTORCH_BUILD_VERSION)' + displayName: 'Show PyTorch Build Version' diff --git a/packaging/windows/templates/publish_packages.yml b/packaging/windows/templates/publish_packages.yml new file mode 100644 index 0000000..51ce824 --- /dev/null +++ b/packaging/windows/templates/publish_packages.yml @@ -0,0 +1,8 @@ +parameters: + package: '' + +steps: +- script: 'packaging/windows/internal/publish.bat' + displayName: 'Upload packages to Azure DevOps Repo' + env: + PACKAGEFULLNAME: ${{ parameters.package }} diff --git a/packaging/windows/templates/publish_test_results.yml b/packaging/windows/templates/publish_test_results.yml new file mode 100644 index 0000000..1e0dc02 --- /dev/null +++ b/packaging/windows/templates/publish_test_results.yml @@ -0,0 +1,6 @@ +steps: +- task: PublishTestResults@2 # No test results to publish + inputs: + testResultsFiles: 'windows/pytorch/test/**/*.xml' + testRunTitle: 'Publish test results' + enabled: false diff --git a/packaging/windows/templates/setup_env_for_msagent.yml b/packaging/windows/templates/setup_env_for_msagent.yml new file mode 100644 index 0000000..377734f --- /dev/null +++ b/packaging/windows/templates/setup_env_for_msagent.yml @@ -0,0 +1,25 @@ +parameters: + msagent: false + +steps: +- ${{ if eq(parameters.msagent, 'true') }}: + - task: BatchScript@1 + displayName: 'Install 7Zip & cURL' + inputs: + filename: 'packaging/windows/internal/dep_install.bat' + + modifyEnvironment: true + + - task: BatchScript@1 + displayName: 'Install Visual Studio 2017' + inputs: + filename: 'packaging/windows/internal/vs_install.bat' + + modifyEnvironment: true + + - task: BatchScript@1 + displayName: 'Install CUDA' + inputs: + filename: 'packaging/windows/internal/cuda_install.bat' + + modifyEnvironment: true diff --git a/packaging/windows/templates/setup_nightly_variables.yml b/packaging/windows/templates/setup_nightly_variables.yml new file mode 100644 index 0000000..94b2fe9 --- /dev/null +++ b/packaging/windows/templates/setup_nightly_variables.yml @@ -0,0 +1,11 @@ +parameters: + package: '' + +steps: +- task: BatchScript@1 + displayName: 'Setup nightly variables' + inputs: + filename: 'packaging/windows/internal/nightly_defaults.bat' + arguments: ${{ parameters.package }} + + modifyEnvironment: true diff --git a/packaging/windows/templates/upload_to_conda.yml b/packaging/windows/templates/upload_to_conda.yml new file mode 100644 index 0000000..dc172bc --- /dev/null +++ b/packaging/windows/templates/upload_to_conda.yml @@ -0,0 +1,10 @@ +parameters: + user: '' + pass: '' + +steps: +- script: 'call packaging/windows/internal/upload.bat' + displayName: 'Upload packages to Anaconda Cloud' + env: + PYTORCH_ANACONDA_USERNAME: ${{ parameters.user }} + PYTORCH_ANACONDA_PASSWORD: ${{ parameters.pass }} diff --git a/packaging/windows/templates/upload_to_s3.yml b/packaging/windows/templates/upload_to_s3.yml new file mode 100644 index 0000000..1de91b5 --- /dev/null +++ b/packaging/windows/templates/upload_to_s3.yml @@ -0,0 +1,15 @@ +parameters: + cuVer: '' + cudaVer: '' + +steps: +- task: AmazonWebServices.aws-vsts-tools.S3Upload.S3Upload@1 + displayName: 'Upload ${{ parameters.cuVer }} wheel to S3' + inputs: + awsCredentials: 'Pytorch S3 bucket' + bucketName: 'pytorch' + sourceFolder: 'packaging/windows/output' + globExpressions: '*.whl' + targetFolder: 'whl/nightly/${{ parameters.cuVer }}/' + filesAcl: 'public-read' + flattenFolders: 'true' diff --git a/packaging/windows/templates/vsts_auth.yml b/packaging/windows/templates/vsts_auth.yml new file mode 100644 index 0000000..fde767d --- /dev/null +++ b/packaging/windows/templates/vsts_auth.yml @@ -0,0 +1,8 @@ +parameters: + auth: '' + +steps: +- script: 'call packaging/windows/internal/auth.bat' + displayName: 'Sign in to Azure Pipelines' + env: + VSTS_AUTH: ${{ parameters.auth }} diff --git a/setup.py b/setup.py index 0141154..23aad6c 100644 --- a/setup.py +++ b/setup.py @@ -2,19 +2,16 @@ from sys import platform import subprocess from setuptools import setup +import torch from torch.utils import cpp_extension -cu_version = os.getenv('CU_VERSION', default=None) -if cu_version is None: - use_cuda = os.getenv('USE_CUDA', default=None) - if use_cuda is None: - build_cuda = cpp_extension.CUDA_HOME is not None - else: - build_cuda = use_cuda -else: - build_cuda = cu_version != 'cpu' +build_cuda = torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1' -CXX_FLAGS = [] +CXX_FLAGS = os.getenv('CXX_FLAGS', '') +if CXX_FLAGS == '': + CXX_FLAGS = [] +else: + CXX_FLAGS = CXX_FLAGS.split(' ') if platform == 'linux': CXX_FLAGS.append('-fopenmp') @@ -23,14 +20,10 @@ NVCC_FLAGS = [] else: NVCC_FLAGS = NVCC_FLAGS.split(' ') -# TODO: replace with a loop: -if '--expt-extended-lambda' not in NVCC_FLAGS: - NVCC_FLAGS.append('--expt-extended-lambda') -if '-Xcompiler' not in NVCC_FLAGS: - NVCC_FLAGS.append('-Xcompiler') -if '-fopenmp' not in NVCC_FLAGS: - NVCC_FLAGS.append('-fopenmp') -# NVCC_FLAGS = ['--expt-extended-lambda', '-Xcompiler', '-fopenmp'] + +for flag in ['--expt-extended-lambda', '-Xcompiler', '-fopenmp']: + if not flag in NVCC_FLAGS: + NVCC_FLAGS.append(flag) module_name = 'torchcsprng' @@ -73,22 +66,46 @@ with open("README.md", "r") as fh: long_description = fh.read() +pytorch_dep = 'torch' +if os.getenv('PYTORCH_VERSION'): + pytorch_dep += "==" + os.getenv('PYTORCH_VERSION') + +requirements = [ + pytorch_dep, +] + setup( + # Metadata name=package_name, version=version, author="Pavel Belevich", author_email="pbelevich@fb.com", + url="https://github.com/pytorch/csprng", description="Cryptographically secure pseudorandom number generators for PyTorch", - # long_description=long_description, - # long_description_content_type="text/markdown", + long_description=long_description, + long_description_content_type="text/markdown", license='BSD-3', - url="https://github.com/pytorch/csprng", + + # Package info classifiers=[ - "Programming Language :: Python :: 3", + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Programming Language :: C++', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', ], python_requires='>=3.6', + install_requires=requirements, ext_modules=[csprng_ext], - cmdclass={'build_ext': cpp_extension.BuildExtension}) + cmdclass={'build_ext': cpp_extension.BuildExtension} +) From edafb4b27ae5085c11f16d98330710716198feba Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 3 Aug 2020 04:30:42 -0700 Subject: [PATCH 009/750] 2020-08-03 nightly release (d3e442f4a852eae8ea064b1e354ecedd5848fab8) --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..b91e23b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to make participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic +address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 36eaf3433339b48eaf6890389311a1e4f12fbd4a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 4 Aug 2020 04:31:04 -0700 Subject: [PATCH 010/750] 2020-08-04 nightly release (4ae27023009c7ee8c5550897c43d9c52676d2472) --- README.md | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5c7a1e5..df66a3a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ It makes CSPRNG both crypto-secure and parallel on CUDA and CPU. Advantages: -- A user can choose either seed-based(for testing) or random device based(fully crypto-secure) generators +- The user can choose either seed-based(for testing) or random device based(fully crypto-secure) generators - One generator instance for both CPU and CUDA tensors(because the encryption key is always generated on CPU) - CPU random number generation is also parallel(unlike default PyTorch CPU generator) @@ -45,12 +45,12 @@ The following list of methods supports all forementioned PRNGs: ## Installation -CSPRNG works on the following operating systems and can be used with PyTorch tensors on the following devices: +CSPRNG works with Python 3.6/3.7/3.8 on the following operating systems and can be used with PyTorch tensors on the following devices: -| Tensor Device Type | Linux | macOS | MS Window | -|--------------------|-----------|---------------|-----------| -| CPU | Supported | Supported | Supported | -| CUDA | Supported | Not Supported | Planned* | +| Tensor Device Type | Linux | macOS | MS Window | +|--------------------|-----------|---------------|----------------| +| CPU | Supported | Supported | Supported | +| CUDA | Supported | Not Supported | Coming | ### Binaries @@ -59,23 +59,28 @@ Anaconda: ```console conda install torchcsprng -c pytorch ``` -for nightly builds: -```console -conda install torchcsprng -c pytorch-nightly -``` pip: ```console pip install torchcsprng ``` -for nightly builds: -```console -pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html -pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html -pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html -pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html -``` + +Nightly builds: + +Anaconda: + +| OS | CUDA | | +|------------------------|-----------------------------------------------|-------------------------------------------------------| +| Linux | 9.2

10.1

10.2

None | conda install torchcsprng -c pytorch-nightly | +| macOS

Windows | None

None | conda install torchcsprng -c pytorch-nightly

conda install torchcsprng cpuonly -c pytorch-nightly | + +pip: + +| OS | CUDA | | +|------------------------|-----------------------------------------------|----------------------------------------------------------------------------------------------------| +| Linux | 9.2

10.1

10.2

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| macOS

Windows | None

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | ### From Source @@ -155,6 +160,12 @@ torch.empty(10, device='cuda').geometric_(p=0.2, generator=mt19937_gen) ``` tensor([ 7., 1., 8., 1., 11., 3., 1., 1., 5., 10.], device='cuda:0') ``` + +## Contributing +We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us. + + + ## License CSPRNG is BSD-licensed. From 8fb758ec5fa851162b8850746d6ec7b9a1f6c682 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 5 Aug 2020 04:30:47 -0700 Subject: [PATCH 011/750] 2020-08-05 nightly release (902cf63e4a22a6742c40e5a6a2c27642eb996d1e) --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index df66a3a..559360e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # PyTorch/CSPRNG -CSPRNG is a [PyTorch C++/CUDA extension](https://pytorch.org/tutorials/advanced/cpp_extension.html) that provides [cryptographically secure pseudorandom number generators](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) for PyTorch. +torchcsprng is a [PyTorch C++/CUDA extension](https://pytorch.org/tutorials/advanced/cpp_extension.html) that provides [cryptographically secure pseudorandom number generators](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) for PyTorch. [![CircleCI](https://circleci.com/gh/pytorch/csprng.svg?style=shield&circle-token=64701692dd7f13f31019612289f0200fdb661dc2)](https://circleci.com/gh/pytorch/csprng) ## Design -CSPRNG generates a random 128-bits key on CPU using one of its generators and runs +torchcsprng generates a random 128-bit key on CPU using one of its generators and runs [AES128](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) in [CTR mode](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) -mode either on CPU or on GPU using CUDA to generate random 128 bits state and apply transformation function to map it to target tensor values. +mode either on CPU or on GPU using CUDA to generate a random 128 bit state and apply a transformation function to map it to target tensor values. This approach is based on [Parallel Random Numbers: As Easy as 1, 2, 3(John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw, D. E. Shaw Research)](http://www.thesalmons.org/john/random123/papers/random123sc11.pdf). -It makes CSPRNG both crypto-secure and parallel on CUDA and CPU. +It makes torchcsprng both crypto-secure and parallel on CUDA and CPU. ![CSPRNG architecture](.github/csprng_architecture.png) @@ -18,11 +18,11 @@ Advantages: - The user can choose either seed-based(for testing) or random device based(fully crypto-secure) generators - One generator instance for both CPU and CUDA tensors(because the encryption key is always generated on CPU) -- CPU random number generation is also parallel(unlike default PyTorch CPU generator) +- CPU random number generation is also parallel(unlike the default PyTorch CPU generator) ## Features -CSPRNG exposes two methods to create crypto-secure and non-crypto-secure PRNGs: +torchcsprng exposes two methods to create crypto-secure and non-crypto-secure PRNGs: | Method to create PRNG | Is crypto-secure? | Has seed? | Underlying implementation | |----------------------------------------------------|-------------------|-----------|---------------------------| @@ -52,7 +52,7 @@ CSPRNG works with Python 3.6/3.7/3.8 on the following operating systems and can | CPU | Supported | Supported | Supported | | CUDA | Supported | Not Supported | Coming | -### Binaries +### Binary Installation Anaconda: @@ -84,16 +84,16 @@ pip: ### From Source -CSPRNG is a Python C++/CUDA extension that depends on PyTorch. In order to build CSPRNG from source it is required to have Python(>=3.6) with PyTorch(>=1.6.0) installed and C++ compiler(gcc/clang for Linux, XCode for macOS, Visual Studio for MS Windows). -To build CSPRNG run the following: +torchcsprng is a Python C++/CUDA extension that depends on PyTorch. In order to build CSPRNG from source it is required to have Python(>=3.6) with PyTorch(>=1.6.0) installed and C++ compiler(gcc/clang for Linux, XCode for macOS, Visual Studio for MS Windows). +To build torchcsprng you can run the following: ```console python setup.py install ``` -By default, GPU support is built if CUDA is found and torch.cuda.is_available() is true. It's possible to force building GPU support by setting FORCE_CUDA=1 environment variable, which is useful when building a docker image. +By default, GPU support is built if CUDA is found and torch.cuda.is_available() is True. Additionally, it is possible to force building GPU support by setting the FORCE_CUDA=1 environment variable, which is useful when building a docker image. ## Getting Started -CSPRNG API is available in `torchcsprng` module: +The torchcsprng API is available in `torchcsprng` module: ```python import torch import torchcsprng as csprng @@ -168,4 +168,4 @@ We appreciate all contributions. If you are planning to contribute back bug-fixe ## License -CSPRNG is BSD-licensed. +torchcsprng is BSD 3-clause licensed. See the license file [here](https://github.com/pytorch/csprng/blob/master/LICENSE) From bc5f52ac2d7c1f64adbbfd2d2caf92b52951266b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 6 Aug 2020 04:30:37 -0700 Subject: [PATCH 012/750] 2020-08-06 nightly release (902cf63e4a22a6742c40e5a6a2c27642eb996d1e) From 9ba2d58d9eca8f8cd478551cf2938345f27f1f3b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 7 Aug 2020 04:30:39 -0700 Subject: [PATCH 013/750] 2020-08-07 nightly release (902cf63e4a22a6742c40e5a6a2c27642eb996d1e) From 2ccc767da661531172c1ca435fb5cf3386f75d42 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 8 Aug 2020 04:30:39 -0700 Subject: [PATCH 014/750] 2020-08-08 nightly release (902cf63e4a22a6742c40e5a6a2c27642eb996d1e) From dc38be76304bf238bdbf5601eb078458834af992 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 9 Aug 2020 04:30:45 -0700 Subject: [PATCH 015/750] 2020-08-09 nightly release (7109581e8441e8b35229e6157593bb509aa760b4) --- .circleci/config.yml | 52 ++------------ .gitignore | 6 +- setup.py | 152 +++++++++++++++++++++++++++------------- torchcsprng/__init__.py | 3 + 4 files changed, 116 insertions(+), 97 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 21c2d16..d45d0c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,17 +72,17 @@ commands: sudo apt-get update sudo apt-get -y install cuda - build-csprng: + build-csprng-develop: steps: - run: name: Building CSPRNG - command: python setup.py install + command: python setup.py develop run-tests: steps: - run: name: Running tests - command: python test/test_csprng.py + command: python setup.py test binary_common: &binary_common parameters: @@ -118,48 +118,6 @@ binary_common: &binary_common jobs: - build-nvcc: - machine: - image: ubuntu-1604:201903-01 - resource_class: gpu.small - steps: - - checkout - - install-conda - - install-pytorch - - install-cuda - - build-csprng - - run-tests - - build-cc: - machine: - image: ubuntu-1604:201903-01 - resource_class: large - steps: - - checkout - - install-conda - - install-pytorch - - build-csprng - - run-tests - - build-cc-pip: - machine: - image: ubuntu-1604:201903-01 - resource_class: large - steps: - - checkout - - run: - name: Setting Python 3 and upgrade pip - command: | - pyenv local 3.7.0 - pip install -U pip - - run: - name: Installing PyTorch - command: | - pip install --pre torch -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html - pip install numpy scipy - - build-csprng - - run-tests - binary_linux_wheel: <<: *binary_common docker: @@ -330,7 +288,7 @@ jobs: - checkout - install-conda - install-pytorch - - build-csprng + - build-csprng-develop - run-tests unittest_linux_gpu: @@ -345,7 +303,7 @@ jobs: - install-conda - install-pytorch - install-cuda - - build-csprng + - build-csprng-develop - run-tests # unittest_windows_cpu: diff --git a/.gitignore b/.gitignore index e72bf2c..ee0c254 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ +.idea +.vscode +# do not change or delete this comment - `python setup.py clean` deletes everything after this line dist/ build/ *.egg-info/ -.idea -.vscode torchcsprng/version.py */__pycache__ +.pytest_cache *.so diff --git a/setup.py b/setup.py index 23aad6c..0d23f12 100644 --- a/setup.py +++ b/setup.py @@ -1,53 +1,24 @@ import os -from sys import platform +import sys import subprocess -from setuptools import setup +from setuptools import setup, find_packages +import distutils.command.clean +import glob +import shutil + import torch -from torch.utils import cpp_extension - -build_cuda = torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1' - -CXX_FLAGS = os.getenv('CXX_FLAGS', '') -if CXX_FLAGS == '': - CXX_FLAGS = [] -else: - CXX_FLAGS = CXX_FLAGS.split(' ') -if platform == 'linux': - CXX_FLAGS.append('-fopenmp') - -NVCC_FLAGS = os.getenv('NVCC_FLAGS', '') -if NVCC_FLAGS == '': - NVCC_FLAGS = [] -else: - NVCC_FLAGS = NVCC_FLAGS.split(' ') - -for flag in ['--expt-extended-lambda', '-Xcompiler', '-fopenmp']: - if not flag in NVCC_FLAGS: - NVCC_FLAGS.append(flag) - -module_name = 'torchcsprng' - -this_dir = os.path.dirname(os.path.abspath(__file__)) -extensions_dir = os.path.join(this_dir, module_name, 'csrc') - -if build_cuda: - csprng_ext = cpp_extension.CUDAExtension( - module_name, [os.path.join(extensions_dir, 'csprng.cu')], - extra_compile_args={'cxx': [], - 'nvcc': NVCC_FLAGS} - ) -else: - csprng_ext = cpp_extension.CppExtension( - module_name, [os.path.join(extensions_dir, 'csprng.cpp')], - extra_compile_args={'cxx': CXX_FLAGS} - ) +from torch.utils.cpp_extension import BuildExtension, CppExtension, \ + CUDAExtension, CUDA_HOME version = open('version.txt', 'r').read().strip() sha = 'Unknown' package_name = 'torchcsprng' +cwd = os.path.dirname(os.path.abspath(__file__)) + try: - sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=this_dir).decode('ascii').strip() + sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode( + 'ascii').strip() except Exception: pass @@ -57,11 +28,18 @@ version += '+' + sha[:7] print("Building wheel {}-{}".format(package_name, version)) -# Doesn't work yet :( -# version_path = os.path.join(this_dir, module_name, 'version.py') -# with open(version_path, 'w') as f: -# f.write("__version__ = '{}'\n".format(version)) -# f.write("git_version = {}\n".format(repr(sha))) + +def write_version_file(): + version_path = os.path.join(cwd, 'torchcsprng', 'version.py') + with open(version_path, 'w') as f: + f.write("__version__ = '{}'\n".format(version)) + f.write("git_version = {}\n".format(repr(sha))) + # f.write("from torchcsprng.extension import _check_cuda_version\n") + # f.write("if _check_cuda_version() > 0:\n") + # f.write(" cuda = _check_cuda_version()\n") + + +write_version_file() with open("README.md", "r") as fh: long_description = fh.read() @@ -74,6 +52,79 @@ pytorch_dep, ] + +def get_extensions(): + build_cuda = torch.cuda.is_available() or os.getenv('FORCE_CUDA', + '0') == '1' + + module_name = 'torchcsprng' + + extensions_dir = os.path.join(cwd, module_name, 'csrc') + + openmp = 'ATen parallel backend: OpenMP' in torch.__config__.parallel_info() + + if build_cuda: + sources = [os.path.join(extensions_dir, 'csprng.cu')] + extension = CUDAExtension + nvcc_flags = os.getenv('NVCC_FLAGS', '') + if nvcc_flags == '': + nvcc_flags = [] + else: + nvcc_flags = nvcc_flags.split(' ') + for flag in ['--expt-extended-lambda', '-Xcompiler', '-fopenmp']: + if not flag in nvcc_flags: + nvcc_flags.append(flag) + extra_compile_args = { + 'cxx': [], + 'nvcc': nvcc_flags, + } + else: + sources = [os.path.join(extensions_dir, 'csprng.cpp')] + extension = CppExtension + cxx_flags = os.getenv('CXX_FLAGS', '') + if cxx_flags == '': + cxx_flags = [] + else: + cxx_flags = cxx_flags.split(' ') + if sys.platform == 'linux' and openmp: + for flag in ['-fopenmp']: + if not flag in cxx_flags: + cxx_flags.append(flag) + extra_compile_args = { + 'cxx': cxx_flags + } + + ext_modules = [ + extension( + module_name + '._C', + sources, + extra_compile_args=extra_compile_args, + ) + ] + + return ext_modules + + +class clean(distutils.command.clean.clean): + def run(self): + with open('.gitignore', 'r') as f: + ignores = f.read() + start_deleting = False + for wildcard in filter(None, ignores.split('\n')): + if wildcard == '# do not change or delete this comment - `python setup.py clean` deletes everything after this line': + start_deleting = True + if not start_deleting: + continue + for filename in glob.glob(wildcard): + try: + os.remove(filename) + except OSError: + shutil.rmtree(filename, ignore_errors=True) + + # It's an old-style class in Python 2.7... + distutils.command.clean.clean.run(self) + + setup( # Metadata name=package_name, @@ -87,6 +138,7 @@ license='BSD-3', # Package info + packages=find_packages(exclude=('test',)), classifiers=[ 'Intended Audience :: Developers', 'Intended Audience :: Education', @@ -106,6 +158,10 @@ ], python_requires='>=3.6', install_requires=requirements, - ext_modules=[csprng_ext], - cmdclass={'build_ext': cpp_extension.BuildExtension} + ext_modules=get_extensions(), + test_suite='test', + cmdclass={ + 'build_ext': BuildExtension, + 'clean': clean, + } ) diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py index aaa3285..6f59221 100644 --- a/torchcsprng/__init__.py +++ b/torchcsprng/__init__.py @@ -1 +1,4 @@ import torch +del torch + +from torchcsprng._C import * From 3d9400b285d5ccda4c7c0c12691e124c68030a1e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 10 Aug 2020 04:30:36 -0700 Subject: [PATCH 016/750] 2020-08-10 nightly release (ff9c39fe7a12607ab4e9cc74370535f0ea227956) --- packaging/build_conda.sh | 2 +- packaging/build_wheel.sh | 2 +- torchcsprng/csrc/aes.h | 2 +- torchcsprng/csrc/block_cipher.h | 2 +- torchcsprng/csrc/csprng.h | 50 ++++++++++++++++----------------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packaging/build_conda.sh b/packaging/build_conda.sh index f7a1f35..e0e096d 100755 --- a/packaging/build_conda.sh +++ b/packaging/build_conda.sh @@ -5,7 +5,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" . "$script_dir/pkg_helpers.bash" export BUILD_TYPE=conda -setup_env 0.1.0 +setup_env $(cat "version.txt" | sed "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/g") export SOURCE_ROOT_DIR="$PWD" setup_conda_pytorch_constraint setup_conda_cudatoolkit_constraint diff --git a/packaging/build_wheel.sh b/packaging/build_wheel.sh index 98726cd..bd3b0c7 100755 --- a/packaging/build_wheel.sh +++ b/packaging/build_wheel.sh @@ -5,7 +5,7 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" . "$script_dir/pkg_helpers.bash" export BUILD_TYPE=wheel -setup_env 0.1.0 +setup_env $(cat "version.txt" | sed "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/g") setup_wheel_python pip_install numpy pyyaml future ninja setup_pip_pytorch_version diff --git a/torchcsprng/csrc/aes.h b/torchcsprng/csrc/aes.h index 7a9a287..8782816 100644 --- a/torchcsprng/csrc/aes.h +++ b/torchcsprng/csrc/aes.h @@ -4,7 +4,7 @@ #include namespace torch { -namespace custom_prng { +namespace csprng { namespace aes { // This AES implementation is based on diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index ddde94c..2696613 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -20,7 +20,7 @@ #endif namespace torch { -namespace custom_prng { +namespace csprng { // Generates `block_t_size`-bytes random key Tensor on CPU // using `generator`, which must be an instance of `at::CPUGeneratorImpl` diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index 39aa3e1..0c424d6 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -19,25 +19,25 @@ using namespace at; using namespace at::native::templates; -using namespace torch::custom_prng; +using namespace torch::csprng; inline uint64_t make64BitsFrom32Bits(uint32_t hi, uint32_t lo) { return (static_cast(hi) << 32) | lo; } // CUDA CSPRNG is actually CPU generator which is used only to generate a random key on CPU for AES running in a block mode on CUDA -struct CustomGeneratorImpl : public c10::GeneratorImpl { - CustomGeneratorImpl(bool use_rd) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{use_rd} {} - CustomGeneratorImpl(const std::string& token) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{true}, rd_{token} {} - CustomGeneratorImpl(uint64_t seed) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{false}, mt_{static_cast(seed)} { } - ~CustomGeneratorImpl() = default; +struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { + CSPRNGGeneratorImpl(bool use_rd) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{use_rd} {} + CSPRNGGeneratorImpl(const std::string& token) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{true}, rd_{token} {} + CSPRNGGeneratorImpl(uint64_t seed) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{false}, mt_{static_cast(seed)} { } + ~CSPRNGGeneratorImpl() = default; uint32_t random() { return use_rd_ ? rd_() : mt_(); } uint64_t random64() { return use_rd_ ? make64BitsFrom32Bits(rd_(), rd_()) : make64BitsFrom32Bits(mt_(), mt_()); } void set_current_seed(uint64_t seed) override { throw std::runtime_error("not implemented"); } uint64_t current_seed() const override { throw std::runtime_error("not implemented"); } uint64_t seed() override { throw std::runtime_error("not implemented"); } - CustomGeneratorImpl* clone_impl() const override { throw std::runtime_error("not implemented"); } + CSPRNGGeneratorImpl* clone_impl() const override { throw std::runtime_error("not implemented"); } static DeviceType device_type() { return DeviceType::CPU; } @@ -161,11 +161,11 @@ struct RandomFromToKernel { }; Tensor& random_(Tensor& self, c10::optional generator) { - return random_impl(self, generator); + return random_impl(self, generator); } Tensor& random_from_to(Tensor& self, int64_t from, optional to, c10::optional generator) { - return random_from_to_impl(self, from, to, generator); + return random_from_to_impl(self, from, to, generator); } Tensor& random_to(Tensor& self, int64_t to, c10::optional generator) { @@ -191,7 +191,7 @@ struct UniformKernel { }; Tensor& uniform_(Tensor& self, double from, double to, c10::optional generator) { - return uniform_impl_(self, from, to, generator); + return uniform_impl_(self, from, to, generator); } // ==================================================== Normal ======================================================== @@ -214,31 +214,31 @@ struct NormalKernel { }; Tensor& normal_(Tensor& self, double mean, double std, c10::optional generator) { - return normal_impl_(self, mean, std, generator); + return normal_impl_(self, mean, std, generator); } Tensor& normal_Tensor_float_out(Tensor& output, const Tensor& mean, double std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); + return normal_out_impl(output, mean, std, gen); } Tensor& normal_float_Tensor_out(Tensor& output, double mean, const Tensor& std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); + return normal_out_impl(output, mean, std, gen); } Tensor& normal_Tensor_Tensor_out(Tensor& output, const Tensor& mean, const Tensor& std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); + return normal_out_impl(output, mean, std, gen); } Tensor normal_Tensor_float(const Tensor& mean, double std, c10::optional gen) { - return normal_impl(mean, std, gen); + return normal_impl(mean, std, gen); } Tensor normal_float_Tensor(double mean, const Tensor& std, c10::optional gen) { - return normal_impl(mean, std, gen); + return normal_impl(mean, std, gen); } Tensor normal_Tensor_Tensor(const Tensor& mean, const Tensor& std, c10::optional gen) { - return normal_impl(mean, std, gen); + return normal_impl(mean, std, gen); } // ==================================================== Cauchy ======================================================== @@ -260,7 +260,7 @@ struct CauchyKernel { }; Tensor& cauchy_(Tensor& self, double median, double sigma, c10::optional generator) { - return cauchy_impl_(self, median, sigma, generator); + return cauchy_impl_(self, median, sigma, generator); } // ================================================== LogNormal ======================================================= @@ -282,7 +282,7 @@ struct LogNormalKernel { }; Tensor& log_normal_(Tensor& self, double mean, double std, c10::optional gen) { - return log_normal_impl_(self, mean, std, gen); + return log_normal_impl_(self, mean, std, gen); } // ================================================== Geometric ======================================================= @@ -304,7 +304,7 @@ struct GeometricKernel { }; Tensor& geometric_(Tensor& self, double p, c10::optional gen) { - return geometric_impl_(self, p, gen); + return geometric_impl_(self, p, gen); } // ================================================== Exponential ===================================================== @@ -326,24 +326,24 @@ struct ExponentialKernel { }; Tensor& exponential_(Tensor& self, double lambda, c10::optional gen) { - return exponential_impl_(self, lambda, gen); + return exponential_impl_(self, lambda, gen); } // ==================================================================================================================== Generator create_random_device_generator(c10::optional token = c10::nullopt) { if (token.has_value()) { - return make_generator(*token); + return make_generator(*token); } else { - return make_generator(true); + return make_generator(true); } } Generator create_mt19937_generator(c10::optional seed = c10::nullopt) { if (seed.has_value()) { - return make_generator(*seed); + return make_generator(*seed); } else { - return make_generator(false); + return make_generator(false); } } From cb5a3ba66870a04c1622d1b27deb1612bf6aa835 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 11 Aug 2020 04:30:38 -0700 Subject: [PATCH 017/750] 2020-08-11 nightly release (ff9c39fe7a12607ab4e9cc74370535f0ea227956) From 9c1f094c0d6b9c819c4a735b7e6da1cb689ed9ef Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 12 Aug 2020 04:30:47 -0700 Subject: [PATCH 018/750] 2020-08-12 nightly release (ff9c39fe7a12607ab4e9cc74370535f0ea227956) From f1fcfbcce493ffbd02970aeb8f3f261ac0e1bd48 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 13 Aug 2020 04:30:55 -0700 Subject: [PATCH 019/750] 2020-08-13 nightly release (ff9c39fe7a12607ab4e9cc74370535f0ea227956) From 5da001d60e1348fd00c83ba5b13461b8d5550613 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 13 Aug 2020 11:58:08 -0700 Subject: [PATCH 020/750] 2020-08-13 nightly release (48c457daca84def9e1b600ef15a429466351de1d) --- setup.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 0d23f12..10350aa 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,13 @@ def write_version_file(): ] +def append_flags(flags, flags_to_append): + for flag in flags_to_append: + if not flag in flags: + flags.append(flag) + return flags + + def get_extensions(): build_cuda = torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1' @@ -71,9 +78,12 @@ def get_extensions(): nvcc_flags = [] else: nvcc_flags = nvcc_flags.split(' ') - for flag in ['--expt-extended-lambda', '-Xcompiler', '-fopenmp']: - if not flag in nvcc_flags: - nvcc_flags.append(flag) + nvcc_flags = append_flags(nvcc_flags, ['--expt-extended-lambda', '-Xcompiler']) + if openmp: + if sys.platform == 'linux': + nvcc_flags = append_flags(nvcc_flags, ['-fopenmp']) + elif sys.platform == 'win32': + nvcc_flags = append_flags(nvcc_flags, ['/openmp']) extra_compile_args = { 'cxx': [], 'nvcc': nvcc_flags, @@ -86,10 +96,11 @@ def get_extensions(): cxx_flags = [] else: cxx_flags = cxx_flags.split(' ') - if sys.platform == 'linux' and openmp: - for flag in ['-fopenmp']: - if not flag in cxx_flags: - cxx_flags.append(flag) + if openmp: + if sys.platform == 'linux': + cxx_flags = append_flags(cxx_flags, ['-fopenmp']) + elif sys.platform == 'win32': + cxx_flags = append_flags(cxx_flags, ['/openmp']) extra_compile_args = { 'cxx': cxx_flags } From 321739729b3d9864cf2303e1b91e555d6f271dcd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 14 Aug 2020 04:30:43 -0700 Subject: [PATCH 021/750] 2020-08-14 nightly release (ca7cdbf328d190fc78b214ffed6ba70d744c2d80) --- .circleci/config.yml | 286 +++++++++--------- .../unittest/linux/scripts/environment.yml | 14 + .circleci/unittest/linux/scripts/install.sh | 29 ++ .../unittest/linux/scripts/post_process.sh | 8 + .circleci/unittest/linux/scripts/run_test.sh | 9 + .circleci/unittest/linux/scripts/setup_env.sh | 34 +++ .../unittest/windows/scripts/environment.yml | 14 + .circleci/unittest/windows/scripts/install.sh | 31 ++ .../windows/scripts/install_conda.bat | 1 + .../unittest/windows/scripts/post_process.sh | 8 + .../unittest/windows/scripts/run_test.sh | 9 + .../unittest/windows/scripts/setup_env.sh | 39 +++ .../windows/scripts/vc_env_helper.bat | 39 +++ torchcsprng/csrc/block_cipher.h | 14 +- torchcsprng/csrc/csprng.h | 18 +- 15 files changed, 402 insertions(+), 151 deletions(-) create mode 100644 .circleci/unittest/linux/scripts/environment.yml create mode 100755 .circleci/unittest/linux/scripts/install.sh create mode 100755 .circleci/unittest/linux/scripts/post_process.sh create mode 100755 .circleci/unittest/linux/scripts/run_test.sh create mode 100755 .circleci/unittest/linux/scripts/setup_env.sh create mode 100644 .circleci/unittest/windows/scripts/environment.yml create mode 100644 .circleci/unittest/windows/scripts/install.sh create mode 100644 .circleci/unittest/windows/scripts/install_conda.bat create mode 100644 .circleci/unittest/windows/scripts/post_process.sh create mode 100644 .circleci/unittest/windows/scripts/run_test.sh create mode 100644 .circleci/unittest/windows/scripts/setup_env.sh create mode 100644 .circleci/unittest/windows/scripts/vc_env_helper.bat diff --git a/.circleci/config.yml b/.circleci/config.yml index d45d0c9..f01ff6e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,48 +42,6 @@ commands: fi echo "export UPLOAD_CHANNEL=${our_upload_channel}" >> ${BASH_ENV} - install-conda: - steps: - - run: - name: Installing Conda - command: | - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh - bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/conda - export PATH=$HOME/conda/bin:$PATH - echo 'export PATH=$HOME/conda/bin:$PATH' >> $BASH_ENV - conda install -y python=3 - - install-pytorch: - steps: - - run: - name: Installing PyTorch - command: | - conda install pytorch -yc pytorch-nightly - conda install -y numpy scipy - - install-cuda: - steps: - - run: - name: Installing CUDA - command: | - wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb - sudo dpkg -i cuda-repo-ubuntu1604-10-2-local-10.2.89-440.33.01_1.0-1_amd64.deb - sudo apt-key add /var/cuda-repo-10-2-local-10.2.89-440.33.01/7fa2af80.pub - sudo apt-get update - sudo apt-get -y install cuda - - build-csprng-develop: - steps: - - run: - name: Building CSPRNG - command: python setup.py develop - - run-tests: - steps: - - run: - name: Running tests - command: python setup.py test - binary_common: &binary_common parameters: # Edit these defaults to do a release` @@ -279,6 +237,7 @@ jobs: for pkg in ~/workspace/*.whl; do aws s3 cp "$pkg" "s3://pytorch/whl/${UPLOAD_CHANNEL}/<< parameters.subfolder >>" --acl public-read done + unittest_linux_cpu: <<: *binary_common docker: @@ -286,10 +245,36 @@ jobs: resource_class: 2xlarge+ steps: - checkout - - install-conda - - install-pytorch - - build-csprng-develop - - run-tests + - run: + name: Generate cache key + # This will refresh cache on Sundays, nightly build should generate new cache. + command: echo "$(date +"%Y-%U")" > .circleci-weekly + - restore_cache: + + keys: + - env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + - run: + name: Setup + command: .circleci/unittest/linux/scripts/setup_env.sh + - save_cache: + + key: env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + paths: + - conda + - env + - run: + name: Install torchcsprng + command: .circleci/unittest/linux/scripts/install.sh + - run: + name: Run tests + command: .circleci/unittest/linux/scripts/run_test.sh + - run: + name: Post process + command: .circleci/unittest/linux/scripts/post_process.sh + - store_test_results: + path: test-results unittest_linux_gpu: <<: *binary_common @@ -300,87 +285,112 @@ jobs: image_name: "pytorch/manylinux-cuda101" steps: - checkout - - install-conda - - install-pytorch - - install-cuda - - build-csprng-develop - - run-tests + - run: + name: Generate cache key + # This will refresh cache on Sundays, nightly build should generate new cache. + command: echo "$(date +"%Y-%U")" > .circleci-weekly + - restore_cache: + + keys: + - env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + - run: + name: Setup + command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/setup_env.sh + - save_cache: + + key: env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + paths: + - conda + - env + - run: + name: Install torchcsprng + command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh + - run: + name: Run tests + command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh + - run: + name: Post Process + command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/post_process.sh + - store_test_results: + path: test-results + + unittest_windows_cpu: + <<: *binary_common + executor: + name: windows-cpu + steps: + - checkout + - run: + name: Generate cache key + # This will refresh cache on Sundays, nightly build should generate new cache. + command: echo "$(date +"%Y-%U")" > .circleci-weekly + - restore_cache: + + keys: + - env-v2-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + - run: + name: Setup + command: .circleci/unittest/windows/scripts/setup_env.sh + - save_cache: + + key: env-v2-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + paths: + - conda + - env + - run: + name: Install torchcsprng + command: .circleci/unittest/windows/scripts/install.sh + - run: + name: Run tests + command: .circleci/unittest/windows/scripts/run_test.sh + - run: + name: Post process + command: .circleci/unittest/windows/scripts/post_process.sh + - store_test_results: + path: test-results + + unittest_windows_gpu: + <<: *binary_common + executor: + name: windows-gpu + environment: + CUDA_VERSION: "10.1" + steps: + - checkout + - run: + name: Generate cache key + # This will refresh cache on Sundays, nightly build should generate new cache. + command: echo "$(date +"%Y-%U")" > .circleci-weekly + - restore_cache: + + keys: + - env-v1-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + - run: + name: Setup + command: .circleci/unittest/windows/scripts/setup_env.sh + - save_cache: -# unittest_windows_cpu: -# <<: *binary_common -# executor: -# name: windows-cpu -# steps: -# - checkout -# - run: -# name: Generate cache key -# # This will refresh cache on Sundays, nightly build should generate new cache. -# command: echo "$(date +"%Y-%U")" > .circleci-weekly -# - restore_cache: -# -# keys: -# - env-v2-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} -# -# - run: -# name: Setup -# command: .circleci/unittest/windows/scripts/setup_env.sh -# - save_cache: -# -# key: env-v2-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} -# -# paths: -# - conda -# - env -# - run: -# name: Install torchvision -# command: .circleci/unittest/windows/scripts/install.sh -# - run: -# name: Run tests -# command: .circleci/unittest/windows/scripts/run_test.sh -# - run: -# name: Post process -# command: .circleci/unittest/windows/scripts/post_process.sh -# - store_test_results: -# path: test-results -# -# unittest_windows_gpu: -# <<: *binary_common -# executor: -# name: windows-gpu -# environment: -# CUDA_VERSION: "10.1" -# steps: -# - checkout -# - run: -# name: Generate cache key -# # This will refresh cache on Sundays, nightly build should generate new cache. -# command: echo "$(date +"%Y-%U")" > .circleci-weekly -# - restore_cache: -# -# keys: -# - env-v1-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} -# -# - run: -# name: Setup -# command: .circleci/unittest/windows/scripts/setup_env.sh -# - save_cache: -# -# key: env-v1-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} -# -# paths: -# - conda -# - env -# - run: -# name: Install torchvision -# command: .circleci/unittest/windows/scripts/install.sh -# - run: -# name: Run tests -# command: .circleci/unittest/windows/scripts/run_test.sh -# - run: -# name: Post process -# command: .circleci/unittest/windows/scripts/post_process.sh -# - store_test_results: -# path: test-results + key: env-v1-windows-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/windows/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + paths: + - conda + - env + - run: + name: Install torchcsprng + command: .circleci/unittest/windows/scripts/install.sh + - run: + name: Run tests + command: .circleci/unittest/windows/scripts/run_test.sh + - run: + name: Post process + command: .circleci/unittest/windows/scripts/post_process.sh + - store_test_results: + path: test-results workflows: build: @@ -772,18 +782,18 @@ workflows: cu_version: cu101 name: unittest_linux_gpu_py3.8 python_version: '3.8' -# - unittest_windows_cpu: -# cu_version: cpu -# name: unittest_windows_cpu_py3.6 -# python_version: '3.6' -# - unittest_windows_cpu: -# cu_version: cpu -# name: unittest_windows_cpu_py3.7 -# python_version: '3.7' -# - unittest_windows_cpu: -# cu_version: cpu -# name: unittest_windows_cpu_py3.8 -# python_version: '3.8' + - unittest_windows_cpu: + cu_version: cpu + name: unittest_windows_cpu_py3.6 + python_version: '3.6' + - unittest_windows_cpu: + cu_version: cpu + name: unittest_windows_cpu_py3.7 + python_version: '3.7' + - unittest_windows_cpu: + cu_version: cpu + name: unittest_windows_cpu_py3.8 + python_version: '3.8' # - unittest_windows_gpu: # cu_version: cu101 # filters: diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml new file mode 100644 index 0000000..7310ae6 --- /dev/null +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -0,0 +1,14 @@ +channels: + - defaults +dependencies: + - numpy + - pytest + - pytest-cov + - codecov + - pip + - ca-certificates + - pip: + - future + - pillow>=4.1.1 + - scipy + - av diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh new file mode 100755 index 0000000..6334cb9 --- /dev/null +++ b/.circleci/unittest/linux/scripts/install.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +unset PYTORCH_VERSION +# For unittest, nightly PyTorch is used as the following section, +# so no need to set PYTORCH_VERSION. +# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config. + +set -e + +eval "$(./conda/bin/conda shell.bash hook)" +conda activate ./env + +if [ "${CU_VERSION:-}" == cpu ] ; then + cudatoolkit="cpuonly" +else + if [[ ${#CU_VERSION} -eq 4 ]]; then + CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}" + elif [[ ${#CU_VERSION} -eq 5 ]]; then + CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}" + fi + echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION" + version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" + cudatoolkit="cudatoolkit=${version}" +fi +printf "Installing PyTorch with %s\n" "${cudatoolkit}" +conda install -y -c pytorch-nightly pytorch "${cudatoolkit}" + +printf "* Installing torchcsprng\n" +python setup.py develop \ No newline at end of file diff --git a/.circleci/unittest/linux/scripts/post_process.sh b/.circleci/unittest/linux/scripts/post_process.sh new file mode 100755 index 0000000..b05be6d --- /dev/null +++ b/.circleci/unittest/linux/scripts/post_process.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +eval "$(./conda/bin/conda shell.bash hook)" +conda activate ./env + +codecov \ No newline at end of file diff --git a/.circleci/unittest/linux/scripts/run_test.sh b/.circleci/unittest/linux/scripts/run_test.sh new file mode 100755 index 0000000..61f6e3e --- /dev/null +++ b/.circleci/unittest/linux/scripts/run_test.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +eval "$(./conda/bin/conda shell.bash hook)" +conda activate ./env + +python -m torch.utils.collect_env +pytest --cov=torchcsprng --junitxml=test-results/junit.xml -v --durations 20 test \ No newline at end of file diff --git a/.circleci/unittest/linux/scripts/setup_env.sh b/.circleci/unittest/linux/scripts/setup_env.sh new file mode 100755 index 0000000..303042f --- /dev/null +++ b/.circleci/unittest/linux/scripts/setup_env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# This script is for setting up environment in which unit test is ran. +# To speed up the CI time, the resulting environment is cached. +# +# Do not install PyTorch and torchcsprng here, otherwise they also get cached. + +set -e + +this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +root_dir="$(git rev-parse --show-toplevel)" +conda_dir="${root_dir}/conda" +env_dir="${root_dir}/env" + +cd "${root_dir}" + +# 1. Install conda at ./conda +if [ ! -d "${conda_dir}" ]; then + printf "* Installing conda\n" + wget -O miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + bash ./miniconda.sh -b -f -p "${conda_dir}" +fi +eval "$(${conda_dir}/bin/conda shell.bash hook)" + +# 2. Create test environment at ./env +if [ ! -d "${env_dir}" ]; then + printf "* Creating a test environment\n" + conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION" +fi +conda activate "${env_dir}" + +# 3. Install Conda dependencies +printf "* Installing dependencies (except PyTorch)\n" +conda env update --file "${this_dir}/environment.yml" --prune diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml new file mode 100644 index 0000000..52593ad --- /dev/null +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -0,0 +1,14 @@ +channels: + - defaults +dependencies: + - numpy + - pytest + - pytest-cov + - codecov + - pip + - ca-certificates + - pip: + - future + - pillow>=4.1.1 + - scipy==1.4.1 + - av diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh new file mode 100644 index 0000000..deba8f6 --- /dev/null +++ b/.circleci/unittest/windows/scripts/install.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +unset PYTORCH_VERSION +# For unittest, nightly PyTorch is used as the following section, +# so no need to set PYTORCH_VERSION. +# In fact, keeping PYTORCH_VERSION forces us to hardcode PyTorch version in config. + +set -e + +this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" +conda activate ./env + +if [ "${CU_VERSION:-}" == cpu ] ; then + cudatoolkit="cpuonly" +else + if [[ ${#CU_VERSION} -eq 4 ]]; then + CUDA_VERSION="${CU_VERSION:2:1}.${CU_VERSION:3:1}" + elif [[ ${#CU_VERSION} -eq 5 ]]; then + CUDA_VERSION="${CU_VERSION:2:2}.${CU_VERSION:4:1}" + fi + echo "Using CUDA $CUDA_VERSION as determined by CU_VERSION" + version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" + cudatoolkit="cudatoolkit=${version}" +fi +printf "Installing PyTorch with %s\n" "${cudatoolkit}" +conda install -y -c pytorch-nightly pytorch "${cudatoolkit}" + +printf "* Installing torchcsprng\n" +"$this_dir/vc_env_helper.bat" python setup.py develop \ No newline at end of file diff --git a/.circleci/unittest/windows/scripts/install_conda.bat b/.circleci/unittest/windows/scripts/install_conda.bat new file mode 100644 index 0000000..6612fba --- /dev/null +++ b/.circleci/unittest/windows/scripts/install_conda.bat @@ -0,0 +1 @@ +start /wait "" "%miniconda_exe%" /S /InstallationType=JustMe /RegisterPython=0 /AddToPath=0 /D=%tmp_conda% \ No newline at end of file diff --git a/.circleci/unittest/windows/scripts/post_process.sh b/.circleci/unittest/windows/scripts/post_process.sh new file mode 100644 index 0000000..2a1ac63 --- /dev/null +++ b/.circleci/unittest/windows/scripts/post_process.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" +conda activate ./env + +#codecov diff --git a/.circleci/unittest/windows/scripts/run_test.sh b/.circleci/unittest/windows/scripts/run_test.sh new file mode 100644 index 0000000..02c6327 --- /dev/null +++ b/.circleci/unittest/windows/scripts/run_test.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" +conda activate ./env + +python -m torch.utils.collect_env +pytest --cov=torchcsprng --junitxml=test-results/junit.xml -v --durations 20 test \ No newline at end of file diff --git a/.circleci/unittest/windows/scripts/setup_env.sh b/.circleci/unittest/windows/scripts/setup_env.sh new file mode 100644 index 0000000..6a73927 --- /dev/null +++ b/.circleci/unittest/windows/scripts/setup_env.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# This script is for setting up environment in which unit test is ran. +# To speed up the CI time, the resulting environment is cached. +# +# Do not install PyTorch and torchcsprng here, otherwise they also get cached. + +set -e + +this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +root_dir="$(git rev-parse --show-toplevel)" +conda_dir="${root_dir}/conda" +env_dir="${root_dir}/env" + +cd "${root_dir}" + +# 1. Install conda at ./conda +if [ ! -d "${conda_dir}" ]; then + printf "* Installing conda\n" + export tmp_conda="$(echo $conda_dir | tr '/' '\\')" + export miniconda_exe="$(echo $root_dir | tr '/' '\\')\\miniconda.exe" + curl --output miniconda.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -O + "$this_dir/install_conda.bat" + unset tmp_conda + unset miniconda_exe +fi + +eval "$(${conda_dir}/Scripts/conda.exe 'shell.bash' 'hook')" + +# 2. Create test environment at ./env +if [ ! -d "${env_dir}" ]; then + printf "* Creating a test environment\n" + conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION" +fi +conda activate "${env_dir}" + +# 3. Install Conda dependencies +printf "* Installing dependencies (except PyTorch)\n" +conda env update --file "${this_dir}/environment.yml" --prune \ No newline at end of file diff --git a/.circleci/unittest/windows/scripts/vc_env_helper.bat b/.circleci/unittest/windows/scripts/vc_env_helper.bat new file mode 100644 index 0000000..9410135 --- /dev/null +++ b/.circleci/unittest/windows/scripts/vc_env_helper.bat @@ -0,0 +1,39 @@ +@echo on + +set VC_VERSION_LOWER=16 +set VC_VERSION_UPPER=17 + +for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( + if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( + set "VS15INSTALLDIR=%%i" + set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" + goto vswhere + ) +) + +:vswhere +if "%VSDEVCMD_ARGS%" == "" ( + call "%VS15VCVARSALL%" x64 || exit /b 1 +) else ( + call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1 +) + +@echo on + +set DISTUTILS_USE_SDK=1 + +set args=%1 +shift +:start +if [%1] == [] goto done +set args=%args% %1 +shift +goto start + +:done +if "%args%" == "" ( + echo Usage: vc_env_helper.bat [command] [args] + echo e.g. vc_env_helper.bat cl /c test.cpp +) + +%args% || exit /b 1 diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index 2696613..99801c1 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -26,14 +26,20 @@ namespace csprng { // using `generator`, which must be an instance of `at::CPUGeneratorImpl` // and passes it to the `device`. template -at::Tensor key_tensor(c10::optional generator, size_t block_t_size, at::Device device) { +at::Tensor key_tensor(size_t block_t_size, c10::optional generator) { std::lock_guard lock(generator->mutex()); auto gen = at::check_generator(generator); auto t = torch::empty({static_cast(block_t_size)}, torch::kUInt8); - for (size_t i = 0; i < block_t_size; i++) { - t[i] = static_cast(gen->random()); + using random_t = uint32_t; + constexpr size_t random_t_size = sizeof(random_t); + for (size_t i = 0; i < block_t_size / random_t_size; i++) { + const auto rand = gen->random(); + for (size_t j = 0; j < random_t_size; j++) { + size_t k = i * random_t_size + j; + t[k] = static_cast((rand >> (j * 8)) & 0xff); + } } - return t.to(device); + return t; } // A simple container for random state sub-blocks that implements RNG interface diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index 0c424d6..ed3d6c6 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -92,7 +92,7 @@ template <> struct UIntType { using type = uint32_t; }; template struct RandomKernel { void operator()(TensorIterator& iter, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND(ScalarType::Bool, iter.dtype(), "random_kernel", [&] { aes_helper::type>(iter, key, @@ -128,7 +128,7 @@ void random_full_range_kernel_helper(TensorIterator& iter, const uint8_t* key) { template struct RandomFromToKernel { void operator()(TensorIterator& iter, uint64_t range, int64_t base, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND3(at::ScalarType::Bool, at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "random_from_to_kernel", [&] { if (( @@ -144,7 +144,7 @@ struct RandomFromToKernel { }); } void operator()(TensorIterator& iter, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::BFloat16, iter.dtype(), "random_full_64_bits_range_kernel", [&] { if (std::is_same::value || @@ -177,7 +177,7 @@ Tensor& random_to(Tensor& self, int64_t to, c10::optional generator) template struct UniformKernel { void operator()(TensorIterator& iter, double from, double to, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "uniform_kernel", [&] { aes_helper(iter, key, @@ -200,7 +200,7 @@ template struct NormalKernel { void operator()(Tensor& self, double mean, double std, c10::optional generator) { auto iter = TensorIterator::nullary_op(self); - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "normal_kernel", [&] { aes_helper(iter, key, @@ -246,7 +246,7 @@ Tensor normal_Tensor_Tensor(const Tensor& mean, const Tensor& std, c10::optional template struct CauchyKernel { void operator()(TensorIterator& iter, double median, double sigma, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "cauchy_kernel", [&] { aes_helper(iter, key, @@ -268,7 +268,7 @@ Tensor& cauchy_(Tensor& self, double median, double sigma, c10::optional struct LogNormalKernel { void operator()(TensorIterator& iter, double mean, double std, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "log_normal", [&] { aes_helper(iter, key, @@ -290,7 +290,7 @@ Tensor& log_normal_(Tensor& self, double mean, double std, c10::optional struct GeometricKernel { void operator()(TensorIterator& iter, double p, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "geometric_kernel", [&] { aes_helper::type, 1>(iter, key, @@ -312,7 +312,7 @@ Tensor& geometric_(Tensor& self, double p, c10::optional gen) { template struct ExponentialKernel { void operator()(TensorIterator& iter, double lambda, c10::optional generator) { - const Tensor key_t = key_tensor(generator, aes::block_t_size, iter.device()); + const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "exponential_kernel", [&] { aes_helper(iter, key, From 94751baa74f60ef8a74a2225c5bde1da282204b3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 15 Aug 2020 04:30:45 -0700 Subject: [PATCH 022/750] 2020-08-15 nightly release (ca7cdbf328d190fc78b214ffed6ba70d744c2d80) From a3bd91cd8cc68e12397c713b9cf376b4ae4d039a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 16 Aug 2020 04:30:45 -0700 Subject: [PATCH 023/750] 2020-08-16 nightly release (ca7cdbf328d190fc78b214ffed6ba70d744c2d80) From 1339056326462da9a5df7e1c978605ce6e260fd9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 17 Aug 2020 04:30:56 -0700 Subject: [PATCH 024/750] 2020-08-17 nightly release (83cd34716f1c97d0080f010e64e9748e67460540) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 559360e..751a5cf 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ torchcsprng is a [PyTorch C++/CUDA extension](https://pytorch.org/tutorials/adva torchcsprng generates a random 128-bit key on CPU using one of its generators and runs [AES128](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) in [CTR mode](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) -mode either on CPU or on GPU using CUDA to generate a random 128 bit state and apply a transformation function to map it to target tensor values. + either on CPU or on GPU using CUDA to generate a random 128 bit state and apply a transformation function to map it to target tensor values. This approach is based on [Parallel Random Numbers: As Easy as 1, 2, 3(John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw, D. E. Shaw Research)](http://www.thesalmons.org/john/random123/papers/random123sc11.pdf). It makes torchcsprng both crypto-secure and parallel on CUDA and CPU. From 4b5bf3ad13d99b5fa8de5e45ece486ced19d3e5a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 18 Aug 2020 04:30:48 -0700 Subject: [PATCH 025/750] 2020-08-18 nightly release (83cd34716f1c97d0080f010e64e9748e67460540) From b91b2bdafa898b888e6222d143e45cb150a08f2c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 19 Aug 2020 04:30:43 -0700 Subject: [PATCH 026/750] 2020-08-19 nightly release (92767c3abb0ef7046b452f8317c3b8e2e7a66ed6) --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 5d192a8..9e8f5f9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.1.0a0 \ No newline at end of file +0.2.0a0 From cc54fb6b40ec6ceb2f3df0e821c55919f6d0db93 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 20 Aug 2020 04:30:42 -0700 Subject: [PATCH 027/750] 2020-08-20 nightly release (92767c3abb0ef7046b452f8317c3b8e2e7a66ed6) From 883130e429f7b6e4e53672d67109248a91252cb1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 21 Aug 2020 04:31:38 -0700 Subject: [PATCH 028/750] 2020-08-21 nightly release (aba69a53209618446bbbc405cc1ddafb7dd268a4) --- test/test_csprng.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test_csprng.py b/test/test_csprng.py index 7f708ab..46c6443 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -301,5 +301,10 @@ def measure(size): # Pessimistic check that parallel execution gives >= 1.5 performance boost self.assertTrue(time_for_1M/time_for_1K < 1000 / min(1.5, torch.get_num_threads())) + def test_version(self): + import torchcsprng.version as version + self.assertTrue(version.__version__) + self.assertTrue(version.git_version) + if __name__ == '__main__': unittest.main() From b8257b53256a19cc5ed0e98c8ca22c212ccc049a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 22 Aug 2020 04:30:42 -0700 Subject: [PATCH 029/750] 2020-08-22 nightly release (3538ba07a09d91b7e24fbdfd852e531360ba57b0) --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fdc1528 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to csprng +We want to make contributing to this project as easy and transparent as +possible. + +## Pull Requests +We actively welcome your pull requests. + +1. Fork the repo and create your branch from `master`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe +disclosure of security bugs. In those cases, please go through the process +outlined on that page and do not file a public issue. + +## License +By contributing to csprng, you agree that your contributions will be licensed +under the LICENSE file in the root directory of this source tree. \ No newline at end of file From 42187a9bd94904d294db8131a6312916799777ec Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 23 Aug 2020 04:30:44 -0700 Subject: [PATCH 030/750] 2020-08-23 nightly release (3538ba07a09d91b7e24fbdfd852e531360ba57b0) From 4cc41640c423b80983b1cfc89fd02984902f9b94 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 24 Aug 2020 04:30:57 -0700 Subject: [PATCH 031/750] 2020-08-24 nightly release (945314f37b1cc9ca5b0a2aeb8cfdc8d2345d2af4) --- test/__init__.py | 5 +++++ test/test_csprng.py | 6 ++++++ torchcsprng/__init__.py | 6 ++++++ torchcsprng/csrc/OffsetCalculator.cuh | 8 ++++++++ torchcsprng/csrc/THCIntegerDivider.cuh | 8 ++++++++ torchcsprng/csrc/aes.h | 8 ++++++++ torchcsprng/csrc/block_cipher.h | 8 ++++++++ torchcsprng/csrc/csprng.cpp | 8 ++++++++ torchcsprng/csrc/csprng.cu | 8 ++++++++ torchcsprng/csrc/csprng.h | 8 ++++++++ torchcsprng/csrc/macros.h | 8 ++++++++ 11 files changed, 81 insertions(+) diff --git a/test/__init__.py b/test/__init__.py index e69de29..10a5577 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -0,0 +1,5 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. diff --git a/test/test_csprng.py b/test/test_csprng.py index 46c6443..ae13233 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -1,3 +1,9 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + import unittest import torch from scipy import stats diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py index 6f59221..1d31673 100644 --- a/torchcsprng/__init__.py +++ b/torchcsprng/__init__.py @@ -1,3 +1,9 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + import torch del torch diff --git a/torchcsprng/csrc/OffsetCalculator.cuh b/torchcsprng/csrc/OffsetCalculator.cuh index 1c76d70..9358707 100644 --- a/torchcsprng/csrc/OffsetCalculator.cuh +++ b/torchcsprng/csrc/OffsetCalculator.cuh @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #pragma once #include diff --git a/torchcsprng/csrc/THCIntegerDivider.cuh b/torchcsprng/csrc/THCIntegerDivider.cuh index 9d57ef9..d18e742 100644 --- a/torchcsprng/csrc/THCIntegerDivider.cuh +++ b/torchcsprng/csrc/THCIntegerDivider.cuh @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #ifndef THC_INTEGER_DIVIDER_INC #define THC_INTEGER_DIVIDER_INC diff --git a/torchcsprng/csrc/aes.h b/torchcsprng/csrc/aes.h index 8782816..09596f1 100644 --- a/torchcsprng/csrc/aes.h +++ b/torchcsprng/csrc/aes.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #pragma once #include "macros.h" diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index 99801c1..a951c44 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #pragma once #include "macros.h" diff --git a/torchcsprng/csrc/csprng.cpp b/torchcsprng/csrc/csprng.cpp index c526086..8ed519c 100644 --- a/torchcsprng/csrc/csprng.cpp +++ b/torchcsprng/csrc/csprng.cpp @@ -1 +1,9 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #include "csprng.h" diff --git a/torchcsprng/csrc/csprng.cu b/torchcsprng/csrc/csprng.cu index c526086..8ed519c 100644 --- a/torchcsprng/csrc/csprng.cu +++ b/torchcsprng/csrc/csprng.cu @@ -1 +1,9 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #include "csprng.h" diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index ed3d6c6..15adec1 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #pragma once #include #include diff --git a/torchcsprng/csrc/macros.h b/torchcsprng/csrc/macros.h index aaa6b67..b416df1 100644 --- a/torchcsprng/csrc/macros.h +++ b/torchcsprng/csrc/macros.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + #pragma once #if defined(__CUDACC__) || defined(__HIPCC__) From 57d74efe61cbb93998d046acce65ea4f55b14d44 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 25 Aug 2020 04:31:01 -0700 Subject: [PATCH 032/750] 2020-08-25 nightly release (bc958ce8284f81ed02017a3c7e351c38a56dfc1a) --- README.md | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 751a5cf..894432f 100644 --- a/README.md +++ b/README.md @@ -56,31 +56,37 @@ CSPRNG works with Python 3.6/3.7/3.8 on the following operating systems and can Anaconda: -```console -conda install torchcsprng -c pytorch -``` +| OS | CUDA | | +|---------|-----------------------------------------------|----------------------------------------------| +| Linux | 9.2

10.1

10.2

None | conda install torchcsprng cudatoolkit=9.2 -c pytorch

conda install torchcsprng cudatoolkit=10.1 -c pytorch

conda install torchcsprng cudatoolkit=10.2 -c pytorch

conda install torchcsprng cpuonly -c pytorch | +| macOS | None | conda install torchcsprng cpuonly -c pytorch | +| Windows | None | conda install torchcsprng cpuonly -c pytorch | pip: -```console -pip install torchcsprng -``` +| OS | CUDA | | +|---------|-----------------------------------------------|-------------------------------------------------------------------------------------| +| Linux | 9.2

10.1

10.2

None | pip install torchcsprng==0.1.1+cu92 torch==1.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng==0.1.1+cu101 torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng torch

pip install torchcsprng==0.1.1+cpu torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | +| macOS | None | pip install torchcsprng torch | +| Windows | None | pip install torchcsprng torch -f https://download.pytorch.org/whl/torch_stable.html | -Nightly builds: +### Nightly builds: Anaconda: -| OS | CUDA | | -|------------------------|-----------------------------------------------|-------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | conda install torchcsprng -c pytorch-nightly | -| macOS

Windows | None

None | conda install torchcsprng -c pytorch-nightly

conda install torchcsprng cpuonly -c pytorch-nightly | +| OS | CUDA | | +|---------|-----------------------------------------------|------------------------------------------------------| +| Linux | 9.2

10.1

10.2

None | conda install torchcsprng cudatoolkit=9.2 -c pytorch-nightly

conda install torchcsprng cudatoolkit=10.1 -c pytorch-nightly

conda install torchcsprng cudatoolkit=10.2 -c pytorch-nightly

conda install torchcsprng cpuonly -c pytorch-nightly | +| macOS | None | conda install torchcsprng cpuonly -c pytorch-nightly | +| Windows | None | conda install torchcsprng cpuonly -c pytorch-nightly | pip: -| OS | CUDA | | -|------------------------|-----------------------------------------------|----------------------------------------------------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | -| macOS

Windows | None

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| OS | CUDA | | +|---------|-----------------------------------------------|----------------------------------------------------------------------------------------------------| +| Linux | 9.2

10.1

10.2

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| macOS | None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| Windows | None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | ### From Source From d00295765a01110beffc5ad3e79598eb0371eb61 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 26 Aug 2020 04:30:45 -0700 Subject: [PATCH 033/750] 2020-08-26 nightly release (bc958ce8284f81ed02017a3c7e351c38a56dfc1a) From 4589d5a2b7e9fa368ae9d743f8c29667525755a6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 27 Aug 2020 04:30:42 -0700 Subject: [PATCH 034/750] 2020-08-27 nightly release (bc958ce8284f81ed02017a3c7e351c38a56dfc1a) From e3d7888491151c8bfa9213920c90d8a1278a5960 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 28 Aug 2020 04:30:57 -0700 Subject: [PATCH 035/750] 2020-08-28 nightly release (e9e5eaa4cca804310237fdd9543148303ea834ea) --- test/test_csprng.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index ae13233..9c04214 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -36,7 +36,7 @@ class TestCSPRNG(unittest.TestCase): size = 1000 - all_devices = ['cpu', 'cuda'] if csprng.supports_cuda() else ['cpu'] + all_devices = ['cpu', 'cuda'] if (torch.cuda.is_available() and csprng.supports_cuda()) else ['cpu'] def test_random_kstest(self): for device in self.all_devices: @@ -53,7 +53,7 @@ def test_random_kstest(self): res = stats.kstest(t.cpu(), stats.randint.cdf, args=(0, to_inc)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_random_cpu_vs_cuda(self): for dtype in self.num_dtypes: gen = csprng.create_mt19937_generator(42) @@ -71,7 +71,7 @@ def test_random_to_kstest(self): res = stats.kstest(t.cpu(), stats.randint.cdf, args=(0, to_)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_random_to_cpu_vs_cuda(self): to_ = 42 for dtype in self.num_dtypes: @@ -92,7 +92,7 @@ def test_random_from_to_kstest(self): res = stats.kstest(t.cpu(), stats.randint.cdf, args=(from_, to_)) self.assertTrue(res.statistic < 0.2) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_random_from_to_cpu_vs_cuda(self): for dtype in self.num_dtypes: for from_ in [0, 24, 42]: @@ -121,7 +121,7 @@ def test_random_bool(self): self.assertEqual(t.max(), True) self.assertTrue(0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_random_bool_cpu_vs_cuda(self): gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=torch.bool, device='cpu').random_(generator=gen) @@ -140,7 +140,7 @@ def test_uniform_kstest(self): res = stats.kstest(t.cpu().to(torch.double), 'uniform', args=(from_, (to_ - from_))) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_uniform_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for from_ in [-42, 0, 4.2]: @@ -162,7 +162,7 @@ def test_normal_kstest(self): res = stats.kstest(t.cpu().to(torch.double), 'norm', args=(mean, std)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_normal_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for mean in [-3, 0, 7]: @@ -183,7 +183,7 @@ def test_log_normal_kstest(self): res = stats.kstest(t.cpu().to(torch.double), 'lognorm', args=(std, 0, math.exp(mean))) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_log_normal_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for mean in [-3, 0, 7]: @@ -203,7 +203,7 @@ def test_exponential_kstest(self): res = stats.kstest(t.cpu().to(torch.double), 'expon', args=(0, 1 / lambd,)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_exponential_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for lambd in [0.5, 1.0, 5.0]: @@ -223,7 +223,7 @@ def test_cauchy_kstest(self): res = stats.kstest(t.cpu().to(torch.double), 'cauchy', args=(median, sigma)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_cauchy_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for median in [-10, 0, 50]: @@ -245,7 +245,7 @@ def test_geometric(self): # res = stats.chisquare(actual, expected) # self.assertAlmostEqual(res.pvalue, 1.0, delta=0.5) TODO https://github.com/pytorch/csprng/issues/7 - @unittest.skipIf(not csprng.supports_cuda(), "csprng was not compiled with CUDA support") + @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") def test_geometric_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for p in [0.2, 0.5, 0.8]: @@ -307,6 +307,7 @@ def measure(size): # Pessimistic check that parallel execution gives >= 1.5 performance boost self.assertTrue(time_for_1M/time_for_1K < 1000 / min(1.5, torch.get_num_threads())) + @unittest.skip("Temporary disable because doesn't work on Sandcastle") def test_version(self): import torchcsprng.version as version self.assertTrue(version.__version__) From ec80aacbdff710cac7c6a7890b9c3569bd1e4c79 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 29 Aug 2020 04:30:43 -0700 Subject: [PATCH 036/750] 2020-08-29 nightly release (e9e5eaa4cca804310237fdd9543148303ea834ea) From 4275032efeef2b98572beb5d80b0480206392dcc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 30 Aug 2020 04:30:36 -0700 Subject: [PATCH 037/750] 2020-08-30 nightly release (e9e5eaa4cca804310237fdd9543148303ea834ea) From f768712c39cfff3f868ed18a57731818ca712c67 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 31 Aug 2020 04:30:31 -0700 Subject: [PATCH 038/750] 2020-08-31 nightly release (e9e5eaa4cca804310237fdd9543148303ea834ea) From e2ed93e6f1ba202c902d52c7355c1b9870662ce7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 1 Sep 2020 04:30:35 -0700 Subject: [PATCH 039/750] 2020-09-01 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) --- .circleci/config.yml | 4 +-- README.md | 5 ++- test/test_csprng.py | 22 ++++++++++++ torchcsprng/csrc/csprng.h | 73 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f01ff6e..a601e17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -157,7 +157,7 @@ jobs: binary_macos_wheel: <<: *binary_common macos: - xcode: "9.0" + xcode: "9.4.1" steps: - checkout_merge - run: @@ -179,7 +179,7 @@ jobs: binary_macos_conda: <<: *binary_common macos: - xcode: "9.0" + xcode: "9.4.1" steps: - checkout_merge - run: diff --git a/README.md b/README.md index 894432f..bc4ce73 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ The following list of methods supports all forementioned PRNGs: | log_normal_(mean, std) | yes | yes | | geometric_(p) | yes | yes | | exponential_(lambda) | yes | yes | +| randperm(n) | yes* | yes | + +* the calculations are done on CPU and the result is copied to CUDA ## Installation @@ -66,7 +69,7 @@ pip: | OS | CUDA | | |---------|-----------------------------------------------|-------------------------------------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | pip install torchcsprng==0.1.1+cu92 torch==1.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng==0.1.1+cu101 torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng torch

pip install torchcsprng==0.1.1+cpu torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | +| Linux | 9.2

10.1

10.2

None | pip install torchcsprng==0.1.2+cu92 torch==1.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng==0.1.2+cu101 torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng torch

pip install torchcsprng==0.1.2+cpu torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | | macOS | None | pip install torchcsprng torch | | Windows | None | pip install torchcsprng torch -f https://download.pytorch.org/whl/torch_stable.html | diff --git a/test/test_csprng.py b/test/test_csprng.py index 9c04214..f8f07f9 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -313,5 +313,27 @@ def test_version(self): self.assertTrue(version.__version__) self.assertTrue(version.git_version) + def test_randperm(self): + for device in self.all_devices: + for gen in self.all_generators: + for dtype in self.int_dtypes: + for size in range(0, 20): + expected = torch.arange(size, dtype=dtype, device=device) + + actual = torch.randperm(size, dtype=dtype, device=device, generator=gen) + + actual_out = torch.empty(1, dtype=dtype, device=device) + torch.randperm(size, out=actual_out, generator=gen) + + if size >= 10: + self.assertTrue(not torch.allclose(expected, actual)) + self.assertTrue(not torch.allclose(expected, actual_out)) + + actual = actual.sort()[0] + actual_out = actual.sort()[0] + + self.assertTrue(torch.allclose(expected, actual)) + self.assertTrue(torch.allclose(expected, actual_out)) + if __name__ == '__main__': unittest.main() diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index 15adec1..2d1e16a 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -71,7 +71,7 @@ void aes_helper(TensorIterator& iter, const uint8_t* key, transform_t transform_ [key] TORCH_CSPRNG_HOST_DEVICE (unsigned int idx) -> aes::block_t { aes::block_t block; memset(&block, 0, aes::block_t_size); - *(reinterpret_cast(&block)) = idx; + block.x = idx; aes::encrypt(reinterpret_cast(&block), key); return block; }, @@ -337,6 +337,75 @@ Tensor& exponential_(Tensor& self, double lambda, c10::optional gen) return exponential_impl_(self, lambda, gen); } +// =============================================== Random permutation ================================================= + +// randperm implementation was copied from PyTorch to unblock CSPRNG users, but ultimately CSPRNG must reuse +// refactored randperm from PyTorch, see https://github.com/pytorch/pytorch/issues/43816 + +namespace { + + inline void check_supported_max_int_with_precision(int64_t n, const Tensor& tensor) { + TORCH_CHECK(at::scalar_tensor(n, tensor.options()).defined(), + "n is too large for result tensor type: '", tensor.toString(), "'"); + + // Ensure sufficient precision for floating point representation. + switch (tensor.scalar_type()) { + case at::ScalarType::Half: + TORCH_CHECK(n <= (int64_t(1) << 11) + 1, "n cannot be greater than 2049 for Half type."); + break; + case at::ScalarType::Float: + TORCH_CHECK(n <= (int64_t(1) << 24) + 1, "n cannot be greater than 2^24+1 for Float type."); + break; + case at::ScalarType::Double: // Unlikely to happen, but doesn't hurt to check + TORCH_CHECK(n <= (int64_t(1) << 53) + 1, "n cannot be greater than 2^53+1 for Double type."); + break; + default: + break; + } + } + + template + void randperm(Tensor& result, int64_t n, c10::optional generator) { + auto gen = at::check_generator(generator); + scalar_t *r__data = result.data_ptr(); + + result.resize_({n}); + int64_t r__stride_0 = result.stride(0); + + at::parallel_for(0, n, internal::GRAIN_SIZE, + [&r__data, &r__stride_0](int64_t p_begin, int64_t p_end) { + for(int64_t i = p_begin; i < p_end; i++) + r__data[i*r__stride_0] = static_cast(i); + }); + + for(int64_t i = 0; i < n - 1; i++) + { + int64_t z = gen->random() % (n-i); + scalar_t sav = r__data[i*r__stride_0]; + r__data[i*r__stride_0] = r__data[(z+i)*r__stride_0]; + r__data[(z+i)*r__stride_0] = sav; + } + } +} // namespace + +Tensor& randperm_generator_out(Tensor& result, int64_t n, c10::optional generator) { + TORCH_CHECK(n >= 0, "n must be non-negative, got", n); + check_supported_max_int_with_precision(n, result); + if (result.device().type() == at::kCUDA) { + auto result_cpu = at::empty({n}, result.options().device(kCPU)); + randperm_generator_out(result_cpu, n, generator); + result.resize_({n}); + return result.copy_(result_cpu); + } + result.resize_({n}); + // See Note [Acquire lock when using random generators] + std::lock_guard lock(generator->mutex()); + AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::Half, result.scalar_type(), "randperm", [&]() -> void { + randperm(result, n, generator); + }); + return result; +} + // ==================================================================================================================== Generator create_random_device_generator(c10::optional token = c10::nullopt) { @@ -386,6 +455,8 @@ TORCH_LIBRARY_IMPL(aten, CustomRNGKeyId, m) { m.impl_UNBOXED("geometric_", geometric_); // Exponential m.impl_UNBOXED("exponential_", exponential_); + // Random permutation + m.impl_UNBOXED("randperm.generator_out", randperm_generator_out); } PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { From 26f7414b998033fed76eb1eb3e1d906dc95bf1d4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 2 Sep 2020 04:30:41 -0700 Subject: [PATCH 040/750] 2020-09-02 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 75ba41917b2931071f947d573af2b3500cb1b8c0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 3 Sep 2020 04:30:36 -0700 Subject: [PATCH 041/750] 2020-09-03 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 4f31e91f42734e30b0ce9829449e9e85df6c2b04 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 4 Sep 2020 04:31:02 -0700 Subject: [PATCH 042/750] 2020-09-04 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 95d42d9830df0cdd0a520931b052fd4bfc2ea168 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 5 Sep 2020 04:30:33 -0700 Subject: [PATCH 043/750] 2020-09-05 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 255c490215e23ae10db83887a0bea8f62b647a2a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 6 Sep 2020 04:30:34 -0700 Subject: [PATCH 044/750] 2020-09-06 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From e5f7d11da2d52d23071fb3e041861109bbce625e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 7 Sep 2020 04:30:41 -0700 Subject: [PATCH 045/750] 2020-09-07 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 234f231980c4655392cda588e1d080a0fc2edaa1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 8 Sep 2020 04:30:39 -0700 Subject: [PATCH 046/750] 2020-09-08 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 8f1e238a8eade9a762ea56babaeddef61dade124 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 9 Sep 2020 04:30:45 -0700 Subject: [PATCH 047/750] 2020-09-09 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 30152804b851270ef8beb35ff41e2d91f96d459f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 10 Sep 2020 04:30:42 -0700 Subject: [PATCH 048/750] 2020-09-10 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From b13f219827ec438acdba173ea1473ac4aa4606d7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 11 Sep 2020 04:30:35 -0700 Subject: [PATCH 049/750] 2020-09-11 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From ec27907f7e3c55a8b35e3cbb610d3b6ac2a54982 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 12 Sep 2020 04:30:39 -0700 Subject: [PATCH 050/750] 2020-09-12 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From f47f5446fb3ac7b0b6f68cf311c636e40632721c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 13 Sep 2020 04:30:34 -0700 Subject: [PATCH 051/750] 2020-09-13 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From f24e8d6b1943ae26abad6ea09601da7ef0c0e973 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 14 Sep 2020 04:30:33 -0700 Subject: [PATCH 052/750] 2020-09-14 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From ca7296cf03dfc6261af6a091a798a17a86382daa Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 15 Sep 2020 04:30:39 -0700 Subject: [PATCH 053/750] 2020-09-15 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From 2630e2e24736979941f99128f83c2c4237a2c834 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 16 Sep 2020 04:30:34 -0700 Subject: [PATCH 054/750] 2020-09-16 nightly release (7fc5a05cdfe32781d94661a2c248e92a9253a3de) From dfe611e49276bb595a7053d091cdc014ece15c6d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 17 Sep 2020 04:30:34 -0700 Subject: [PATCH 055/750] 2020-09-17 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) --- test/test_csprng.py | 19 +++++++++++++++++ torchcsprng/csrc/block_cipher.h | 3 +++ torchcsprng/csrc/csprng.h | 36 ++++++++++++++++++++++++--------- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index f8f07f9..b4c5443 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -335,5 +335,24 @@ def test_randperm(self): self.assertTrue(torch.allclose(expected, actual)) self.assertTrue(torch.allclose(expected, actual_out)) + def test_aes128_key_tensor(self): + size = 10 + for gen in self.all_generators: + s = set() + for _ in range(0, size): + t = csprng.aes128_key_tensor(gen) + s.add(str(t)) + self.assertEqual(len(s), size) + + def test_const_generator(self): + for device in self.all_devices: + for gen in self.all_generators: + for dtype in self.int_dtypes: + key = csprng.aes128_key_tensor(gen) + const_gen = csprng.create_const_generator(key) + first = torch.empty(self.size, dtype=dtype, device=device).random_(generator=const_gen) + second = torch.empty(self.size, dtype=dtype, device=device).random_(generator=const_gen) + self.assertTrue((first - second).max().abs() == 0) + if __name__ == '__main__': unittest.main() diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index a951c44..2ca313f 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -37,6 +37,9 @@ template at::Tensor key_tensor(size_t block_t_size, c10::optional generator) { std::lock_guard lock(generator->mutex()); auto gen = at::check_generator(generator); + if (gen->key().defined()) { + return gen->key().clone(); + } auto t = torch::empty({static_cast(block_t_size)}, torch::kUInt8); using random_t = uint32_t; constexpr size_t random_t_size = sizeof(random_t); diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index 2d1e16a..f1fa0f9 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -38,9 +38,11 @@ struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { CSPRNGGeneratorImpl(bool use_rd) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{use_rd} {} CSPRNGGeneratorImpl(const std::string& token) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{true}, rd_{token} {} CSPRNGGeneratorImpl(uint64_t seed) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{false}, mt_{static_cast(seed)} { } + CSPRNGGeneratorImpl(Tensor key) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, key_(key) {} ~CSPRNGGeneratorImpl() = default; uint32_t random() { return use_rd_ ? rd_() : mt_(); } uint64_t random64() { return use_rd_ ? make64BitsFrom32Bits(rd_(), rd_()) : make64BitsFrom32Bits(mt_(), mt_()); } + const Tensor& key() const { return key_; }; void set_current_seed(uint64_t seed) override { throw std::runtime_error("not implemented"); } uint64_t current_seed() const override { throw std::runtime_error("not implemented"); } @@ -52,8 +54,14 @@ struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { bool use_rd_; std::random_device rd_; std::mt19937 mt_; + Tensor key_; }; +template +Tensor aes128_key_tensor(Generator generator) { + return key_tensor(aes::block_t_size, generator); +} + // ==================================================================================================================== // Applies AES in CTR mode with the `key` for passed TensorIterator iter. @@ -100,7 +108,7 @@ template <> struct UIntType { using type = uint32_t; }; template struct RandomKernel { void operator()(TensorIterator& iter, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND(ScalarType::Bool, iter.dtype(), "random_kernel", [&] { aes_helper::type>(iter, key, @@ -136,7 +144,7 @@ void random_full_range_kernel_helper(TensorIterator& iter, const uint8_t* key) { template struct RandomFromToKernel { void operator()(TensorIterator& iter, uint64_t range, int64_t base, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND3(at::ScalarType::Bool, at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "random_from_to_kernel", [&] { if (( @@ -152,7 +160,7 @@ struct RandomFromToKernel { }); } void operator()(TensorIterator& iter, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::BFloat16, iter.dtype(), "random_full_64_bits_range_kernel", [&] { if (std::is_same::value || @@ -185,7 +193,7 @@ Tensor& random_to(Tensor& self, int64_t to, c10::optional generator) template struct UniformKernel { void operator()(TensorIterator& iter, double from, double to, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "uniform_kernel", [&] { aes_helper(iter, key, @@ -208,7 +216,7 @@ template struct NormalKernel { void operator()(Tensor& self, double mean, double std, c10::optional generator) { auto iter = TensorIterator::nullary_op(self); - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "normal_kernel", [&] { aes_helper(iter, key, @@ -254,7 +262,7 @@ Tensor normal_Tensor_Tensor(const Tensor& mean, const Tensor& std, c10::optional template struct CauchyKernel { void operator()(TensorIterator& iter, double median, double sigma, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "cauchy_kernel", [&] { aes_helper(iter, key, @@ -276,7 +284,7 @@ Tensor& cauchy_(Tensor& self, double median, double sigma, c10::optional struct LogNormalKernel { void operator()(TensorIterator& iter, double mean, double std, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "log_normal", [&] { aes_helper(iter, key, @@ -298,7 +306,7 @@ Tensor& log_normal_(Tensor& self, double mean, double std, c10::optional struct GeometricKernel { void operator()(TensorIterator& iter, double p, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "geometric_kernel", [&] { aes_helper::type, 1>(iter, key, @@ -320,7 +328,7 @@ Tensor& geometric_(Tensor& self, double p, c10::optional gen) { template struct ExponentialKernel { void operator()(TensorIterator& iter, double lambda, c10::optional generator) { - const Tensor key_t = key_tensor(aes::block_t_size, generator).to(iter.device()); + const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "exponential_kernel", [&] { aes_helper(iter, key, @@ -432,6 +440,14 @@ bool supports_cuda() { #endif } +Tensor aes128_key_tensor_pybind(Generator generator) { + return aes128_key_tensor(generator); +} + +Generator create_const_generator(Tensor key) { + return make_generator(key); +} + TORCH_LIBRARY_IMPL(aten, CustomRNGKeyId, m) { // Random m.impl_UNBOXED("random_.from", random_from_to); @@ -463,4 +479,6 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("supports_cuda", &supports_cuda); m.def("create_random_device_generator", &create_random_device_generator, py::arg("token") = nullptr); m.def("create_mt19937_generator", &create_mt19937_generator, py::arg("seed") = nullptr); + m.def("aes128_key_tensor", &aes128_key_tensor_pybind); + m.def("create_const_generator", &create_const_generator); } From a289765bc1e706289d9aa311313f9af303cf729b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 18 Sep 2020 04:30:35 -0700 Subject: [PATCH 056/750] 2020-09-18 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From f598caa711a986c391dfa3e5a2181aafe54d5302 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 19 Sep 2020 04:30:43 -0700 Subject: [PATCH 057/750] 2020-09-19 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 28aeb2649d0f9fd4ecc1b96548e1c0badadf7754 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 20 Sep 2020 04:30:34 -0700 Subject: [PATCH 058/750] 2020-09-20 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 4bc84fe298d3c735e11d44ef82ffb45365ea5ad1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 21 Sep 2020 04:30:42 -0700 Subject: [PATCH 059/750] 2020-09-21 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From bc45f7c18d6695d2a69db0d0abec224a37f61ee2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 22 Sep 2020 04:30:33 -0700 Subject: [PATCH 060/750] 2020-09-22 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 392e10805c15cd36659a245986d11fdcd2038ff9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 23 Sep 2020 04:30:44 -0700 Subject: [PATCH 061/750] 2020-09-23 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 3ed401664dbf1263601b986f23c6d386f1d54f5c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 24 Sep 2020 04:30:44 -0700 Subject: [PATCH 062/750] 2020-09-24 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From b3f8d12bc31bcb8b419ba790732107294d71c1bc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 25 Sep 2020 04:30:40 -0700 Subject: [PATCH 063/750] 2020-09-25 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From bdb1602d3066243800ea0259cf1abe18237677fb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 26 Sep 2020 04:30:35 -0700 Subject: [PATCH 064/750] 2020-09-26 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 7dc8984069f7eef238b5f346f731f9428d4deab0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 27 Sep 2020 04:30:36 -0700 Subject: [PATCH 065/750] 2020-09-27 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 231974c8793f3ddc532072474febc6f8baf365ce Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 28 Sep 2020 04:34:58 -0700 Subject: [PATCH 066/750] 2020-09-28 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 3b479570d3b1279f6e3146addb1d8dd9bc780b63 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 29 Sep 2020 04:30:33 -0700 Subject: [PATCH 067/750] 2020-09-29 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 41ea4dc05cdf87cf5d5cd5a51cb7dc8969a77040 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 30 Sep 2020 04:30:50 -0700 Subject: [PATCH 068/750] 2020-09-30 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 30c1d08b8b3688c5dcbca0e0babfe74f2e8c5271 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 1 Oct 2020 04:30:38 -0700 Subject: [PATCH 069/750] 2020-10-01 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 8ffd16904e58eb48ca1431577629e9d7cb9efd89 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 2 Oct 2020 04:30:31 -0700 Subject: [PATCH 070/750] 2020-10-02 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From a688ed74be171b2e2324e6f0972f59bac719e8ca Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 3 Oct 2020 04:30:46 -0700 Subject: [PATCH 071/750] 2020-10-03 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From ef187b9e4447daa2a50a6807d84a263fee881abe Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 4 Oct 2020 04:31:06 -0700 Subject: [PATCH 072/750] 2020-10-04 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From a72835ea7f79a5b0f40566f99c7e945bfc8f57dc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 5 Oct 2020 04:30:39 -0700 Subject: [PATCH 073/750] 2020-10-05 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 22bc5b223980f0252388ffe8060345bdd256fe01 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 6 Oct 2020 04:30:31 -0700 Subject: [PATCH 074/750] 2020-10-06 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 3781bb983d56093316e5769f531d83409fa58e51 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 7 Oct 2020 04:30:38 -0700 Subject: [PATCH 075/750] 2020-10-07 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 8930adcddfceca6670bf9b3b8dce8845f48e156d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 8 Oct 2020 04:30:46 -0700 Subject: [PATCH 076/750] 2020-10-08 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 63d4596879b13e8e0f7351dd9e47c6b2dd7034eb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 9 Oct 2020 04:30:38 -0700 Subject: [PATCH 077/750] 2020-10-09 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 5c49e028feebb0ffecaa4470b9ef1dfe8fe402ba Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 10 Oct 2020 04:30:39 -0700 Subject: [PATCH 078/750] 2020-10-10 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 6bcef683f8dcee48fde7e19fb615af8c0d0bcdd0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 11 Oct 2020 04:30:35 -0700 Subject: [PATCH 079/750] 2020-10-11 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 470396d18aae77e3bbc4bf184fdc332f2fa1c8ca Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 12 Oct 2020 04:30:41 -0700 Subject: [PATCH 080/750] 2020-10-12 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 49d7a02814418db662805cfa9b4d3f7206d3df98 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 13 Oct 2020 04:30:32 -0700 Subject: [PATCH 081/750] 2020-10-13 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 007a68d1fa64b9ad73706140209d726699437cb6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 14 Oct 2020 04:30:38 -0700 Subject: [PATCH 082/750] 2020-10-14 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 37d7bc5ce9235935fc59cd34989684290ba9a682 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 15 Oct 2020 04:30:34 -0700 Subject: [PATCH 083/750] 2020-10-15 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 8bbcfe93696627106fd3a516bfcb08b834011daf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 16 Oct 2020 04:31:08 -0700 Subject: [PATCH 084/750] 2020-10-16 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 63af88ace2668b27b5bed72757910597ebc263ee Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 17 Oct 2020 04:30:37 -0700 Subject: [PATCH 085/750] 2020-10-17 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 22c17308854181f0fdfeae5485a8a76d3b55170a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 18 Oct 2020 04:30:43 -0700 Subject: [PATCH 086/750] 2020-10-18 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 2ef790d83081f90c0897d2c41e3e64d8f312a4d0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 19 Oct 2020 04:31:05 -0700 Subject: [PATCH 087/750] 2020-10-19 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 239a6967c106b37727c8ed00bad1d819b3ec4594 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 20 Oct 2020 04:30:35 -0700 Subject: [PATCH 088/750] 2020-10-20 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 67654569d2fb4b839dd5f835a1c7f7223818f745 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 21 Oct 2020 04:31:10 -0700 Subject: [PATCH 089/750] 2020-10-21 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 500de17800d40284b869ebbcbf9af457eb754467 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 22 Oct 2020 04:30:32 -0700 Subject: [PATCH 090/750] 2020-10-22 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From ba05d2575c7c961bc9d71a29ba70b8f591d49511 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 23 Oct 2020 04:30:38 -0700 Subject: [PATCH 091/750] 2020-10-23 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From e0f815e2b500fa38d1f8c0102d252b67f8b40800 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 24 Oct 2020 04:30:34 -0700 Subject: [PATCH 092/750] 2020-10-24 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 1f09dd08fb0126223c09b89c0197fb75c18042b6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 25 Oct 2020 04:30:45 -0700 Subject: [PATCH 093/750] 2020-10-25 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 0e449eb05eb0adead1c85cb7a199b3095d9d9ebd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 26 Oct 2020 04:30:50 -0700 Subject: [PATCH 094/750] 2020-10-26 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From e9314fe151f2903db63978855b8e07b3c9e89988 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 27 Oct 2020 04:30:36 -0700 Subject: [PATCH 095/750] 2020-10-27 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 4f18d7cabf254d43df77defc698596afa566aff3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 28 Oct 2020 04:30:37 -0700 Subject: [PATCH 096/750] 2020-10-28 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 7bf17270b3f211cae07bab83374df48997d3d02d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 29 Oct 2020 04:30:40 -0700 Subject: [PATCH 097/750] 2020-10-29 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From e31259a854b7896cade56fded070c45419c0b37b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 30 Oct 2020 04:30:49 -0700 Subject: [PATCH 098/750] 2020-10-30 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 30cf4bf4183c47f1df326fea4ed40f4057501d53 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 31 Oct 2020 04:30:51 -0700 Subject: [PATCH 099/750] 2020-10-31 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 22093af3d5975c3ed453b1db2ab9fe771c73e60c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 1 Nov 2020 04:30:35 -0800 Subject: [PATCH 100/750] 2020-11-01 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 9e57eb30e8f15c15540e81e987b04a257818eddb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 2 Nov 2020 04:30:32 -0800 Subject: [PATCH 101/750] 2020-11-02 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 4737c74d70da454774e19ea43ceef9e8959a26e7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 3 Nov 2020 04:30:47 -0800 Subject: [PATCH 102/750] 2020-11-03 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From b5acbbdc308f54d43c08d79ebc645851a1972d78 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 4 Nov 2020 04:30:49 -0800 Subject: [PATCH 103/750] 2020-11-04 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 863fb6a678f7a5d765e85526f26c6015a45fcf07 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 5 Nov 2020 04:30:50 -0800 Subject: [PATCH 104/750] 2020-11-05 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From e4d1bd4ce786d614cbe05a629df125b3d17ee70a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 6 Nov 2020 04:30:32 -0800 Subject: [PATCH 105/750] 2020-11-06 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 33b9d55c6a8507cdb06c3bc2f80c700dd2f45c07 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 7 Nov 2020 04:30:34 -0800 Subject: [PATCH 106/750] 2020-11-07 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 8ce3e99565b1f7a33aa8a1cbc31e5c330da8dca5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 8 Nov 2020 04:30:38 -0800 Subject: [PATCH 107/750] 2020-11-08 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From c232f3d77e03caa667e679eac44e147a9345c02b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 9 Nov 2020 04:30:36 -0800 Subject: [PATCH 108/750] 2020-11-09 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From ee8fe9a9a4f118908e36c9835d08b595ad454e3d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 10 Nov 2020 04:30:41 -0800 Subject: [PATCH 109/750] 2020-11-10 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 9a0e85a941c6b074532e937d32100129d0dde785 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 11 Nov 2020 04:30:59 -0800 Subject: [PATCH 110/750] 2020-11-11 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 5902620d086eba2a3a37ca101bfeae1d45b4fddb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 12 Nov 2020 04:30:59 -0800 Subject: [PATCH 111/750] 2020-11-12 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From f12e4623ce213e45cb0e2440ac3cbb41b75eb556 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 13 Nov 2020 04:30:34 -0800 Subject: [PATCH 112/750] 2020-11-13 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 398c2530919252b91ad1a96b1e9f81acfd4b1e67 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 14 Nov 2020 04:30:34 -0800 Subject: [PATCH 113/750] 2020-11-14 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 79a72969766a6a6c97555303280ce9d8d8cc48b0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 15 Nov 2020 04:30:35 -0800 Subject: [PATCH 114/750] 2020-11-15 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 512cfa7e8a2ae0fb993248e76305fed916af23e8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 16 Nov 2020 04:30:37 -0800 Subject: [PATCH 115/750] 2020-11-16 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 6674d7636c7a423c60bb146f27a58c8638bcc6c9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 17 Nov 2020 04:30:43 -0800 Subject: [PATCH 116/750] 2020-11-17 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 5ca527852a13d747a87876e81bebfec75e510ebd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 18 Nov 2020 04:30:43 -0800 Subject: [PATCH 117/750] 2020-11-18 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 358f837f5dce8bcc35a8e722b497aa6e4b03af37 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 19 Nov 2020 04:30:36 -0800 Subject: [PATCH 118/750] 2020-11-19 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 3d889ffabd38e65c71fdf8d19c5bf22064734326 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 20 Nov 2020 04:30:41 -0800 Subject: [PATCH 119/750] 2020-11-20 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 58dd41468bb3da34a2c22f33e2ac2c23e5354d8f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 21 Nov 2020 04:30:35 -0800 Subject: [PATCH 120/750] 2020-11-21 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 0cde225cbf0f4fdbf86a2723ecc14a9fd627536a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 22 Nov 2020 04:30:36 -0800 Subject: [PATCH 121/750] 2020-11-22 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 2ccd3a198160dc242fc3e8acd011d66ebe5cdb81 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 23 Nov 2020 04:30:43 -0800 Subject: [PATCH 122/750] 2020-11-23 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 381d3e57a5ceacd1e04688638af5978edc4194ba Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 24 Nov 2020 04:30:45 -0800 Subject: [PATCH 123/750] 2020-11-24 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 4984372b62df5db09dbd3d6f6efa369e01525321 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 25 Nov 2020 04:30:44 -0800 Subject: [PATCH 124/750] 2020-11-25 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From b145a42f9d36bce1ad93c43563f4bd57653d8657 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 26 Nov 2020 04:30:33 -0800 Subject: [PATCH 125/750] 2020-11-26 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 0ba53ef5546764cda8a4d50f5a59bd49f9f1ec7f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 27 Nov 2020 04:30:55 -0800 Subject: [PATCH 126/750] 2020-11-27 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 0065271f315886608cc2fe4a97c910afcbfe72fc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 28 Nov 2020 04:30:36 -0800 Subject: [PATCH 127/750] 2020-11-28 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From 6883d818eff8d1ce4ab59c3dd839e46f0f4c4a40 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 29 Nov 2020 04:30:37 -0800 Subject: [PATCH 128/750] 2020-11-29 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From be47e6edafe9f6f38181348465d8cbbc62b94fe0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 30 Nov 2020 04:30:32 -0800 Subject: [PATCH 129/750] 2020-11-30 nightly release (64fedf7e0ab93188cc06b39308ad2ec0e3771bb2) From d8a267563c851ddb0c6dc30ff2b91e05cfaa4241 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 1 Dec 2020 04:30:32 -0800 Subject: [PATCH 130/750] 2020-12-01 nightly release (18241ced6792a2023a40ec872273d0b3c1ab2b1d) --- .circleci/config.yml | 324 ++++++++++++++++++++ packaging/pkg_helpers.bash | 14 + packaging/windows/internal/cuda_install.bat | 18 ++ test/test_csprng.py | 46 +++ torchcsprng/csrc/aes.h | 127 +++++++- torchcsprng/csrc/block_cipher.h | 239 ++++++++------- torchcsprng/csrc/csprng.h | 163 +++++++++- 7 files changed, 807 insertions(+), 124 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a601e17..b2ddd96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -416,6 +416,11 @@ workflows: name: binary_linux_wheel_py3.6_cu102 python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_wheel: + cu_version: cu110 + name: binary_linux_wheel_py3.6_cu110 + python_version: '3.6' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_linux_wheel: cu_version: cpu name: binary_linux_wheel_py3.7_cpu @@ -436,6 +441,11 @@ workflows: name: binary_linux_wheel_py3.7_cu102 python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_wheel: + cu_version: cu110 + name: binary_linux_wheel_py3.7_cu110 + python_version: '3.7' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_linux_wheel: cu_version: cpu name: binary_linux_wheel_py3.8_cpu @@ -456,6 +466,11 @@ workflows: name: binary_linux_wheel_py3.8_cu102 python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_wheel: + cu_version: cu110 + name: binary_linux_wheel_py3.8_cu110 + python_version: '3.8' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_macos_wheel: cu_version: cpu name: binary_macos_wheel_py3.6_cpu @@ -506,6 +521,15 @@ workflows: # tags: # only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_wheel_py3.6_cu102 +# python_version: '3.6' +# - binary_win_wheel: +# cu_version: cu110 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.6_cu110 # python_version: '3.6' - binary_win_wheel: cu_version: cpu @@ -542,6 +566,15 @@ workflows: # tags: # only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_wheel_py3.7_cu102 +# python_version: '3.7' +# - binary_win_wheel: +# cu_version: cu110 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_wheel_py3.7_cu110 # python_version: '3.7' - binary_win_wheel: cu_version: cpu @@ -567,8 +600,17 @@ workflows: # python_version: '3.8' # - binary_win_wheel: # cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_wheel_py3.8_cu102 # python_version: '3.8' +# - binary_win_wheel: +# cu_version: cu110 +# name: binary_win_wheel_py3.8_cu110 +# python_version: '3.8' - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.6_cpu @@ -589,6 +631,11 @@ workflows: name: binary_linux_conda_py3.6_cu102 python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_conda: + cu_version: cu110 + name: binary_linux_conda_py3.6_cu110 + python_version: '3.6' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.7_cpu @@ -609,6 +656,11 @@ workflows: name: binary_linux_conda_py3.7_cu102 python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_conda: + cu_version: cu110 + name: binary_linux_conda_py3.7_cu110 + python_version: '3.7' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.8_cpu @@ -629,6 +681,11 @@ workflows: name: binary_linux_conda_py3.8_cu102 python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_conda: + cu_version: cu110 + name: binary_linux_conda_py3.8_cu110 + python_version: '3.8' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_macos_conda: cu_version: cpu name: binary_macos_conda_py3.6_cpu @@ -679,6 +736,15 @@ workflows: # tags: # only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_conda_py3.6_cu102 +# python_version: '3.6' +# - binary_win_conda: +# cu_version: cu110 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.6_cu110 # python_version: '3.6' - binary_win_conda: cu_version: cpu @@ -715,6 +781,15 @@ workflows: # tags: # only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_conda_py3.7_cu102 +# python_version: '3.7' +# - binary_win_conda: +# cu_version: cu110 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: binary_win_conda_py3.7_cu110 # python_version: '3.7' - binary_win_conda: cu_version: cpu @@ -740,8 +815,17 @@ workflows: # python_version: '3.8' # - binary_win_conda: # cu_version: cu102 +# filters: +# branches: +# only: master +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ # name: binary_win_conda_py3.8_cu102 # python_version: '3.8' +# - binary_win_conda: +# cu_version: cu110 +# name: binary_win_conda_py3.8_cu110 +# python_version: '3.8' # - python_lint # - python_type_check # - clang_format @@ -906,6 +990,27 @@ workflows: requires: - nightly_binary_linux_wheel_py3.6_cu102 subfolder: cu102/ + - binary_linux_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.6_cu110 + python_version: '3.6' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.6_cu110_upload + requires: + - nightly_binary_linux_wheel_py3.6_cu110 + subfolder: cu110/ - binary_linux_wheel: cu_version: cpu filters: @@ -990,6 +1095,27 @@ workflows: requires: - nightly_binary_linux_wheel_py3.7_cu102 subfolder: cu102/ + - binary_linux_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.7_cu110 + python_version: '3.7' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.7_cu110_upload + requires: + - nightly_binary_linux_wheel_py3.7_cu110 + subfolder: cu110/ - binary_linux_wheel: cu_version: cpu filters: @@ -1074,6 +1200,27 @@ workflows: requires: - nightly_binary_linux_wheel_py3.8_cu102 subfolder: cu102/ + - binary_linux_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.8_cu110 + python_version: '3.8' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.8_cu110_upload + requires: + - nightly_binary_linux_wheel_py3.8_cu110 + subfolder: cu110/ - binary_macos_wheel: cu_version: cpu filters: @@ -1217,6 +1364,26 @@ workflows: # requires: # - nightly_binary_win_wheel_py3.6_cu102 # subfolder: cu102/ + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu110 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu110_upload + requires: + - nightly_binary_win_wheel_py3.6_cu110 + subfolder: cu110/ - binary_win_wheel: cu_version: cpu filters: @@ -1297,6 +1464,26 @@ workflows: # requires: # - nightly_binary_win_wheel_py3.7_cu102 # subfolder: cu102/ + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu110 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu110_upload + requires: + - nightly_binary_win_wheel_py3.7_cu110 + subfolder: cu110/ - binary_win_wheel: cu_version: cpu filters: @@ -1377,6 +1564,26 @@ workflows: # requires: # - nightly_binary_win_wheel_py3.8_cu102 # subfolder: cu102/ + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu110 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu110_upload + requires: + - nightly_binary_win_wheel_py3.8_cu110 + subfolder: cu110/ - binary_linux_conda: cu_version: cpu filters: @@ -1457,6 +1664,26 @@ workflows: name: nightly_binary_linux_conda_py3.6_cu102_upload requires: - nightly_binary_linux_conda_py3.6_cu102 + - binary_linux_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.6_cu110 + python_version: '3.6' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.6_cu110_upload + requires: + - nightly_binary_linux_conda_py3.6_cu110 - binary_linux_conda: cu_version: cpu filters: @@ -1537,6 +1764,26 @@ workflows: name: nightly_binary_linux_conda_py3.7_cu102_upload requires: - nightly_binary_linux_conda_py3.7_cu102 + - binary_linux_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.7_cu110 + python_version: '3.7' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.7_cu110_upload + requires: + - nightly_binary_linux_conda_py3.7_cu110 - binary_linux_conda: cu_version: cpu filters: @@ -1617,6 +1864,26 @@ workflows: name: nightly_binary_linux_conda_py3.8_cu102_upload requires: - nightly_binary_linux_conda_py3.8_cu102 + - binary_linux_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.8_cu110 + python_version: '3.8' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.8_cu110_upload + requires: + - nightly_binary_linux_conda_py3.8_cu110 - binary_macos_conda: cu_version: cpu filters: @@ -1753,6 +2020,25 @@ workflows: # name: nightly_binary_win_conda_py3.6_cu102_upload # requires: # - nightly_binary_win_conda_py3.6_cu102 +# - binary_win_conda: +# cu_version: cu110 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu110 +# python_version: '3.6' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.6_cu110_upload +# requires: +# - nightly_binary_win_conda_py3.6_cu110 - binary_win_conda: cu_version: cpu filters: @@ -1829,6 +2115,25 @@ workflows: # name: nightly_binary_win_conda_py3.7_cu102_upload # requires: # - nightly_binary_win_conda_py3.7_cu102 +# - binary_win_conda: +# cu_version: cu110 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu110 +# python_version: '3.7' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.7_cu110_upload +# requires: +# - nightly_binary_win_conda_py3.7_cu110 - binary_win_conda: cu_version: cpu filters: @@ -1905,3 +2210,22 @@ workflows: # name: nightly_binary_win_conda_py3.8_cu102_upload # requires: # - nightly_binary_win_conda_py3.8_cu102 +# - binary_win_conda: +# cu_version: cu110 +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu110 +# python_version: '3.8' +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_win_conda_py3.8_cu110_upload +# requires: +# - nightly_binary_win_conda_py3.8_cu110 diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 6a1ea1a..f5de815 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -49,6 +49,17 @@ setup_cuda() { # Now work out the CUDA settings case "$CU_VERSION" in + cu110) + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.0" + else + export CUDA_HOME=/usr/local/cuda-11.0/ + fi + export FORCE_CUDA=1 + # Hard-coding gencode flags is temporary situation until + # https://github.com/pytorch/pytorch/pull/23408 lands + export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_50,code=compute_50" + ;; cu102) if [[ "$OSTYPE" == "msys" ]]; then export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2" @@ -265,6 +276,9 @@ setup_conda_cudatoolkit_constraint() { export CONDA_CUDATOOLKIT_CONSTRAINT="" else case "$CU_VERSION" in + cu110) + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.0,<11.1 # [not osx]" + ;; cu102) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=10.2,<10.3 # [not osx]" ;; diff --git a/packaging/windows/internal/cuda_install.bat b/packaging/windows/internal/cuda_install.bat index 15ea785..89bbed9 100644 --- a/packaging/windows/internal/cuda_install.bat +++ b/packaging/windows/internal/cuda_install.bat @@ -18,6 +18,7 @@ if %CUDA_VER% EQU 92 goto cuda92 if %CUDA_VER% EQU 100 goto cuda100 if %CUDA_VER% EQU 101 goto cuda101 if %CUDA_VER% EQU 102 goto cuda102 +if %CUDA_VER% EQU 110 goto cuda110 echo CUDA %CUDA_VERSION_STR% is not supported exit /b 1 @@ -89,6 +90,23 @@ if not exist "%SRC_DIR%\temp_build\cudnn-10.2-windows10-x64-v7.6.5.32.zip" ( goto cuda_common +:cuda110 + +if not exist "%SRC_DIR%\temp_build\cuda_11.0.2_451.48_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cuda_11.0.2_451.48_win10.exe --output "%SRC_DIR%\temp_build\cuda_11.0.2_451.48_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_11.0.2_451.48_win10.exe" + set "ARGS=nvcc_11.0 cuobjdump_11.0 nvprune_11.0 nvprof_11.0 cupti_11.0 cublas_11.0 cublas_dev_11.0 cudart_11.0 cufft_11.0 cufft_dev_11.0 curand_11.0 curand_dev_11.0 cusolver_11.0 cusolver_dev_11.0 cusparse_11.0 cusparse_dev_11.0 npp_11.0 npp_dev_11.0 nvrtc_11.0 nvrtc_dev_11.0 nvml_dev_11.0" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-11.0-windows-x64-v8.0.2.39.zip --output "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" +) + +goto cuda_common + :cuda_common if not exist "%SRC_DIR%\temp_build\NvToolsExt.7z" ( diff --git a/test/test_csprng.py b/test/test_csprng.py index b4c5443..21f0642 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -354,5 +354,51 @@ def test_const_generator(self): second = torch.empty(self.size, dtype=dtype, device=device).random_(generator=const_gen) self.assertTrue((first - second).max().abs() == 0) + def test_encrypt_decrypt(self): + key_size_bytes = 16 + block_size_bytes = 16 + + def sizeof(dtype): + if dtype == torch.bool: + return 1 + elif dtype.is_floating_point: + return torch.finfo(dtype).bits // 8 + else: + return torch.iinfo(dtype).bits // 8 + + for device in self.all_devices: + for key_dtype in self.all_dtypes: + key_size = key_size_bytes // sizeof(key_dtype) + key = torch.empty(key_size, dtype=key_dtype, device=device).random_() + for initial_dtype in self.all_dtypes: + for encrypted_dtype in self.all_dtypes: + for decrypted_dtype in self.all_dtypes: + for initial_size in [0, 4, 8, 15, 16, 23, 42]: + for mode in ["ecb", "ctr"]: + encrypted_size = (initial_size * sizeof(initial_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) + decrypted_size = (encrypted_size * sizeof(encrypted_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(decrypted_dtype) + + initial = torch.empty(initial_size, dtype=initial_dtype, device=device).random_() + encrypted = torch.empty(encrypted_size, dtype=encrypted_dtype, device=device).random_() + decrypted = torch.empty(decrypted_size, dtype=decrypted_dtype, device=device).random_() + + initial_np = initial.cpu().numpy().view(np.int8) + decrypted_np = decrypted.cpu().numpy().view(np.int8) + padding_size_bytes = initial_size * sizeof(initial_dtype) - decrypted_size * sizeof(decrypted_dtype) + if padding_size_bytes != 0: + decrypted_np = decrypted_np[:padding_size_bytes] + + csprng.encrypt(initial, encrypted, key, "aes128", mode) + + if initial_size > 8: + self.assertFalse(np.array_equal(initial_np, decrypted_np)) + + csprng.decrypt(encrypted, decrypted, key, "aes128", mode) + decrypted_np = decrypted.cpu().numpy().view(np.int8) + if padding_size_bytes != 0: + decrypted_np = decrypted_np[:padding_size_bytes] + + self.assertTrue(np.array_equal(initial_np, decrypted_np)) + if __name__ == '__main__': unittest.main() diff --git a/torchcsprng/csrc/aes.h b/torchcsprng/csrc/aes.h index 09596f1..c4ece07 100644 --- a/torchcsprng/csrc/aes.h +++ b/torchcsprng/csrc/aes.h @@ -63,15 +63,7 @@ namespace aes { #define Nr 10 // The number of rounds in AES Cipher. #endif -#if !defined(__CUDACC__) && !defined(__HIPCC__) -struct ulonglong2 // TODO: should have something like `__builtin_align__(16)` -{ - unsigned long long int x, y; -}; -#endif - -typedef ulonglong2 block_t; -constexpr size_t block_t_size = sizeof(block_t); +constexpr size_t block_t_size = 16; typedef uint8_t state_t[4][4]; @@ -97,6 +89,24 @@ TORCH_CSPRNG_CONSTANT const uint8_t sbox[256] = { 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; +TORCH_CSPRNG_CONSTANT const uint8_t rsbox[256] = { + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d }; + // The round constant word array, Rcon[i], contains the values given by // x to the power (i-1) being powers of x (x is denoted as {02}) in the field GF(2^8) TORCH_CSPRNG_CONSTANT const uint8_t Rcon[11] = { @@ -104,6 +114,8 @@ TORCH_CSPRNG_CONSTANT const uint8_t Rcon[11] = { #define getSBoxValue(num) (sbox[(num)]) +#define getSBoxInvert(num) (rsbox[(num)]) + // This function produces Nb(Nr+1) round keys. The round keys are used in each round to decrypt the states. TORCH_CSPRNG_HOST_DEVICE void KeyExpansion(uint8_t* RoundKey, const uint8_t* Key){ unsigned int i, j, k; @@ -257,6 +269,78 @@ TORCH_CSPRNG_HOST_DEVICE void MixColumns(state_t* state) } } +TORCH_CSPRNG_HOST_DEVICE uint8_t Multiply(uint8_t x, uint8_t y) +{ + return (((y & 1) * x) ^ + ((y>>1 & 1) * xtime(x)) ^ + ((y>>2 & 1) * xtime(xtime(x))) ^ + ((y>>3 & 1) * xtime(xtime(xtime(x)))) ^ + ((y>>4 & 1) * xtime(xtime(xtime(xtime(x)))))); /* this last call to xtime() can be omitted */ +} + +// MixColumns function mixes the columns of the state matrix. +// The method used to multiply may be difficult to understand for the inexperienced. +// Please use the references to gain more information. +TORCH_CSPRNG_HOST_DEVICE void InvMixColumns(state_t* state) +{ + int i; + uint8_t a, b, c, d; + for (i = 0; i < 4; ++i) + { + a = (*state)[i][0]; + b = (*state)[i][1]; + c = (*state)[i][2]; + d = (*state)[i][3]; + + (*state)[i][0] = Multiply(a, 0x0e) ^ Multiply(b, 0x0b) ^ Multiply(c, 0x0d) ^ Multiply(d, 0x09); + (*state)[i][1] = Multiply(a, 0x09) ^ Multiply(b, 0x0e) ^ Multiply(c, 0x0b) ^ Multiply(d, 0x0d); + (*state)[i][2] = Multiply(a, 0x0d) ^ Multiply(b, 0x09) ^ Multiply(c, 0x0e) ^ Multiply(d, 0x0b); + (*state)[i][3] = Multiply(a, 0x0b) ^ Multiply(b, 0x0d) ^ Multiply(c, 0x09) ^ Multiply(d, 0x0e); + } +} + +// The SubBytes Function Substitutes the values in the +// state matrix with values in an S-box. +TORCH_CSPRNG_HOST_DEVICE void InvSubBytes(state_t* state) +{ + uint8_t i, j; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + (*state)[j][i] = getSBoxInvert((*state)[j][i]); + } + } +} + +TORCH_CSPRNG_HOST_DEVICE void InvShiftRows(state_t* state) +{ + uint8_t temp; + + // Rotate first row 1 columns to right + temp = (*state)[3][1]; + (*state)[3][1] = (*state)[2][1]; + (*state)[2][1] = (*state)[1][1]; + (*state)[1][1] = (*state)[0][1]; + (*state)[0][1] = temp; + + // Rotate second row 2 columns to right + temp = (*state)[0][2]; + (*state)[0][2] = (*state)[2][2]; + (*state)[2][2] = temp; + + temp = (*state)[1][2]; + (*state)[1][2] = (*state)[3][2]; + (*state)[3][2] = temp; + + // Rotate third row 3 columns to right + temp = (*state)[0][3]; + (*state)[0][3] = (*state)[1][3]; + (*state)[1][3] = (*state)[2][3]; + (*state)[2][3] = (*state)[3][3]; + (*state)[3][3] = temp; +} + TORCH_CSPRNG_HOST_DEVICE void encrypt(uint8_t* state, const uint8_t* key) { uint8_t RoundKey[176]; KeyExpansion(RoundKey, key); @@ -284,4 +368,29 @@ TORCH_CSPRNG_HOST_DEVICE void encrypt(uint8_t* state, const uint8_t* key) { AddRoundKey(Nr, (state_t*)state, RoundKey); } +TORCH_CSPRNG_HOST_DEVICE void decrypt(uint8_t* state, const uint8_t* key) { + uint8_t RoundKey[176]; + KeyExpansion(RoundKey, key); + + uint8_t round = 0; + + // Add the First round key to the state before starting the rounds. + AddRoundKey(Nr, (state_t*)state, RoundKey); + + // There will be Nr rounds. + // The first Nr-1 rounds are identical. + // These Nr rounds are executed in the loop below. + // Last one without InvMixColumn() + for (round = (Nr - 1); ; --round) + { + InvShiftRows((state_t*)state); + InvSubBytes((state_t*)state); + AddRoundKey(round, (state_t*)state, RoundKey); + if (round == 0) { + break; + } + InvMixColumns((state_t*)state); + } +} + }}} diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index 2ca313f..8418e3d 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -30,144 +30,173 @@ namespace torch { namespace csprng { -// Generates `block_t_size`-bytes random key Tensor on CPU -// using `generator`, which must be an instance of `at::CPUGeneratorImpl` -// and passes it to the `device`. -template -at::Tensor key_tensor(size_t block_t_size, c10::optional generator) { - std::lock_guard lock(generator->mutex()); - auto gen = at::check_generator(generator); - if (gen->key().defined()) { - return gen->key().clone(); - } - auto t = torch::empty({static_cast(block_t_size)}, torch::kUInt8); - using random_t = uint32_t; - constexpr size_t random_t_size = sizeof(random_t); - for (size_t i = 0; i < block_t_size / random_t_size; i++) { - const auto rand = gen->random(); - for (size_t j = 0; j < random_t_size; j++) { - size_t k = i * random_t_size + j; - t[k] = static_cast((rand >> (j * 8)) & 0xff); +template +TORCH_CSPRNG_HOST_DEVICE static void copy_input_to_block(int64_t idx, uint8_t* block, int block_size, + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc) { + for (auto i = 0; i < block_size / input_type_size; ++i) { + const auto linear_index = idx * (block_size / input_type_size) + i; + if (linear_index < input_numel) { + std::memcpy( + block + i * input_type_size, + &(reinterpret_cast(input_ptr)[input_index_calc(linear_index)]), + input_type_size + ); } } - return t; } -// A simple container for random state sub-blocks that implements RNG interface -// with random() and random64() methods, that are used by transformation function -template -struct RNGValues { - TORCH_CSPRNG_HOST_DEVICE RNGValues(uint64_t* vals) { - memcpy(&vals_, vals, size * sizeof(uint64_t)); - } - uint32_t TORCH_CSPRNG_HOST_DEVICE random() { auto res = static_cast(vals_[index]); index++; return res; } - uint64_t TORCH_CSPRNG_HOST_DEVICE random64() { auto res = vals_[index]; index++; return res; } -private: - uint64_t vals_[size]; - int index = 0; -}; - -// Runs a block cipher in a counter mode in approximately `numel / (block_t_size / sizeof(uint_t) / N)` CUDA threads, -// without any assumption about target tensor layout. It uses `index_calc` to find memory locations of -// the tensor elements. -// `scalar_t` is a scalar type equivalent of target tensor dtype -// `uint_t` is an unsigned integral type of sub-blocks that random state is divided to -// (e.g, 16 bytes random state block can be divided into 16 uint8_t sub-blocks -// or 8 uint16_t sub-block or 4 uint32_t sub-block or 2 uint64_t sub-blocks) -// `N` is a number of sub-block which is used by `transform_func` -// to generate a random value of specific distribution (e.g. `normal` uses 2) -// `numel` is a number of elements in target tensor -// `block_t_size` is a number of bytes in cipher's block (e.g. 16 for AES128) -// `cipher` is a callable that receives a counter `idx` and returns an encrypted block -// `transform_func` is a callable that converts N `uint_t` random state sub-blocks passed in RNGValues into target dtype `scalar_t` -template -TORCH_CSPRNG_HOST_DEVICE static void block_cipher_kernel_helper(int idx, scalar_t* data, int64_t numel, size_t block_t_size, cipher_t cipher, transform_t transform_func, index_calc_t index_calc) { - const int unroll_factor = block_t_size / sizeof(uint_t) / N; - if (unroll_factor * idx < numel) { - auto block = cipher(idx); - UNROLL_IF_CUDA - for (auto i = 0; i < unroll_factor; ++i) { - const auto li = unroll_factor * idx + i; - if (li < numel) { - uint64_t vals[N]; - UNROLL_IF_CUDA - for (size_t j = 0; j < N; j++) { - vals[j] = (reinterpret_cast(&block))[N * i + j]; - } - RNGValues rng(vals); - data[index_calc(li)] = transform_func(&rng); - } +template +TORCH_CSPRNG_HOST_DEVICE static void copy_block_to_output(int64_t idx, uint8_t* block, int output_elem_per_block, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc) { + for (auto i = 0; i < output_elem_per_block; ++i) { + const auto linear_index = idx * output_elem_per_block + i; + if (linear_index < output_numel) { + std::memcpy( + &(reinterpret_cast(output_ptr)[output_index_calc(linear_index)]), + block + i * output_type_size, + output_type_size + ); } } } +template +TORCH_CSPRNG_HOST_DEVICE static void block_cipher_kernel_helper( + int64_t idx, cipher_t cipher, int output_elem_per_block, + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc, + transform_t transform) { + uint8_t block[block_size]; + std::memset(&block, 0, block_size); // is it ok to use zeros as padding? + if (input_ptr != nullptr) { + copy_input_to_block(idx, block, block_size, input_ptr, input_numel, input_type_size, input_index_calc); + } + cipher(idx, block); + transform(block); + copy_block_to_output(idx, block, output_elem_per_block, output_ptr, output_numel, output_type_size, output_index_calc); +} + #if defined(__CUDACC__) || defined(__HIPCC__) -template -__global__ static void block_cipher_kernel_cuda(scalar_t* data, int64_t numel, int block_t_size, cipher_t cipher, transform_t transform_func, index_calc_t index_calc) { +template +__global__ static void block_cipher_kernel_cuda(cipher_t cipher, int output_elem_per_block, + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc, + transform_t transform) { const auto idx = blockIdx.x * blockDim.x + threadIdx.x; - block_cipher_kernel_helper(idx, data, numel, block_t_size, cipher, transform_func, index_calc); + block_cipher_kernel_helper(idx, cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform); } #endif -template -static void block_cipher_kernel_cpu_serial(int64_t begin, int64_t end, scalar_t* data, int64_t numel, int block_t_size, cipher_t cipher, transform_t transform_func, index_calc_t index_calc) { +template +static void block_cipher_kernel_cpu_serial(int64_t begin, int64_t end, cipher_t cipher, int output_elem_per_block, + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc, + transform_t transform) { for (auto idx = begin; idx < end; ++idx) { - block_cipher_kernel_helper(idx, data, numel, block_t_size, cipher, transform_func, index_calc); + block_cipher_kernel_helper(idx, cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform); } } -template -static void block_cipher_kernel_cpu(int64_t total, scalar_t* data, int64_t numel, int block_t_size, cipher_t cipher, transform_t transform_func, index_calc_t index_calc) { +template +static void block_cipher_kernel_cpu(int64_t total, cipher_t cipher, int output_elem_per_block, + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc, + transform_t transform_func) { if (total < at::internal::GRAIN_SIZE || at::get_num_threads() == 1) { - block_cipher_kernel_cpu_serial(0, total, data, numel, block_t_size, cipher, transform_func, index_calc); + block_cipher_kernel_cpu_serial(0, total, cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform_func); } else { at::parallel_for(0, total, at::internal::GRAIN_SIZE, [&](int64_t begin, int64_t end) { - block_cipher_kernel_cpu_serial(begin, end, data, numel, block_t_size, cipher, transform_func, index_calc); + block_cipher_kernel_cpu_serial(begin, end, cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform_func); }); } } -// Runs a block cipher in a counter mode in approximately `numel / (block_t_size / sizeof(uint_t) / N)` CUDA threads. -// Each CUDA thread generates `block_t_size`-bytes random state and divides it into `block_t_size / sizeof(uint_t)` sub-blocks. -// Then `transform_func` transforms `N` random state sub-blocks passed in a `RNGValues` to final random values of type `scalar_t`. -template -void block_cipher_ctr_mode(at::TensorIterator& iter, int block_t_size, cipher_t cipher, transform_t transform_func) { - const auto numel = iter.numel(); - if (numel == 0) { +template +void block_cipher( + void* input_ptr, int64_t input_numel, int input_type_size, input_index_calc_t input_index_calc, + void* output_ptr, int64_t output_numel, int output_type_size, output_index_calc_t output_index_calc, + Device device, cipher_t cipher, int output_elem_per_block, transform_t transform_func) { + if (output_ptr == nullptr || output_numel == 0) { return; } - const int unroll_factor = block_t_size / sizeof(uint_t) / N; - const auto block = 256; - const auto grid = (numel + (block * unroll_factor) - 1) / (block * unroll_factor); - scalar_t* data = (scalar_t*)iter.data_ptr(0); - auto offset_calc = make_offset_calculator<1>(iter); - auto index_calc_identity = [] TORCH_CSPRNG_HOST_DEVICE (int li) -> int { return li; }; - auto index_calc_offset = [offset_calc] TORCH_CSPRNG_HOST_DEVICE (int li) -> int { return offset_calc.get(li)[0] / sizeof(scalar_t); }; - if (iter.device_type() == at::kCPU) { - if (iter.output(0).is_contiguous()) { - block_cipher_kernel_cpu( - grid * block, data, numel, block_t_size, cipher, transform_func, index_calc_identity); - } else { - block_cipher_kernel_cpu( - grid * block, data, numel, block_t_size, cipher, transform_func, index_calc_offset); - } - } else if (iter.device_type() == at::kCUDA) { + + if (device.type() == at::kCPU) { + const auto total = (output_numel + output_elem_per_block - 1) / output_elem_per_block; + block_cipher_kernel_cpu(total, + cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform_func + ); + } else if (device.type() == at::kCUDA) { #if defined(__CUDACC__) || defined(__HIPCC__) + const auto threads = 256; + const auto grid = (output_numel + (threads * output_elem_per_block) - 1) / (threads * output_elem_per_block); auto stream = at::cuda::getCurrentCUDAStream(); - if (iter.output(0).is_contiguous()) { - block_cipher_kernel_cuda<<>>( - data, numel, block_t_size, cipher, transform_func, index_calc_identity); - } else { - block_cipher_kernel_cuda<<>>( - data, numel, block_t_size, cipher, transform_func, index_calc_offset); - } + block_cipher_kernel_cuda<<>>( + cipher, output_elem_per_block, + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + transform_func + ); AT_CUDA_CHECK(cudaGetLastError()); #else - TORCH_CHECK(false, "csprng was compiled without CUDA support"); + TORCH_CHECK(false, "torchcsprng was compiled without CUDA support"); #endif } else { - TORCH_CHECK(false, "block_cipher_ctr_mode supports only CPU and CUDA devices"); + TORCH_CHECK(false, "block_cipher supports only CPU and CUDA devices"); } } +template +void block_cipher(Tensor input, Tensor output, cipher_t cipher) { + const auto input_ptr = input.data_ptr(); + const auto input_numel = input.numel(); + + // Otherwise OffsetCalculator/IntDivider crashes with integer division by zero + if (input_ptr == nullptr || input_numel == 0) { + return; + } + + const auto input_type_size = input.element_size(); + const auto input_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(input)); + const auto input_index_calc = [input_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { + return input_offset_calc.get(li)[0]; + }; + + const auto output_ptr = output.data_ptr(); + const auto output_numel = output.numel(); + + // Otherwise OffsetCalculator/IntDivider crashes with integer division by zero + if (output_ptr == nullptr || output_numel == 0) { + return; + } + + const auto output_type_size = output.element_size(); + const auto output_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(output)); + const auto output_index_calc = [output_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { + return output_offset_calc.get(li)[0]; + }; + + const auto device = output.device(); + + block_cipher( + input_ptr, input_numel, input_type_size, input_index_calc, + output_ptr, output_numel, output_type_size, output_index_calc, + device, cipher, block_size / output_type_size, + [] TORCH_CSPRNG_HOST_DEVICE (uint8_t* x) {}); +} + }} diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/csprng.h index f1fa0f9..cf31c10 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/csprng.h @@ -57,6 +57,29 @@ struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { Tensor key_; }; +// Generates `block_t_size`-bytes random key Tensor on CPU +// using `generator`, which must be an instance of `at::CPUGeneratorImpl` +// and passes it to the `device`. +template +at::Tensor key_tensor(size_t block_t_size, c10::optional generator) { + std::lock_guard lock(generator->mutex()); + auto gen = at::check_generator(generator); + if (gen->key().defined()) { + return gen->key().clone(); + } + auto key = torch::empty({static_cast(block_t_size)}, torch::kUInt8); + using random_t = typename std::result_of::type; + constexpr size_t random_t_size = sizeof(random_t); + for (size_t i = 0; i < block_t_size / random_t_size; i++) { + const auto rand = gen->random(); + for (size_t j = 0; j < random_t_size; j++) { + size_t k = i * random_t_size + j; + key[k] = static_cast((rand >> (j * 8)) & 0xff); + } + } + return key; +} + template Tensor aes128_key_tensor(Generator generator) { return key_tensor(aes::block_t_size, generator); @@ -64,6 +87,20 @@ Tensor aes128_key_tensor(Generator generator) { // ==================================================================================================================== +// A simple container for random state sub-blocks that implements RNG interface +// with random() and random64() methods, that are used by transformation function +template +struct RNGValues { + TORCH_CSPRNG_HOST_DEVICE RNGValues(uint64_t* vals) { + memcpy(&vals_, vals, size * sizeof(uint64_t)); + } + uint32_t TORCH_CSPRNG_HOST_DEVICE random() { auto res = static_cast(vals_[index]); index++; return res; } + uint64_t TORCH_CSPRNG_HOST_DEVICE random64() { auto res = vals_[index]; index++; return res; } +private: + uint64_t vals_[size]; + int index = 0; +}; + // Applies AES in CTR mode with the `key` for passed TensorIterator iter. // `scalar_t` is a scalar type equivalent of target tensor dtype // `uint_t` is an unsigned integral type of sub-blocks that random state is divided to @@ -74,16 +111,37 @@ Tensor aes128_key_tensor(Generator generator) { // `key` is a CUDA pointer to random key memory block // `transform_func` is a callable that converts N `uint_t` random state sub-blocks passed in RNGValues into target dtype `scalar_t` template -void aes_helper(TensorIterator& iter, const uint8_t* key, transform_t transform_func) { - block_cipher_ctr_mode(iter, aes::block_t_size, - [key] TORCH_CSPRNG_HOST_DEVICE (unsigned int idx) -> aes::block_t { - aes::block_t block; - memset(&block, 0, aes::block_t_size); - block.x = idx; - aes::encrypt(reinterpret_cast(&block), key); - return block; +void aes_helper(TensorIterator& iter, const uint8_t* key_bytes, transform_t transform_func) { + auto output = iter.tensor(0); + const auto output_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(output)); + const auto output_index_calc = [output_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { + return output_offset_calc.get(li)[0]; + }; + block_cipher( + nullptr, 0, 0, output_index_calc, + output.data_ptr(), output.numel(), output.element_size(), output_index_calc, + iter.device_type(), + [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { + uint8_t idx_block[aes::block_t_size]; + std::memset(&idx_block, 0, aes::block_t_size); + *(reinterpret_cast(idx_block)) = idx; + aes::encrypt(idx_block, key_bytes); + for (size_t i = 0; i < aes::block_t_size; i++) { + block[i] ^= idx_block[i]; + } }, - transform_func + aes::block_t_size / (N * sizeof(uint_t)), + [transform_func] TORCH_CSPRNG_HOST_DEVICE (uint8_t* block) { + const auto n = aes::block_t_size / (N * sizeof(uint_t)); + for (size_t i = 0; i < n; ++i) { + uint64_t vals[N]; + for (size_t j = 0; j < N; ++j) { + vals[j] = (reinterpret_cast(block))[N * i + j]; + } + RNGValues rng(vals); + reinterpret_cast(block)[i] = transform_func(&rng); + } + } ); } @@ -151,7 +209,7 @@ struct RandomFromToKernel { std::is_same::value || std::is_same::value || std::is_same::value || - std::is_same::value) && range >= 1ULL << 32) + std::is_same::value)/* TODO: && range >= 1ULL << 32*/) { random_from_to_kernel_helper(iter, range, base, key); } else { @@ -416,6 +474,89 @@ Tensor& randperm_generator_out(Tensor& result, int64_t n, c10::optional(input, output, + [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { + aes::encrypt(block, key_bytes); + } + ); +} + +void aes_ecb_decrypt(Tensor input, Tensor output, uint8_t* key_bytes) { + block_cipher(input, output, + [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { + aes::decrypt(block, key_bytes); + } + ); +} + +void aes_ctr_encrypt(Tensor input, Tensor output, uint8_t* key_bytes) { + block_cipher(input, output, + [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { + uint8_t idx_block[aes::block_t_size]; + std::memset(&idx_block, 0, aes::block_t_size); + *(reinterpret_cast(idx_block)) = idx; + aes::encrypt(idx_block, key_bytes); + for (size_t i = 0; i < aes::block_t_size; i++) { + block[i] ^= idx_block[i]; + } + } + ); +} + +void aes_ctr_decrypt(Tensor input, Tensor output, uint8_t* key_bytes) { + aes_ctr_encrypt(input, output, key_bytes); +} + +Tensor encrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { + TORCH_CHECK(input.device() == output.device() && input.device() == key.device(), "input, output and key tensors must have the same device"); + const auto output_size_bytes = output.numel() * output.itemsize(); + const auto input_size_bytes = input.numel() * input.itemsize(); + const auto input_size_bytes_rounded = (input_size_bytes + aes::block_t_size - 1) / aes::block_t_size * aes::block_t_size; + TORCH_CHECK(output_size_bytes == input_size_bytes_rounded, + "output size in bytes(", output_size_bytes, + ") is not equal to input size in bytes rounded to block size(", + input_size_bytes_rounded, ")"); + check_cipher(cipher, key); + const auto key_bytes = reinterpret_cast(key.contiguous().data_ptr()); + if (mode == "ecb") { + aes_ecb_encrypt(input, output, key_bytes); + } else if (mode == "ctr") { + aes_ctr_encrypt(input, output, key_bytes); + } else { + TORCH_CHECK(false, "encrypt/decrypt supports \"ecb\" and \"ctr\" modes, \"", mode, "\" is not supported."); + } + return output; +} + +Tensor decrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { + TORCH_CHECK(input.device() == output.device() && input.device() == key.device(), "input, output and key tensors must have the same device"); + const auto output_size_bytes = output.numel() * output.itemsize(); + const auto input_size_bytes = input.numel() * input.itemsize(); + TORCH_CHECK(output_size_bytes == input_size_bytes, "input and output tensors must have the same size in byte"); + TORCH_CHECK(input_size_bytes % aes::block_t_size == 0, "input tensor size in bytes must divisible by cipher block size in bytes"); + check_cipher(cipher, key); + const auto key_bytes = reinterpret_cast(key.contiguous().data_ptr()); + if (mode == "ecb") { + aes_ecb_decrypt(input, output, key_bytes); + } else if (mode == "ctr") { + aes_ctr_decrypt(input, output, key_bytes); + } else { + TORCH_CHECK(false, "encrypt/decrypt supports \"ecb\" and \"ctr\" modes, \"", mode, "\" is not supported."); + } + return output; +} + +// ==================================================================================================================== + Generator create_random_device_generator(c10::optional token = c10::nullopt) { if (token.has_value()) { return make_generator(*token); @@ -481,4 +622,6 @@ PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("create_mt19937_generator", &create_mt19937_generator, py::arg("seed") = nullptr); m.def("aes128_key_tensor", &aes128_key_tensor_pybind); m.def("create_const_generator", &create_const_generator); + m.def("encrypt", &encrypt_pybind); + m.def("decrypt", &decrypt_pybind); } From 872f18f2bf612d9748cf9e453a36bf57faf4533a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 2 Dec 2020 04:30:37 -0800 Subject: [PATCH 131/750] 2020-12-02 nightly release (18241ced6792a2023a40ec872273d0b3c1ab2b1d) From e26e5c6161017fd013d8f9c567670c2774882aee Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 3 Dec 2020 04:30:40 -0800 Subject: [PATCH 132/750] 2020-12-03 nightly release (d68df3cd6f6dd496112e07a67dcdf71334db2b02) --- .circleci/config.yml | 4 +++- .circleci/unittest/linux/scripts/environment.yml | 3 +-- .circleci/unittest/windows/scripts/environment.yml | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b2ddd96..f972367 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -283,6 +283,7 @@ jobs: resource_class: gpu.small environment: image_name: "pytorch/manylinux-cuda101" + PYTHON_VERSION: << parameters.python_version >> steps: - checkout - run: @@ -296,7 +297,7 @@ jobs: - run: name: Setup - command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/setup_env.sh + command: docker run -e PYTHON_VERSION -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/setup_env.sh - save_cache: key: env-v2-linux-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} @@ -359,6 +360,7 @@ jobs: name: windows-gpu environment: CUDA_VERSION: "10.1" + PYTHON_VERSION: << parameters.python_version >> steps: - checkout - run: diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index 7310ae6..688cc59 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -1,4 +1,5 @@ channels: + - pytorch - defaults dependencies: - numpy @@ -9,6 +10,4 @@ dependencies: - ca-certificates - pip: - future - - pillow>=4.1.1 - scipy - - av diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index 52593ad..688cc59 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -1,4 +1,5 @@ channels: + - pytorch - defaults dependencies: - numpy @@ -9,6 +10,4 @@ dependencies: - ca-certificates - pip: - future - - pillow>=4.1.1 - - scipy==1.4.1 - - av + - scipy From d79340baca4a94dfd9364b0b30894d6a22816bcf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 4 Dec 2020 04:30:35 -0800 Subject: [PATCH 133/750] 2020-12-04 nightly release (d68df3cd6f6dd496112e07a67dcdf71334db2b02) From 915ba3306e1efd23df21e2b2361b771c4d1dfcf9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 5 Dec 2020 04:30:32 -0800 Subject: [PATCH 134/750] 2020-12-05 nightly release (d68df3cd6f6dd496112e07a67dcdf71334db2b02) From 39d343801dde31cd56c1c7b4e438af0d97dfadc4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 6 Dec 2020 04:30:35 -0800 Subject: [PATCH 135/750] 2020-12-06 nightly release (d68df3cd6f6dd496112e07a67dcdf71334db2b02) From e92f5e3c4940c5080fd0c16f2dad1fbe3666988e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 7 Dec 2020 04:30:33 -0800 Subject: [PATCH 136/750] 2020-12-07 nightly release (d68df3cd6f6dd496112e07a67dcdf71334db2b02) From 96c956d62de4b149b808b25c1024b206a4386763 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 8 Dec 2020 04:30:36 -0800 Subject: [PATCH 137/750] 2020-12-08 nightly release (e62ea331c58179fc5ab2e22931421df4913b27d8) --- .circleci/config.yml | 1101 +++++++---------- packaging/build_wheel.sh | 36 + packaging/conda/build_csprng.sh | 6 +- packaging/pkg_helpers.bash | 56 +- packaging/torchcsprng/conda_build_config.yaml | 4 + packaging/wheel/relocate.py | 417 +++++++ packaging/windows/internal/cuda_install.bat | 6 +- .../windows/internal/nightly_defaults.bat | 2 +- .../windows/internal/vc_install_helper.sh | 0 setup.py | 47 +- test/test_csprng.py | 31 +- torchcsprng/__init__.py | 1 - torchcsprng/__init__.pyi | 17 + torchcsprng/csrc/{aes.h => aes.inc} | 9 +- torchcsprng/csrc/block_cipher.h | 10 +- .../csrc/{csprng.cu => cpu/kernels.cpp} | 10 +- torchcsprng/csrc/cpu/kernels.h | 20 + torchcsprng/csrc/csprng.cpp | 371 +++++- torchcsprng/csrc/cuda/kernels.cu | 17 + torchcsprng/csrc/cuda/kernels.cuh | 20 + .../csrc/{csprng.h => kernels_body.inc} | 318 +---- torchcsprng/csrc/kernels_commons.h | 43 + torchcsprng/csrc/kernels_decls.inc | 57 + 23 files changed, 1630 insertions(+), 969 deletions(-) create mode 100644 packaging/wheel/relocate.py mode change 100755 => 100644 packaging/windows/internal/vc_install_helper.sh create mode 100644 torchcsprng/__init__.pyi rename torchcsprng/csrc/{aes.h => aes.inc} (99%) rename torchcsprng/csrc/{csprng.cu => cpu/kernels.cpp} (64%) create mode 100644 torchcsprng/csrc/cpu/kernels.h create mode 100644 torchcsprng/csrc/cuda/kernels.cu create mode 100644 torchcsprng/csrc/cuda/kernels.cuh rename torchcsprng/csrc/{csprng.h => kernels_body.inc} (54%) create mode 100644 torchcsprng/csrc/kernels_commons.h create mode 100644 torchcsprng/csrc/kernels_decls.inc diff --git a/.circleci/config.yml b/.circleci/config.yml index f972367..2d96046 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -497,42 +497,33 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_wheel_py3.6_cpu python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu92 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu101 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu102 -# python_version: '3.6' -# - binary_win_wheel: -# cu_version: cu110 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.6_cu110 -# python_version: '3.6' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu101 + python_version: '3.6' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu102 + python_version: '3.6' + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.6_cu110 + python_version: '3.6' - binary_win_wheel: cu_version: cpu filters: @@ -542,77 +533,59 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_wheel_py3.7_cpu python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu92 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu101 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu102 -# python_version: '3.7' -# - binary_win_wheel: -# cu_version: cu110 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.7_cu110 -# python_version: '3.7' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu101 + python_version: '3.7' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu102 + python_version: '3.7' + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.7_cu110 + python_version: '3.7' - binary_win_wheel: cu_version: cpu name: binary_win_wheel_py3.8_cpu python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.8_cu92 -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.8_cu101 -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_wheel_py3.8_cu102 -# python_version: '3.8' -# - binary_win_wheel: -# cu_version: cu110 -# name: binary_win_wheel_py3.8_cu110 -# python_version: '3.8' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.8_cu101 + python_version: '3.8' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.8_cu102 + python_version: '3.8' + - binary_win_wheel: + cu_version: cu110 + name: binary_win_wheel_py3.8_cu110 + python_version: '3.8' - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.6_cpu @@ -712,42 +685,33 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_conda_py3.6_cpu python_version: '3.6' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu92 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu101 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu102 -# python_version: '3.6' -# - binary_win_conda: -# cu_version: cu110 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.6_cu110 -# python_version: '3.6' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu101 + python_version: '3.6' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu102 + python_version: '3.6' + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.6_cu110 + python_version: '3.6' - binary_win_conda: cu_version: cpu filters: @@ -757,77 +721,59 @@ workflows: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ name: binary_win_conda_py3.7_cpu python_version: '3.7' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu92 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu101 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu102 -# python_version: '3.7' -# - binary_win_conda: -# cu_version: cu110 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.7_cu110 -# python_version: '3.7' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu101 + python_version: '3.7' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu102 + python_version: '3.7' + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.7_cu110 + python_version: '3.7' - binary_win_conda: cu_version: cpu name: binary_win_conda_py3.8_cpu python_version: '3.8' -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.8_cu92 -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.8_cu101 -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: master -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: binary_win_conda_py3.8_cu102 -# python_version: '3.8' -# - binary_win_conda: -# cu_version: cu110 -# name: binary_win_conda_py3.8_cu110 -# python_version: '3.8' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.8_cu101 + python_version: '3.8' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.8_cu102 + python_version: '3.8' + - binary_win_conda: + cu_version: cu110 + name: binary_win_conda_py3.8_cu110 + python_version: '3.8' # - python_lint # - python_type_check # - clang_format @@ -880,28 +826,28 @@ workflows: cu_version: cpu name: unittest_windows_cpu_py3.8 python_version: '3.8' -# - unittest_windows_gpu: -# cu_version: cu101 -# filters: -# branches: -# only: -# - master -# - nightly -# name: unittest_windows_gpu_py3.6 -# python_version: '3.6' -# - unittest_windows_gpu: -# cu_version: cu101 -# filters: -# branches: -# only: -# - master -# - nightly -# name: unittest_windows_gpu_py3.7 -# python_version: '3.7' -# - unittest_windows_gpu: -# cu_version: cu101 -# name: unittest_windows_gpu_py3.8 -# python_version: '3.8' + - unittest_windows_gpu: + cu_version: cu101 + filters: + branches: + only: + - master + - nightly + name: unittest_windows_gpu_py3.6 + python_version: '3.6' + - unittest_windows_gpu: + cu_version: cu101 + filters: + branches: + only: + - master + - nightly + name: unittest_windows_gpu_py3.7 + python_version: '3.7' + - unittest_windows_gpu: + cu_version: cu101 + name: unittest_windows_gpu_py3.8 + python_version: '3.8' nightly: jobs: # - circleci_consistency @@ -1306,66 +1252,46 @@ workflows: requires: - nightly_binary_win_wheel_py3.6_cpu subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu92 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu101 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu102 -# python_version: '3.6' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.6_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.6_cu102 -# subfolder: cu102/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu101 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu101_upload + requires: + - nightly_binary_win_wheel_py3.6_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu102 + python_version: '3.6' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.6_cu102_upload + requires: + - nightly_binary_win_wheel_py3.6_cu102 + subfolder: cu102/ - binary_win_wheel: cu_version: cu110 filters: @@ -1406,66 +1332,46 @@ workflows: requires: - nightly_binary_win_wheel_py3.7_cpu subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu92 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu101 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu102 -# python_version: '3.7' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.7_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.7_cu102 -# subfolder: cu102/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu101 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu101_upload + requires: + - nightly_binary_win_wheel_py3.7_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu102 + python_version: '3.7' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.7_cu102_upload + requires: + - nightly_binary_win_wheel_py3.7_cu102 + subfolder: cu102/ - binary_win_wheel: cu_version: cu110 filters: @@ -1506,66 +1412,46 @@ workflows: requires: - nightly_binary_win_wheel_py3.8_cpu subfolder: cpu/ -# - binary_win_wheel: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu92 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu92_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu92 -# subfolder: cu92/ -# - binary_win_wheel: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu101 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu101_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu101 -# subfolder: cu101/ -# - binary_win_wheel: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu102 -# python_version: '3.8' -# - binary_wheel_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_wheel_py3.8_cu102_upload -# requires: -# - nightly_binary_win_wheel_py3.8_cu102 -# subfolder: cu102/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu101 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu101_upload + requires: + - nightly_binary_win_wheel_py3.8_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu102 + python_version: '3.8' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.8_cu102_upload + requires: + - nightly_binary_win_wheel_py3.8_cu102 + subfolder: cu102/ - binary_win_wheel: cu_version: cu110 filters: @@ -1965,82 +1851,63 @@ workflows: name: nightly_binary_win_conda_py3.6_cpu_upload requires: - nightly_binary_win_conda_py3.6_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu92 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu101 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu102 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu102 -# - binary_win_conda: -# cu_version: cu110 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu110 -# python_version: '3.6' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.6_cu110_upload -# requires: -# - nightly_binary_win_conda_py3.6_cu110 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu101 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu101_upload + requires: + - nightly_binary_win_conda_py3.6_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu102 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu102_upload + requires: + - nightly_binary_win_conda_py3.6_cu102 + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu110 + python_version: '3.6' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.6_cu110_upload + requires: + - nightly_binary_win_conda_py3.6_cu110 - binary_win_conda: cu_version: cpu filters: @@ -2060,82 +1927,63 @@ workflows: name: nightly_binary_win_conda_py3.7_cpu_upload requires: - nightly_binary_win_conda_py3.7_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu92 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu101 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu102 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu102 -# - binary_win_conda: -# cu_version: cu110 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu110 -# python_version: '3.7' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.7_cu110_upload -# requires: -# - nightly_binary_win_conda_py3.7_cu110 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu101 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu101_upload + requires: + - nightly_binary_win_conda_py3.7_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu102 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu102_upload + requires: + - nightly_binary_win_conda_py3.7_cu102 + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu110 + python_version: '3.7' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.7_cu110_upload + requires: + - nightly_binary_win_conda_py3.7_cu110 - binary_win_conda: cu_version: cpu filters: @@ -2155,79 +2003,60 @@ workflows: name: nightly_binary_win_conda_py3.8_cpu_upload requires: - nightly_binary_win_conda_py3.8_cpu -# - binary_win_conda: -# cu_version: cu92 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu92 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu92_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu92 -# - binary_win_conda: -# cu_version: cu101 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu101 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu101_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu101 -# - binary_win_conda: -# cu_version: cu102 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu102 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu102_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu102 -# - binary_win_conda: -# cu_version: cu110 -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu110 -# python_version: '3.8' -# - binary_conda_upload: -# context: org-member -# filters: -# branches: -# only: nightly -# tags: -# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ -# name: nightly_binary_win_conda_py3.8_cu110_upload -# requires: -# - nightly_binary_win_conda_py3.8_cu110 + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu101 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu101_upload + requires: + - nightly_binary_win_conda_py3.8_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu102 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu102_upload + requires: + - nightly_binary_win_conda_py3.8_cu102 + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu110 + python_version: '3.8' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.8_cu110_upload + requires: + - nightly_binary_win_conda_py3.8_cu110 diff --git a/packaging/build_wheel.sh b/packaging/build_wheel.sh index bd3b0c7..15b85a4 100755 --- a/packaging/build_wheel.sh +++ b/packaging/build_wheel.sh @@ -11,8 +11,44 @@ pip_install numpy pyyaml future ninja setup_pip_pytorch_version python setup.py clean +# Copy binaries to be included in the wheel distribution +if [[ "$(uname)" == Darwin || "$OSTYPE" == "msys" ]]; then + python_exec="$(which python)" + bin_path=$(dirname $python_exec) + env_path=$(dirname $bin_path) + if [[ "$(uname)" == Darwin ]]; then + # Install delocate to relocate the required binaries + pip_install delocate + fi +else + # Install auditwheel to get some inspection utilities + pip_install auditwheel + + # Point to custom libraries + export LD_LIBRARY_PATH=$(pwd)/ext_libraries/lib:$LD_LIBRARY_PATH + export TORCHCSPRNG_INCLUDE=$(pwd)/ext_libraries/include + export TORCHCSPRNG_LIBRARY=$(pwd)/ext_libraries/lib +fi + if [[ "$OSTYPE" == "msys" ]]; then IS_WHEEL=1 "$script_dir/windows/internal/vc_env_helper.bat" python setup.py bdist_wheel else IS_WHEEL=1 python setup.py bdist_wheel fi + + +if [[ "$(uname)" == Darwin ]]; then + pushd dist/ + python_exec="$(which python)" + bin_path=$(dirname $python_exec) + env_path=$(dirname $bin_path) + for whl in *.whl; do + DYLD_LIBRARY_PATH="$env_path/lib/:$DYLD_LIBRARY_PATH" delocate-wheel -v $whl + done +else + if [[ "$OSTYPE" == "msys" ]]; then + "$script_dir/windows/internal/vc_env_helper.bat" python $script_dir/wheel/relocate.py + else + LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" python $script_dir/wheel/relocate.py + fi +fi diff --git a/packaging/conda/build_csprng.sh b/packaging/conda/build_csprng.sh index 56c3037..44fc0af 100755 --- a/packaging/conda/build_csprng.sh +++ b/packaging/conda/build_csprng.sh @@ -127,7 +127,7 @@ else fi if [[ -z "$PYTORCH_VERSION" ]]; then - export CONDA_CHANNEL_FLAGS="-c pytorch-nightly" + export CONDA_CHANNEL_FLAGS="-c pytorch-nightly -c pytorch" export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | \ python -c "import os, sys, json, re; cuver = '$cuver'; \ cuver = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \ @@ -164,9 +164,9 @@ for py_ver in "${DESIRED_PYTHON[@]}"; do mkdir "$output_folder" if [[ "$py_ver" == 3.5 ]]; then - export CONDA_TYPING_CONSTRAINT="- typing" + export CONDA_TYPING_CONSTRAINT="- typing" else - export CONDA_TYPING_CONSTRAINT="" + export CONDA_TYPING_CONSTRAINT="" fi export VSTOOLCHAIN_PACKAGE=vs2017 diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index f5de815..06da1cc 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -132,7 +132,7 @@ setup_build_version() { # Set build version based on tag if on tag if [[ -n "${CIRCLE_TAG}" ]]; then # Strip tag - export BUILD_VERSION="$(echo "${CIRCLE_TAG}" | sed -e 's/^v//' -e 's/-.*$//')" + export BUILD_VERSION="$(echo "${CIRCLE_TAG}" | sed -e 's/^v//' -e 's/-.*$//')${VERSION_SUFFIX}" fi } @@ -181,11 +181,7 @@ setup_wheel_python() { conda env remove -n "env$PYTHON_VERSION" || true conda create -yn "env$PYTHON_VERSION" python="$PYTHON_VERSION" conda activate "env$PYTHON_VERSION" - # Install libpng from Anaconda (defaults) - conda install libpng jpeg -y else - # Install native CentOS libPNG - yum install -y libpng-devel libjpeg-turbo-devel case "$PYTHON_VERSION" in 2.7) if [[ -n "$UNICODE_ABI" ]]; then @@ -203,7 +199,13 @@ setup_wheel_python() { exit 1 ;; esac - export PATH="/opt/python/$python_abi/bin:$PATH" + # Download all the dependencies required to compile image and video_reader + # extensions + + mkdir -p ext_libraries + pushd ext_libraries + popd + export PATH="/opt/python/$python_abi/bin:$(pwd)/ext_libraries/bin:$PATH" fi } @@ -228,9 +230,8 @@ setup_pip_pytorch_version() { fi else pip_install "torch==$PYTORCH_VERSION$PYTORCH_VERSION_SUFFIX" \ - -f https://download.pytorch.org/whl/torch_stable.html \ - -f https://download.pytorch.org/whl/test/torch_test.html \ - -f https://download.pytorch.org/whl/nightly/torch_nightly.html + -f "https://download.pytorch.org/whl/${CU_VERSION}/torch_stable.html" \ + -f "https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${CU_VERSION}/torch_${UPLOAD_CHANNEL}.html" fi } @@ -240,7 +241,7 @@ setup_pip_pytorch_version() { # You MUST have populated PYTORCH_VERSION_SUFFIX before hand. setup_conda_pytorch_constraint() { if [[ -z "$PYTORCH_VERSION" ]]; then - export CONDA_CHANNEL_FLAGS="-c pytorch-nightly" + export CONDA_CHANNEL_FLAGS="-c pytorch-nightly -c pytorch" export PYTORCH_VERSION="$(conda search --json 'pytorch[channel=pytorch-nightly]' | \ python -c "import os, sys, json, re; cuver = os.environ.get('CU_VERSION'); \ cuver_1 = cuver.replace('cu', 'cuda') if cuver != 'cpu' else cuver; \ @@ -255,7 +256,7 @@ setup_conda_pytorch_constraint() { exit 1 fi else - export CONDA_CHANNEL_FLAGS="-c pytorch -c pytorch-nightly -c pytorch-test" + export CONDA_CHANNEL_FLAGS="-c pytorch -c pytorch-${UPLOAD_CHANNEL}" fi if [[ "$CU_VERSION" == cpu ]]; then export CONDA_PYTORCH_BUILD_CONSTRAINT="- pytorch==$PYTORCH_VERSION${PYTORCH_VERSION_SUFFIX}" @@ -303,6 +304,39 @@ setup_conda_cudatoolkit_constraint() { fi } +setup_conda_cudatoolkit_plain_constraint() { + export CONDA_CPUONLY_FEATURE="" + export CMAKE_USE_CUDA=1 + if [[ "$(uname)" == Darwin ]]; then + export CONDA_CUDATOOLKIT_CONSTRAINT="" + export CMAKE_USE_CUDA=0 + else + case "$CU_VERSION" in + cu102) + export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=10.2" + ;; + cu101) + export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=10.1" + ;; + cu100) + export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=10.0" + ;; + cu92) + export CONDA_CUDATOOLKIT_CONSTRAINT="cudatoolkit=9.2" + ;; + cpu) + export CONDA_CUDATOOLKIT_CONSTRAINT="" + export CONDA_CPUONLY_FEATURE="cpuonly" + export CMAKE_USE_CUDA=0 + ;; + *) + echo "Unrecognized CU_VERSION=$CU_VERSION" + exit 1 + ;; + esac + fi +} + # Build the proper compiler package before building the final package setup_visual_studio_constraint() { if [[ "$OSTYPE" == "msys" ]]; then diff --git a/packaging/torchcsprng/conda_build_config.yaml b/packaging/torchcsprng/conda_build_config.yaml index dd426d8..257515c 100644 --- a/packaging/torchcsprng/conda_build_config.yaml +++ b/packaging/torchcsprng/conda_build_config.yaml @@ -1,3 +1,7 @@ +channel_sources: + - pytorch-nightly,pytorch,defaults +blas_impl: + - mkl # [x86_64] c_compiler: - vs2017 # [win] cxx_compiler: diff --git a/packaging/wheel/relocate.py b/packaging/wheel/relocate.py new file mode 100644 index 0000000..b5b0db9 --- /dev/null +++ b/packaging/wheel/relocate.py @@ -0,0 +1,417 @@ +# -*- coding: utf-8 -*- + +"""Helper script to package wheels and relocate binaries.""" + +# Standard library imports +import os +import io +import sys +import glob +import shutil +import zipfile +import hashlib +import platform +import subprocess +import os.path as osp +from base64 import urlsafe_b64encode + +# Third party imports +if sys.platform == 'linux': + from auditwheel.lddtree import lddtree +from wheel.bdist_wheel import get_abi_tag + + +ALLOWLIST = { + 'libgcc_s.so.1', 'libstdc++.so.6', 'libm.so.6', + 'libdl.so.2', 'librt.so.1', 'libc.so.6', + 'libnsl.so.1', 'libutil.so.1', 'libpthread.so.0', + 'libresolv.so.2', 'libX11.so.6', 'libXext.so.6', + 'libXrender.so.1', 'libICE.so.6', 'libSM.so.6', + 'libGL.so.1', 'libgobject-2.0.so.0', 'libgthread-2.0.so.0', + 'libglib-2.0.so.0', 'ld-linux-x86-64.so.2', 'ld-2.17.so' +} + +WINDOWS_ALLOWLIST = { + 'MSVCP140.dll', 'KERNEL32.dll', + 'VCRUNTIME140_1.dll', 'VCRUNTIME140.dll', + 'api-ms-win-crt-heap-l1-1-0.dll', + 'api-ms-win-crt-runtime-l1-1-0.dll', + 'api-ms-win-crt-stdio-l1-1-0.dll', + 'api-ms-win-crt-filesystem-l1-1-0.dll', + 'api-ms-win-crt-string-l1-1-0.dll', + 'api-ms-win-crt-environment-l1-1-0.dll', + 'api-ms-win-crt-math-l1-1-0.dll', + 'api-ms-win-crt-convert-l1-1-0.dll' +} + + +HERE = osp.dirname(osp.abspath(__file__)) +PACKAGE_ROOT = osp.dirname(osp.dirname(HERE)) +PLATFORM_ARCH = platform.machine() +PYTHON_VERSION = sys.version_info + + +def read_chunks(file, size=io.DEFAULT_BUFFER_SIZE): + """Yield pieces of data from a file-like object until EOF.""" + while True: + chunk = file.read(size) + if not chunk: + break + yield chunk + + +def rehash(path, blocksize=1 << 20): + """Return (hash, length) for path using hashlib.sha256()""" + h = hashlib.sha256() + length = 0 + with open(path, 'rb') as f: + for block in read_chunks(f, size=blocksize): + length += len(block) + h.update(block) + digest = 'sha256=' + urlsafe_b64encode( + h.digest() + ).decode('latin1').rstrip('=') + # unicode/str python2 issues + return (digest, str(length)) # type: ignore + + +def unzip_file(file, dest): + """Decompress zip `file` into directory `dest`.""" + with zipfile.ZipFile(file, 'r') as zip_ref: + zip_ref.extractall(dest) + + +def is_program_installed(basename): + """ + Return program absolute path if installed in PATH. + Otherwise, return None + On macOS systems, a .app is considered installed if + it exists. + """ + if (sys.platform == 'darwin' and basename.endswith('.app') and + osp.exists(basename)): + return basename + + for path in os.environ["PATH"].split(os.pathsep): + abspath = osp.join(path, basename) + if osp.isfile(abspath): + return abspath + + +def find_program(basename): + """ + Find program in PATH and return absolute path + Try adding .exe or .bat to basename on Windows platforms + (return None if not found) + """ + names = [basename] + if os.name == 'nt': + # Windows platforms + extensions = ('.exe', '.bat', '.cmd', '.dll') + if not basename.endswith(extensions): + names = [basename + ext for ext in extensions] + [basename] + for name in names: + path = is_program_installed(name) + if path: + return path + + +def patch_new_path(library_path, new_dir): + library = osp.basename(library_path) + name, *rest = library.split('.') + rest = '.'.join(rest) + hash_id = hashlib.sha256(library_path.encode('utf-8')).hexdigest()[:8] + new_name = '.'.join([name, hash_id, rest]) + return osp.join(new_dir, new_name) + + +def find_dll_dependencies(dumpbin, binary): + out = subprocess.run([dumpbin, "/dependents", binary], + stdout=subprocess.PIPE) + out = out.stdout.strip().decode('utf-8') + start_index = out.find('dependencies:') + len('dependencies:') + end_index = out.find('Summary') + dlls = out[start_index:end_index].strip() + dlls = dlls.split(os.linesep) + dlls = [dll.strip() for dll in dlls] + return dlls + + +def relocate_elf_library(patchelf, output_dir, output_library, binary): + """ + Relocate an ELF shared library to be packaged on a wheel. + + Given a shared library, find the transitive closure of its dependencies, + rename and copy them into the wheel while updating their respective rpaths. + """ + + print('Relocating {0}'.format(binary)) + binary_path = osp.join(output_library, binary) + + ld_tree = lddtree(binary_path) + tree_libs = ld_tree['libs'] + + binary_queue = [(n, binary) for n in ld_tree['needed']] + binary_paths = {binary: binary_path} + binary_dependencies = {} + + while binary_queue != []: + library, parent = binary_queue.pop(0) + library_info = tree_libs[library] + print(library) + + if library_info['path'] is None: + print('Omitting {0}'.format(library)) + continue + + if library in ALLOWLIST: + # Omit glibc/gcc/system libraries + print('Omitting {0}'.format(library)) + continue + + parent_dependencies = binary_dependencies.get(parent, []) + parent_dependencies.append(library) + binary_dependencies[parent] = parent_dependencies + + if library in binary_paths: + continue + + binary_paths[library] = library_info['path'] + binary_queue += [(n, library) for n in library_info['needed']] + + print('Copying dependencies to wheel directory') + new_libraries_path = osp.join(output_dir, 'torchcsprng.libs') + os.makedirs(new_libraries_path) + + new_names = {binary: binary_path} + + for library in binary_paths: + if library != binary: + library_path = binary_paths[library] + new_library_path = patch_new_path(library_path, new_libraries_path) + print('{0} -> {1}'.format(library, new_library_path)) + shutil.copyfile(library_path, new_library_path) + new_names[library] = new_library_path + + print('Updating dependency names by new files') + for library in binary_paths: + if library != binary: + if library not in binary_dependencies: + continue + library_dependencies = binary_dependencies[library] + new_library_name = new_names[library] + for dep in library_dependencies: + new_dep = osp.basename(new_names[dep]) + print('{0}: {1} -> {2}'.format(library, dep, new_dep)) + subprocess.check_output( + [ + patchelf, + '--replace-needed', + dep, + new_dep, + new_library_name + ], + cwd=new_libraries_path) + + print('Updating library rpath') + subprocess.check_output( + [ + patchelf, + '--set-rpath', + "$ORIGIN", + new_library_name + ], + cwd=new_libraries_path) + + subprocess.check_output( + [ + patchelf, + '--print-rpath', + new_library_name + ], + cwd=new_libraries_path) + + print("Update library dependencies") + library_dependencies = binary_dependencies[binary] + for dep in library_dependencies: + new_dep = osp.basename(new_names[dep]) + print('{0}: {1} -> {2}'.format(binary, dep, new_dep)) + subprocess.check_output( + [ + patchelf, + '--replace-needed', + dep, + new_dep, + binary + ], + cwd=output_library) + + print('Update library rpath') + subprocess.check_output( + [ + patchelf, + '--set-rpath', + "$ORIGIN:$ORIGIN/../torchcsprng.libs", + binary_path + ], + cwd=output_library + ) + + +def relocate_dll_library(dumpbin, output_dir, output_library, binary): + """ + Relocate a DLL/PE shared library to be packaged on a wheel. + + Given a shared library, find the transitive closure of its dependencies, + rename and copy them into the wheel. + """ + print('Relocating {0}'.format(binary)) + binary_path = osp.join(output_library, binary) + + library_dlls = find_dll_dependencies(dumpbin, binary_path) + binary_queue = [(dll, binary) for dll in library_dlls] + binary_paths = {binary: binary_path} + binary_dependencies = {} + + while binary_queue != []: + library, parent = binary_queue.pop(0) + if library in WINDOWS_ALLOWLIST or library.startswith('api-ms-win'): + print('Omitting {0}'.format(library)) + continue + + library_path = find_program(library) + if library_path is None: + print('{0} not found'.format(library)) + continue + + if osp.basename(osp.dirname(library_path)) == 'system32': + continue + + print('{0}: {1}'.format(library, library_path)) + parent_dependencies = binary_dependencies.get(parent, []) + parent_dependencies.append(library) + binary_dependencies[parent] = parent_dependencies + + if library in binary_paths: + continue + + binary_paths[library] = library_path + downstream_dlls = find_dll_dependencies(dumpbin, library_path) + binary_queue += [(n, library) for n in downstream_dlls] + + print('Copying dependencies to wheel directory') + package_dir = osp.join(output_dir, 'torchcsprng') + for library in binary_paths: + if library != binary: + library_path = binary_paths[library] + new_library_path = osp.join(package_dir, library) + print('{0} -> {1}'.format(library, new_library_path)) + shutil.copyfile(library_path, new_library_path) + + +def compress_wheel(output_dir, wheel, wheel_dir, wheel_name): + """Create RECORD file and compress wheel distribution.""" + print('Update RECORD file in wheel') + dist_info = glob.glob(osp.join(output_dir, '*.dist-info'))[0] + record_file = osp.join(dist_info, 'RECORD') + + with open(record_file, 'w') as f: + for root, _, files in os.walk(output_dir): + for this_file in files: + full_file = osp.join(root, this_file) + rel_file = osp.relpath(full_file, output_dir) + if full_file == record_file: + f.write('{0},,\n'.format(rel_file)) + else: + digest, size = rehash(full_file) + f.write('{0},{1},{2}\n'.format(rel_file, digest, size)) + + print('Compressing wheel') + base_wheel_name = osp.join(wheel_dir, wheel_name) + shutil.make_archive(base_wheel_name, 'zip', output_dir) + os.remove(wheel) + shutil.move('{0}.zip'.format(base_wheel_name), wheel) + shutil.rmtree(output_dir) + + +def patch_linux(): + # Get patchelf location + patchelf = find_program('patchelf') + if patchelf is None: + raise FileNotFoundError('Patchelf was not found in the system, please' + ' make sure that is available on the PATH.') + + # Find wheel + print('Finding wheels...') + wheels = glob.glob(osp.join(PACKAGE_ROOT, 'dist', '*.whl')) + output_dir = osp.join(PACKAGE_ROOT, 'dist', '.wheel-process') + + image_binary = 'image.so' + video_binary = 'video_reader.so' + torchcsprng_binaries = [image_binary, video_binary] + for wheel in wheels: + if osp.exists(output_dir): + shutil.rmtree(output_dir) + + os.makedirs(output_dir) + + print('Unzipping wheel...') + wheel_file = osp.basename(wheel) + wheel_dir = osp.dirname(wheel) + print('{0}'.format(wheel_file)) + wheel_name, _ = osp.splitext(wheel_file) + unzip_file(wheel, output_dir) + + print('Finding ELF dependencies...') + output_library = osp.join(output_dir, 'torchcsprng') + for binary in torchcsprng_binaries: + if osp.exists(osp.join(output_library, binary)): + relocate_elf_library( + patchelf, output_dir, output_library, binary) + + compress_wheel(output_dir, wheel, wheel_dir, wheel_name) + + +def patch_win(): + # Get dumpbin location + dumpbin = find_program('dumpbin') + if dumpbin is None: + raise FileNotFoundError('Dumpbin was not found in the system, please' + ' make sure that is available on the PATH.') + + # Find wheel + print('Finding wheels...') + wheels = glob.glob(osp.join(PACKAGE_ROOT, 'dist', '*.whl')) + output_dir = osp.join(PACKAGE_ROOT, 'dist', '.wheel-process') + + image_binary = 'image.pyd' + video_binary = 'video_reader.pyd' + torchcsprng_binaries = [image_binary, video_binary] + for wheel in wheels: + if osp.exists(output_dir): + shutil.rmtree(output_dir) + + os.makedirs(output_dir) + + print('Unzipping wheel...') + wheel_file = osp.basename(wheel) + wheel_dir = osp.dirname(wheel) + print('{0}'.format(wheel_file)) + wheel_name, _ = osp.splitext(wheel_file) + unzip_file(wheel, output_dir) + + print('Finding DLL/PE dependencies...') + output_library = osp.join(output_dir, 'torchcsprng') + for binary in torchcsprng_binaries: + if osp.exists(osp.join(output_library, binary)): + relocate_dll_library( + dumpbin, output_dir, output_library, binary) + + compress_wheel(output_dir, wheel, wheel_dir, wheel_name) + + +if __name__ == '__main__': + if sys.platform == 'linux': + patch_linux() + elif sys.platform == 'win32': + patch_win() diff --git a/packaging/windows/internal/cuda_install.bat b/packaging/windows/internal/cuda_install.bat index 89bbed9..b6b26c0 100644 --- a/packaging/windows/internal/cuda_install.bat +++ b/packaging/windows/internal/cuda_install.bat @@ -99,10 +99,10 @@ if not exist "%SRC_DIR%\temp_build\cuda_11.0.2_451.48_win10.exe" ( set "ARGS=nvcc_11.0 cuobjdump_11.0 nvprune_11.0 nvprof_11.0 cupti_11.0 cublas_11.0 cublas_dev_11.0 cudart_11.0 cufft_11.0 cufft_dev_11.0 curand_11.0 curand_dev_11.0 cusolver_11.0 cusolver_dev_11.0 cusparse_11.0 cusparse_dev_11.0 npp_11.0 npp_dev_11.0 nvrtc_11.0 nvrtc_dev_11.0 nvml_dev_11.0" ) -if not exist "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" ( - curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-11.0-windows-x64-v8.0.2.39.zip --output "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" +if not exist "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.4.30.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-11.0-windows-x64-v8.0.4.30.zip --output "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.4.30.zip" if errorlevel 1 exit /b 1 - set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.2.39.zip" + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.4.30.zip" ) goto cuda_common diff --git a/packaging/windows/internal/nightly_defaults.bat b/packaging/windows/internal/nightly_defaults.bat index 73dc518..2b5ca5c 100644 --- a/packaging/windows/internal/nightly_defaults.bat +++ b/packaging/windows/internal/nightly_defaults.bat @@ -144,7 +144,7 @@ if "%CUDA_VERSION%" == "cpu" ( :: pytorch-nightly==1.0.0.dev20180908 :: or in manylinux like :: torch_nightly-1.0.0.dev20180908-cp27-cp27m-linux_x86_64.whl -if "%TORCHCSPRNG_BUILD_VERSION%" == "" set TORCHCSPRNG_BUILD_VERSION=0.8.0.dev%NIGHTLIES_DATE_COMPACT% +if "%TORCHCSPRNG_BUILD_VERSION%" == "" set TORCHCSPRNG_BUILD_VERSION=0.9.0.dev%NIGHTLIES_DATE_COMPACT% if "%~1" == "Wheels" ( if not "%CUDA_VERSION%" == "102" ( diff --git a/packaging/windows/internal/vc_install_helper.sh b/packaging/windows/internal/vc_install_helper.sh old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py index 10350aa..1559737 100644 --- a/setup.py +++ b/setup.py @@ -70,45 +70,52 @@ def get_extensions(): openmp = 'ATen parallel backend: OpenMP' in torch.__config__.parallel_info() + main_file = glob.glob(os.path.join(extensions_dir, '*.cpp')) + source_cpu = glob.glob(os.path.join(extensions_dir, 'cpu', '*.cpp')) + + sources = main_file + source_cpu + extension = CppExtension + + define_macros = [] + + cxx_flags = os.getenv('CXX_FLAGS', '') + if cxx_flags == '': + cxx_flags = [] + else: + cxx_flags = cxx_flags.split(' ') + if openmp: + if sys.platform == 'linux': + cxx_flags = append_flags(cxx_flags, ['-fopenmp']) + elif sys.platform == 'win32': + cxx_flags = append_flags(cxx_flags, ['/openmp']) + if build_cuda: - sources = [os.path.join(extensions_dir, 'csprng.cu')] extension = CUDAExtension + source_cuda = glob.glob(os.path.join(extensions_dir, 'cuda', '*.cu')) + sources += source_cuda + + define_macros += [('WITH_CUDA', None)] + nvcc_flags = os.getenv('NVCC_FLAGS', '') if nvcc_flags == '': nvcc_flags = [] else: nvcc_flags = nvcc_flags.split(' ') nvcc_flags = append_flags(nvcc_flags, ['--expt-extended-lambda', '-Xcompiler']) - if openmp: - if sys.platform == 'linux': - nvcc_flags = append_flags(nvcc_flags, ['-fopenmp']) - elif sys.platform == 'win32': - nvcc_flags = append_flags(nvcc_flags, ['/openmp']) extra_compile_args = { - 'cxx': [], + 'cxx': cxx_flags, 'nvcc': nvcc_flags, } else: - sources = [os.path.join(extensions_dir, 'csprng.cpp')] - extension = CppExtension - cxx_flags = os.getenv('CXX_FLAGS', '') - if cxx_flags == '': - cxx_flags = [] - else: - cxx_flags = cxx_flags.split(' ') - if openmp: - if sys.platform == 'linux': - cxx_flags = append_flags(cxx_flags, ['-fopenmp']) - elif sys.platform == 'win32': - cxx_flags = append_flags(cxx_flags, ['/openmp']) extra_compile_args = { - 'cxx': cxx_flags + 'cxx': cxx_flags, } ext_modules = [ extension( module_name + '._C', sources, + define_macros=define_macros, extra_compile_args=extra_compile_args, ) ] diff --git a/test/test_csprng.py b/test/test_csprng.py index 21f0642..2f5c6db 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -11,12 +11,16 @@ import math import random import time +import os try: import torchcsprng as csprng except ImportError: raise RuntimeError("CSPRNG not available") +IS_SANDCASTLE = os.getenv('SANDCASTLE') == '1' or os.getenv('TW_JOB_USER') == 'sandcastle' +IS_FBCODE = os.getenv('PYTORCH_TEST_FBCODE') == '1' + class TestCSPRNG(unittest.TestCase): all_generators = [ @@ -204,6 +208,7 @@ def test_exponential_kstest(self): self.assertTrue(res.statistic < 0.1) @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skip("https://github.com/pytorch/pytorch/issues/38662") def test_exponential_cpu_vs_cuda(self): for dtype in self.fp_ftypes: for lambd in [0.5, 1.0, 5.0]: @@ -305,9 +310,9 @@ def measure(size): time_for_1K = measure(1000) time_for_1M = measure(1000000) # Pessimistic check that parallel execution gives >= 1.5 performance boost - self.assertTrue(time_for_1M/time_for_1K < 1000 / min(1.5, torch.get_num_threads())) + self.assertTrue(time_for_1M/time_for_1K < 1000 / 1.5) - @unittest.skip("Temporary disable because doesn't work on Sandcastle") + @unittest.skipIf(IS_SANDCASTLE or IS_FBCODE, "Does not work on Sandcastle") def test_version(self): import torchcsprng.version as version self.assertTrue(version.__version__) @@ -335,25 +340,6 @@ def test_randperm(self): self.assertTrue(torch.allclose(expected, actual)) self.assertTrue(torch.allclose(expected, actual_out)) - def test_aes128_key_tensor(self): - size = 10 - for gen in self.all_generators: - s = set() - for _ in range(0, size): - t = csprng.aes128_key_tensor(gen) - s.add(str(t)) - self.assertEqual(len(s), size) - - def test_const_generator(self): - for device in self.all_devices: - for gen in self.all_generators: - for dtype in self.int_dtypes: - key = csprng.aes128_key_tensor(gen) - const_gen = csprng.create_const_generator(key) - first = torch.empty(self.size, dtype=dtype, device=device).random_(generator=const_gen) - second = torch.empty(self.size, dtype=dtype, device=device).random_(generator=const_gen) - self.assertTrue((first - second).max().abs() == 0) - def test_encrypt_decrypt(self): key_size_bytes = 16 block_size_bytes = 16 @@ -390,9 +376,6 @@ def sizeof(dtype): csprng.encrypt(initial, encrypted, key, "aes128", mode) - if initial_size > 8: - self.assertFalse(np.array_equal(initial_np, decrypted_np)) - csprng.decrypt(encrypted, decrypted, key, "aes128", mode) decrypted_np = decrypted.cpu().numpy().view(np.int8) if padding_size_bytes != 0: diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py index 1d31673..de611ff 100644 --- a/torchcsprng/__init__.py +++ b/torchcsprng/__init__.py @@ -5,6 +5,5 @@ # LICENSE file in the root directory of this source tree. import torch -del torch from torchcsprng._C import * diff --git a/torchcsprng/__init__.pyi b/torchcsprng/__init__.pyi new file mode 100644 index 0000000..2ad274d --- /dev/null +++ b/torchcsprng/__init__.pyi @@ -0,0 +1,17 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +from torch import Tensor, Generator + +def supports_cuda() -> bool: ... + +def create_random_device_generator(token: str = "") -> Generator: ... + +def create_mt19937_generator(seed: int = 0): ... + +def encrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... + +def decrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... diff --git a/torchcsprng/csrc/aes.h b/torchcsprng/csrc/aes.inc similarity index 99% rename from torchcsprng/csrc/aes.h rename to torchcsprng/csrc/aes.inc index c4ece07..85ff09b 100644 --- a/torchcsprng/csrc/aes.h +++ b/torchcsprng/csrc/aes.inc @@ -6,13 +6,6 @@ * LICENSE file in the root directory of this source tree. */ -#pragma once - -#include "macros.h" -#include - -namespace torch { -namespace csprng { namespace aes { // This AES implementation is based on @@ -393,4 +386,4 @@ TORCH_CSPRNG_HOST_DEVICE void decrypt(uint8_t* state, const uint8_t* key) { } } -}}} +} diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index 8418e3d..2966f00 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -127,7 +127,7 @@ template -void block_cipher(Tensor input, Tensor output, cipher_t cipher) { +void block_cipher(at::Tensor input, at::Tensor output, cipher_t cipher) { const auto input_ptr = input.data_ptr(); const auto input_numel = input.numel(); @@ -171,7 +171,7 @@ void block_cipher(Tensor input, Tensor output, cipher_t cipher) { } const auto input_type_size = input.element_size(); - const auto input_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(input)); + const auto input_offset_calc = make_offset_calculator<1>(at::TensorIterator::nullary_op(input)); const auto input_index_calc = [input_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { return input_offset_calc.get(li)[0]; }; @@ -185,14 +185,14 @@ void block_cipher(Tensor input, Tensor output, cipher_t cipher) { } const auto output_type_size = output.element_size(); - const auto output_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(output)); + const auto output_offset_calc = make_offset_calculator<1>(at::TensorIterator::nullary_op(output)); const auto output_index_calc = [output_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { return output_offset_calc.get(li)[0]; }; const auto device = output.device(); - block_cipher( + torch::csprng::block_cipher( input_ptr, input_numel, input_type_size, input_index_calc, output_ptr, output_numel, output_type_size, output_index_calc, device, cipher, block_size / output_type_size, diff --git a/torchcsprng/csrc/csprng.cu b/torchcsprng/csrc/cpu/kernels.cpp similarity index 64% rename from torchcsprng/csrc/csprng.cu rename to torchcsprng/csrc/cpu/kernels.cpp index 8ed519c..097a093 100644 --- a/torchcsprng/csrc/csprng.cu +++ b/torchcsprng/csrc/cpu/kernels.cpp @@ -6,4 +6,12 @@ * LICENSE file in the root directory of this source tree. */ -#include "csprng.h" +#include "../kernels_commons.h" + +namespace torch { +namespace csprng { +namespace cpu { + +#include "../kernels_body.inc" + +}}} diff --git a/torchcsprng/csrc/cpu/kernels.h b/torchcsprng/csrc/cpu/kernels.h new file mode 100644 index 0000000..abae836 --- /dev/null +++ b/torchcsprng/csrc/cpu/kernels.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace torch { +namespace csprng { +namespace cpu { + +#include "../kernels_decls.inc" + +}}} diff --git a/torchcsprng/csrc/csprng.cpp b/torchcsprng/csrc/csprng.cpp index 8ed519c..b0abc45 100644 --- a/torchcsprng/csrc/csprng.cpp +++ b/torchcsprng/csrc/csprng.cpp @@ -6,4 +6,373 @@ * LICENSE file in the root directory of this source tree. */ -#include "csprng.h" +#include +#include + +#include +#include +#include + +#include "kernels_commons.h" +#include "cpu/kernels.h" +#ifdef WITH_CUDA +#include "cuda/kernels.cuh" +#endif + +using namespace at; +using namespace torch::csprng; + +static const auto GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE = "generator does not support tensor device type"; +static const auto TENSOR_DEVICE_TYPE_IS_NOT_SUPPORTED = "tensor device type is not supported"; + +// ==================================================== Random ======================================================== + +Tensor& random_(Tensor& self, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::random_(self, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::random_(self, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor& random_from_to(Tensor& self, int64_t from, optional to, + c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::random_from_to(self, from, to, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::random_from_to(self, from, to, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor& random_to(Tensor& self, int64_t to, + c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::random_to(self, to, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::random_to(self, to, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ==================================================== Uniform ======================================================= + +Tensor& uniform_(Tensor& self, double from, double to, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::uniform_(self, from, to, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::uniform_(self, from, to, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ==================================================== Normal ======================================================== + +Tensor& normal_(Tensor& self, double mean, double std, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::normal_(self, mean, std, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_(self, mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor& normal_Tensor_float_out(Tensor& output, const Tensor& mean, double std, c10::optional gen) { + if (output.device().type() == DeviceType::CPU) { + return cpu::normal_Tensor_float_out(output, mean, std, gen); +#ifdef WITH_CUDA + } else if (output.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_Tensor_float_out(output, mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor& normal_float_Tensor_out(Tensor& output, double mean, const Tensor& std, c10::optional gen) { + if (output.device().type() == DeviceType::CPU) { + return cpu::normal_float_Tensor_out(output, mean, std, gen); +#ifdef WITH_CUDA + } else if (output.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_float_Tensor_out(output, mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor& normal_Tensor_Tensor_out(Tensor& output, const Tensor& mean, const Tensor& std, c10::optional gen) { + if (output.device().type() == DeviceType::CPU) { + return cpu::normal_Tensor_Tensor_out(output, mean, std, gen); +#ifdef WITH_CUDA + } else if (output.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_Tensor_Tensor_out(output, mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor normal_Tensor_float(const Tensor& mean, double std, c10::optional gen) { + if (mean.device().type() == DeviceType::CPU) { + return cpu::normal_Tensor_float(mean, std, gen); +#ifdef WITH_CUDA + } else if (mean.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_Tensor_float(mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor normal_float_Tensor(double mean, const Tensor& std, c10::optional gen) { + if (std.device().type() == DeviceType::CPU) { + return cpu::normal_float_Tensor(mean, std, gen); +#ifdef WITH_CUDA + } else if (std.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_float_Tensor(mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +Tensor normal_Tensor_Tensor(const Tensor& mean, const Tensor& std, c10::optional gen) { + if (mean.device().type() == DeviceType::CPU) { + return cpu::normal_Tensor_Tensor(mean, std, gen); +#ifdef WITH_CUDA + } else if (mean.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::normal_Tensor_Tensor(mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ==================================================== Cauchy ======================================================== + +Tensor& cauchy_(Tensor& self, double median, double sigma, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::cauchy_(self, median, sigma, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::cauchy_(self, median, sigma, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ================================================== LogNormal ======================================================= + +Tensor& log_normal_(Tensor& self, double mean, double std, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::log_normal_(self, mean, std, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::log_normal_(self, mean, std, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ================================================== Geometric ======================================================= + +Tensor& geometric_(Tensor& self, double p, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::geometric_(self, p, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::geometric_(self, p, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// ================================================== Exponential ===================================================== + +Tensor& exponential_(Tensor& self, double lambda, c10::optional gen) { + if (self.device().type() == DeviceType::CPU) { + return cpu::exponential_(self, lambda, gen); +#ifdef WITH_CUDA + } else if (self.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::exponential_(self, lambda, gen); +#endif + } else { + TORCH_CHECK(false, GENERATOR_DOES_NOT_SUPPORT_TENSOR_DEVICE_TYPE); + } +} + +// =============================================== Random permutation ================================================= + +// randperm implementation was copied from PyTorch to unblock CSPRNG users, but ultimately CSPRNG must reuse +// refactored randperm from PyTorch, see https://github.com/pytorch/pytorch/issues/43816 + +namespace { + + inline void check_supported_max_int_with_precision(int64_t n, const Tensor& tensor) { + TORCH_CHECK(at::scalar_tensor(n, tensor.options()).defined(), + "n is too large for result tensor type: '", tensor.toString(), "'"); + + // Ensure sufficient precision for floating point representation. + switch (tensor.scalar_type()) { + case at::ScalarType::Half: + TORCH_CHECK(n <= (int64_t(1) << 11) + 1, "n cannot be greater than 2049 for Half type."); + break; + case at::ScalarType::Float: + TORCH_CHECK(n <= (int64_t(1) << 24) + 1, "n cannot be greater than 2^24+1 for Float type."); + break; + case at::ScalarType::Double: // Unlikely to happen, but doesn't hurt to check + TORCH_CHECK(n <= (int64_t(1) << 53) + 1, "n cannot be greater than 2^53+1 for Double type."); + break; + default: + break; + } + } + + template + void randperm(Tensor& result, int64_t n, c10::optional generator) { + auto gen = at::check_generator(generator); + scalar_t *r__data = result.data_ptr(); + + result.resize_({n}); + int64_t r__stride_0 = result.stride(0); + + at::parallel_for(0, n, internal::GRAIN_SIZE, + [&r__data, &r__stride_0](int64_t p_begin, int64_t p_end) { + for(int64_t i = p_begin; i < p_end; i++) + r__data[i*r__stride_0] = static_cast(i); + }); + + for(int64_t i = 0; i < n - 1; i++) + { + int64_t z = gen->random() % (n-i); + scalar_t sav = r__data[i*r__stride_0]; + r__data[i*r__stride_0] = r__data[(z+i)*r__stride_0]; + r__data[(z+i)*r__stride_0] = sav; + } + } +} // namespace + +Tensor& randperm_generator_out(Tensor& result, int64_t n, c10::optional generator) { + TORCH_CHECK(n >= 0, "n must be non-negative, got", n); + check_supported_max_int_with_precision(n, result); + if (result.device().type() == at::kCUDA) { + auto result_cpu = at::empty({n}, result.options().device(kCPU)); + randperm_generator_out(result_cpu, n, generator); + result.resize_({n}); + return result.copy_(result_cpu); + } + result.resize_({n}); + // See Note [Acquire lock when using random generators] + std::lock_guard lock(generator->mutex()); + AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::Half, result.scalar_type(), "randperm", [&]() -> void { + randperm(result, n, generator); + }); + return result; +} + +// ================================================Encrypt/Decrypt===================================================== + +Tensor encrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { + if (input.device().type() == DeviceType::CPU) { + return cpu::encrypt(input, output, key, cipher, mode); +#ifdef WITH_CUDA + } else if (input.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::encrypt(input, output, key, cipher, mode); +#endif + } else { + TORCH_CHECK(false, TENSOR_DEVICE_TYPE_IS_NOT_SUPPORTED); + } +} + +Tensor decrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { + if (input.device().type() == DeviceType::CPU) { + return cpu::decrypt(input, output, key, cipher, mode); +#ifdef WITH_CUDA + } else if (input.device().type() == DeviceType::CUDA) { + return torch::csprng::cuda::decrypt(input, output, key, cipher, mode); +#endif + } else { + TORCH_CHECK(false, TENSOR_DEVICE_TYPE_IS_NOT_SUPPORTED); + } +} + +// ==================================================================================================================== + +Generator create_random_device_generator(c10::optional token = c10::nullopt) { + if (token.has_value()) { + return make_generator(*token); + } else { + return make_generator(true); + } +} + +Generator create_mt19937_generator(c10::optional seed = c10::nullopt) { + if (seed.has_value()) { + return make_generator(*seed); + } else { + return make_generator(false); + } +} + +bool supports_cuda() { +#ifdef WITH_CUDA + return true; +#else + return false; +#endif +} + +TORCH_LIBRARY_IMPL(aten, CustomRNGKeyId, m) { + // Random + m.impl_UNBOXED("random_.from", random_from_to); + m.impl_UNBOXED("random_.to", random_to); + m.impl_UNBOXED("random_", random_); + // Uniform + m.impl_UNBOXED("uniform_", uniform_); + // Normal + m.impl_UNBOXED("normal_", normal_); + m.impl_UNBOXED("normal.Tensor_float_out", normal_Tensor_float_out); + m.impl_UNBOXED("normal.float_Tensor_out", normal_float_Tensor_out); + m.impl_UNBOXED("normal.Tensor_Tensor_out", normal_Tensor_Tensor_out); + m.impl_UNBOXED("normal.Tensor_float", normal_Tensor_float); + m.impl_UNBOXED("normal.float_Tensor", normal_float_Tensor); + m.impl_UNBOXED("normal.Tensor_Tensor", normal_Tensor_Tensor); + // Cauchy + m.impl_UNBOXED("cauchy_", cauchy_); + // LogNormal + m.impl_UNBOXED("log_normal_", log_normal_); + // Geometric + m.impl_UNBOXED("geometric_", geometric_); + // Exponential + m.impl_UNBOXED("exponential_", exponential_); + // Random permutation + m.impl_UNBOXED("randperm.generator_out", randperm_generator_out); +} + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("supports_cuda", &supports_cuda); + m.def("create_random_device_generator", &create_random_device_generator, py::arg("token") = nullptr); + m.def("create_mt19937_generator", &create_mt19937_generator, py::arg("seed") = nullptr); + m.def("encrypt", &encrypt_pybind); + m.def("decrypt", &decrypt_pybind); +} diff --git a/torchcsprng/csrc/cuda/kernels.cu b/torchcsprng/csrc/cuda/kernels.cu new file mode 100644 index 0000000..d10b17b --- /dev/null +++ b/torchcsprng/csrc/cuda/kernels.cu @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "../kernels_commons.h" + +namespace torch { +namespace csprng { +namespace cuda { + +#include "../kernels_body.inc" + +}}} diff --git a/torchcsprng/csrc/cuda/kernels.cuh b/torchcsprng/csrc/cuda/kernels.cuh new file mode 100644 index 0000000..43fec32 --- /dev/null +++ b/torchcsprng/csrc/cuda/kernels.cuh @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace torch { +namespace csprng { +namespace cuda { + +#include "../kernels_decls.inc" + +}}} diff --git a/torchcsprng/csrc/csprng.h b/torchcsprng/csrc/kernels_body.inc similarity index 54% rename from torchcsprng/csrc/csprng.h rename to torchcsprng/csrc/kernels_body.inc index cf31c10..dd7c02e 100644 --- a/torchcsprng/csrc/csprng.h +++ b/torchcsprng/csrc/kernels_body.inc @@ -6,56 +6,7 @@ * LICENSE file in the root directory of this source tree. */ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "macros.h" -#include "block_cipher.h" -#include "aes.h" - -#if defined(__CUDACC__) || defined(__HIPCC__) -#include -#include -#endif - -using namespace at; -using namespace at::native::templates; -using namespace torch::csprng; - -inline uint64_t make64BitsFrom32Bits(uint32_t hi, uint32_t lo) { - return (static_cast(hi) << 32) | lo; -} - -// CUDA CSPRNG is actually CPU generator which is used only to generate a random key on CPU for AES running in a block mode on CUDA -struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { - CSPRNGGeneratorImpl(bool use_rd) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{use_rd} {} - CSPRNGGeneratorImpl(const std::string& token) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{true}, rd_{token} {} - CSPRNGGeneratorImpl(uint64_t seed) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, use_rd_{false}, mt_{static_cast(seed)} { } - CSPRNGGeneratorImpl(Tensor key) : c10::GeneratorImpl{Device(DeviceType::CPU), DispatchKeySet(DispatchKey::CustomRNGKeyId)}, key_(key) {} - ~CSPRNGGeneratorImpl() = default; - uint32_t random() { return use_rd_ ? rd_() : mt_(); } - uint64_t random64() { return use_rd_ ? make64BitsFrom32Bits(rd_(), rd_()) : make64BitsFrom32Bits(mt_(), mt_()); } - const Tensor& key() const { return key_; }; - - void set_current_seed(uint64_t seed) override { throw std::runtime_error("not implemented"); } - uint64_t current_seed() const override { throw std::runtime_error("not implemented"); } - uint64_t seed() override { throw std::runtime_error("not implemented"); } - CSPRNGGeneratorImpl* clone_impl() const override { throw std::runtime_error("not implemented"); } - - static DeviceType device_type() { return DeviceType::CPU; } - - bool use_rd_; - std::random_device rd_; - std::mt19937 mt_; - Tensor key_; -}; +#include "aes.inc" // Generates `block_t_size`-bytes random key Tensor on CPU // using `generator`, which must be an instance of `at::CPUGeneratorImpl` @@ -64,9 +15,6 @@ template at::Tensor key_tensor(size_t block_t_size, c10::optional generator) { std::lock_guard lock(generator->mutex()); auto gen = at::check_generator(generator); - if (gen->key().defined()) { - return gen->key().clone(); - } auto key = torch::empty({static_cast(block_t_size)}, torch::kUInt8); using random_t = typename std::result_of::type; constexpr size_t random_t_size = sizeof(random_t); @@ -81,8 +29,8 @@ at::Tensor key_tensor(size_t block_t_size, c10::optional generato } template -Tensor aes128_key_tensor(Generator generator) { - return key_tensor(aes::block_t_size, generator); +at::Tensor aes128_key_tensor(at::Generator generator) { + return key_tensor(aes::block_t_size, generator); } // ==================================================================================================================== @@ -104,44 +52,44 @@ struct RNGValues { // Applies AES in CTR mode with the `key` for passed TensorIterator iter. // `scalar_t` is a scalar type equivalent of target tensor dtype // `uint_t` is an unsigned integral type of sub-blocks that random state is divided to -// (e.g, 16 bytes random state block can be divided into 16 uint8_t sub-blocks +// (e.g, 16 bytes random state block can be divided into 16 uint8_t sub-blocks // or 8 uint16_t sub-block or 4 uint32_t sub-block or 2 uint64_t sub-blocks) -// `N` is a number of sub-block which is used by `transform_func` +// `N` is a number of sub-block which is used by `transform_func` // to generate a random value of specific distribution (e.g. `normal` uses 2) // `key` is a CUDA pointer to random key memory block // `transform_func` is a callable that converts N `uint_t` random state sub-blocks passed in RNGValues into target dtype `scalar_t` template -void aes_helper(TensorIterator& iter, const uint8_t* key_bytes, transform_t transform_func) { +void aes_helper(at::TensorIterator& iter, const uint8_t* key_bytes, transform_t transform_func) { auto output = iter.tensor(0); - const auto output_offset_calc = make_offset_calculator<1>(TensorIterator::nullary_op(output)); + const auto output_offset_calc = make_offset_calculator<1>(at::TensorIterator::nullary_op(output)); const auto output_index_calc = [output_offset_calc] TORCH_CSPRNG_HOST_DEVICE (uint32_t li) -> uint32_t { - return output_offset_calc.get(li)[0]; + return output_offset_calc.get(li)[0]; }; - block_cipher( - nullptr, 0, 0, output_index_calc, - output.data_ptr(), output.numel(), output.element_size(), output_index_calc, - iter.device_type(), - [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { - uint8_t idx_block[aes::block_t_size]; - std::memset(&idx_block, 0, aes::block_t_size); - *(reinterpret_cast(idx_block)) = idx; - aes::encrypt(idx_block, key_bytes); - for (size_t i = 0; i < aes::block_t_size; i++) { - block[i] ^= idx_block[i]; - } - }, - aes::block_t_size / (N * sizeof(uint_t)), - [transform_func] TORCH_CSPRNG_HOST_DEVICE (uint8_t* block) { - const auto n = aes::block_t_size / (N * sizeof(uint_t)); - for (size_t i = 0; i < n; ++i) { - uint64_t vals[N]; - for (size_t j = 0; j < N; ++j) { - vals[j] = (reinterpret_cast(block))[N * i + j]; - } - RNGValues rng(vals); - reinterpret_cast(block)[i] = transform_func(&rng); + torch::csprng::block_cipher( + nullptr, 0, 0, output_index_calc, + output.data_ptr(), output.numel(), output.element_size(), output_index_calc, + iter.device_type(), + [key_bytes] TORCH_CSPRNG_HOST_DEVICE (int64_t idx, uint8_t* block) -> void { + uint8_t idx_block[aes::block_t_size]; + std::memset(&idx_block, 0, aes::block_t_size); + *(reinterpret_cast(idx_block)) = idx; + aes::encrypt(idx_block, key_bytes); + for (size_t i = 0; i < aes::block_t_size; i++) { + block[i] ^= idx_block[i]; + } + }, + aes::block_t_size / (N * sizeof(uint_t)), + [transform_func] TORCH_CSPRNG_HOST_DEVICE (uint8_t* block) { + const auto n = aes::block_t_size / (N * sizeof(uint_t)); + for (size_t i = 0; i < n; ++i) { + uint64_t vals[N]; + for (size_t j = 0; j < N; ++j) { + vals[j] = (reinterpret_cast(block))[N * i + j]; } + RNGValues rng(vals); + reinterpret_cast(block)[i] = transform_func(&rng); } + } ); } @@ -234,15 +182,15 @@ struct RandomFromToKernel { } }; -Tensor& random_(Tensor& self, c10::optional generator) { - return random_impl(self, generator); +at::Tensor& random_(at::Tensor& self, c10::optional generator) { + return at::native::templates::random_impl(self, generator); } -Tensor& random_from_to(Tensor& self, int64_t from, optional to, c10::optional generator) { - return random_from_to_impl(self, from, to, generator); +at::Tensor& random_from_to(at::Tensor& self, int64_t from, c10::optional to, c10::optional generator) { + return at::native::templates::random_from_to_impl(self, from, to, generator); } -Tensor& random_to(Tensor& self, int64_t to, c10::optional generator) { +at::Tensor& random_to(at::Tensor& self, int64_t to, c10::optional generator) { return random_from_to(self, 0, to, generator); } @@ -264,8 +212,8 @@ struct UniformKernel { } }; -Tensor& uniform_(Tensor& self, double from, double to, c10::optional generator) { - return uniform_impl_(self, from, to, generator); +at::Tensor& uniform_(at::Tensor& self, double from, double to, c10::optional generator) { + return at::native::templates::uniform_impl_(self, from, to, generator); } // ==================================================== Normal ======================================================== @@ -287,32 +235,32 @@ struct NormalKernel { } }; -Tensor& normal_(Tensor& self, double mean, double std, c10::optional generator) { - return normal_impl_(self, mean, std, generator); +at::Tensor& normal_(at::Tensor& self, double mean, double std, c10::optional generator) { + return at::native::templates::normal_impl_(self, mean, std, generator); } -Tensor& normal_Tensor_float_out(Tensor& output, const Tensor& mean, double std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); +at::Tensor& normal_Tensor_float_out(at::Tensor& output, const at::Tensor& mean, double std, c10::optional gen) { + return at::native::templates::normal_out_impl(output, mean, std, gen); } -Tensor& normal_float_Tensor_out(Tensor& output, double mean, const Tensor& std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); +at::Tensor& normal_float_Tensor_out(at::Tensor& output, double mean, const at::Tensor& std, c10::optional gen) { + return at::native::templates::normal_out_impl(output, mean, std, gen); } -Tensor& normal_Tensor_Tensor_out(Tensor& output, const Tensor& mean, const Tensor& std, c10::optional gen) { - return normal_out_impl(output, mean, std, gen); +at::Tensor& normal_Tensor_Tensor_out(at::Tensor& output, const at::Tensor& mean, const at::Tensor& std, c10::optional gen) { + return at::native::templates::normal_out_impl(output, mean, std, gen); } -Tensor normal_Tensor_float(const Tensor& mean, double std, c10::optional gen) { - return normal_impl(mean, std, gen); +at::Tensor normal_Tensor_float(const at::Tensor& mean, double std, c10::optional gen) { + return at::native::templates::normal_impl(mean, std, gen); } -Tensor normal_float_Tensor(double mean, const Tensor& std, c10::optional gen) { - return normal_impl(mean, std, gen); +at::Tensor normal_float_Tensor(double mean, const at::Tensor& std, c10::optional gen) { + return at::native::templates::normal_impl(mean, std, gen); } -Tensor normal_Tensor_Tensor(const Tensor& mean, const Tensor& std, c10::optional gen) { - return normal_impl(mean, std, gen); +at::Tensor normal_Tensor_Tensor(const at::Tensor& mean, const at::Tensor& std, c10::optional gen) { + return at::native::templates::normal_impl(mean, std, gen); } // ==================================================== Cauchy ======================================================== @@ -333,8 +281,8 @@ struct CauchyKernel { } }; -Tensor& cauchy_(Tensor& self, double median, double sigma, c10::optional generator) { - return cauchy_impl_(self, median, sigma, generator); +at::Tensor& cauchy_(at::Tensor& self, double median, double sigma, c10::optional generator) { + return at::native::templates::cauchy_impl_(self, median, sigma, generator); } // ================================================== LogNormal ======================================================= @@ -355,8 +303,8 @@ struct LogNormalKernel { } }; -Tensor& log_normal_(Tensor& self, double mean, double std, c10::optional gen) { - return log_normal_impl_(self, mean, std, gen); +at::Tensor& log_normal_(at::Tensor& self, double mean, double std, c10::optional gen) { + return at::native::templates::log_normal_impl_(self, mean, std, gen); } // ================================================== Geometric ======================================================= @@ -377,8 +325,8 @@ struct GeometricKernel { } }; -Tensor& geometric_(Tensor& self, double p, c10::optional gen) { - return geometric_impl_(self, p, gen); +at::Tensor& geometric_(at::Tensor& self, double p, c10::optional gen) { + return at::native::templates::geometric_impl_(self, p, gen); } // ================================================== Exponential ===================================================== @@ -399,80 +347,11 @@ struct ExponentialKernel { } }; -Tensor& exponential_(Tensor& self, double lambda, c10::optional gen) { - return exponential_impl_(self, lambda, gen); -} - -// =============================================== Random permutation ================================================= - -// randperm implementation was copied from PyTorch to unblock CSPRNG users, but ultimately CSPRNG must reuse -// refactored randperm from PyTorch, see https://github.com/pytorch/pytorch/issues/43816 - -namespace { - - inline void check_supported_max_int_with_precision(int64_t n, const Tensor& tensor) { - TORCH_CHECK(at::scalar_tensor(n, tensor.options()).defined(), - "n is too large for result tensor type: '", tensor.toString(), "'"); - - // Ensure sufficient precision for floating point representation. - switch (tensor.scalar_type()) { - case at::ScalarType::Half: - TORCH_CHECK(n <= (int64_t(1) << 11) + 1, "n cannot be greater than 2049 for Half type."); - break; - case at::ScalarType::Float: - TORCH_CHECK(n <= (int64_t(1) << 24) + 1, "n cannot be greater than 2^24+1 for Float type."); - break; - case at::ScalarType::Double: // Unlikely to happen, but doesn't hurt to check - TORCH_CHECK(n <= (int64_t(1) << 53) + 1, "n cannot be greater than 2^53+1 for Double type."); - break; - default: - break; - } - } - - template - void randperm(Tensor& result, int64_t n, c10::optional generator) { - auto gen = at::check_generator(generator); - scalar_t *r__data = result.data_ptr(); - - result.resize_({n}); - int64_t r__stride_0 = result.stride(0); - - at::parallel_for(0, n, internal::GRAIN_SIZE, - [&r__data, &r__stride_0](int64_t p_begin, int64_t p_end) { - for(int64_t i = p_begin; i < p_end; i++) - r__data[i*r__stride_0] = static_cast(i); - }); - - for(int64_t i = 0; i < n - 1; i++) - { - int64_t z = gen->random() % (n-i); - scalar_t sav = r__data[i*r__stride_0]; - r__data[i*r__stride_0] = r__data[(z+i)*r__stride_0]; - r__data[(z+i)*r__stride_0] = sav; - } - } -} // namespace - -Tensor& randperm_generator_out(Tensor& result, int64_t n, c10::optional generator) { - TORCH_CHECK(n >= 0, "n must be non-negative, got", n); - check_supported_max_int_with_precision(n, result); - if (result.device().type() == at::kCUDA) { - auto result_cpu = at::empty({n}, result.options().device(kCPU)); - randperm_generator_out(result_cpu, n, generator); - result.resize_({n}); - return result.copy_(result_cpu); - } - result.resize_({n}); - // See Note [Acquire lock when using random generators] - std::lock_guard lock(generator->mutex()); - AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::Half, result.scalar_type(), "randperm", [&]() -> void { - randperm(result, n, generator); - }); - return result; +at::Tensor& exponential_(at::Tensor& self, double lambda, c10::optional gen) { + return at::native::templates::exponential_impl_(self, lambda, gen); } -// ==================================================================================================================== +// ================================================Encrypt/Decrypt===================================================== void check_cipher(const std::string& cipher, Tensor key) { if (cipher == "aes128") { @@ -516,7 +395,7 @@ void aes_ctr_decrypt(Tensor input, Tensor output, uint8_t* key_bytes) { aes_ctr_encrypt(input, output, key_bytes); } -Tensor encrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { +Tensor encrypt(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { TORCH_CHECK(input.device() == output.device() && input.device() == key.device(), "input, output and key tensors must have the same device"); const auto output_size_bytes = output.numel() * output.itemsize(); const auto input_size_bytes = input.numel() * input.itemsize(); @@ -537,7 +416,7 @@ Tensor encrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string return output; } -Tensor decrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { +Tensor decrypt(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode) { TORCH_CHECK(input.device() == output.device() && input.device() == key.device(), "input, output and key tensors must have the same device"); const auto output_size_bytes = output.numel() * output.itemsize(); const auto input_size_bytes = input.numel() * input.itemsize(); @@ -554,74 +433,3 @@ Tensor decrypt_pybind(Tensor input, Tensor output, Tensor key, const std::string } return output; } - -// ==================================================================================================================== - -Generator create_random_device_generator(c10::optional token = c10::nullopt) { - if (token.has_value()) { - return make_generator(*token); - } else { - return make_generator(true); - } -} - -Generator create_mt19937_generator(c10::optional seed = c10::nullopt) { - if (seed.has_value()) { - return make_generator(*seed); - } else { - return make_generator(false); - } -} - -bool supports_cuda() { -#if defined(__CUDACC__) || defined(__HIPCC__) - return true; -#else - return false; -#endif -} - -Tensor aes128_key_tensor_pybind(Generator generator) { - return aes128_key_tensor(generator); -} - -Generator create_const_generator(Tensor key) { - return make_generator(key); -} - -TORCH_LIBRARY_IMPL(aten, CustomRNGKeyId, m) { - // Random - m.impl_UNBOXED("random_.from", random_from_to); - m.impl_UNBOXED("random_.to", random_to); - m.impl_UNBOXED("random_", random_); - // Uniform - m.impl_UNBOXED("uniform_", uniform_); - // Normal - m.impl_UNBOXED("normal_", normal_); - m.impl_UNBOXED("normal.Tensor_float_out", normal_Tensor_float_out); - m.impl_UNBOXED("normal.float_Tensor_out", normal_float_Tensor_out); - m.impl_UNBOXED("normal.Tensor_Tensor_out", normal_Tensor_Tensor_out); - m.impl_UNBOXED("normal.Tensor_float", normal_Tensor_float); - m.impl_UNBOXED("normal.float_Tensor", normal_float_Tensor); - m.impl_UNBOXED("normal.Tensor_Tensor", normal_Tensor_Tensor); - // Cauchy - m.impl_UNBOXED("cauchy_", cauchy_); - // LogNormal - m.impl_UNBOXED("log_normal_", log_normal_); - // Geometric - m.impl_UNBOXED("geometric_", geometric_); - // Exponential - m.impl_UNBOXED("exponential_", exponential_); - // Random permutation - m.impl_UNBOXED("randperm.generator_out", randperm_generator_out); -} - -PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { - m.def("supports_cuda", &supports_cuda); - m.def("create_random_device_generator", &create_random_device_generator, py::arg("token") = nullptr); - m.def("create_mt19937_generator", &create_mt19937_generator, py::arg("seed") = nullptr); - m.def("aes128_key_tensor", &aes128_key_tensor_pybind); - m.def("create_const_generator", &create_const_generator); - m.def("encrypt", &encrypt_pybind); - m.def("decrypt", &decrypt_pybind); -} diff --git a/torchcsprng/csrc/kernels_commons.h b/torchcsprng/csrc/kernels_commons.h new file mode 100644 index 0000000..0a28d1f --- /dev/null +++ b/torchcsprng/csrc/kernels_commons.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include "macros.h" +#include "block_cipher.h" + +inline uint64_t make64BitsFrom32Bits(uint32_t hi, uint32_t lo) { + return (static_cast(hi) << 32) | lo; +} + +// CUDA CSPRNG is actually CPU generator which is used only to generate a random key on CPU for AES running in a block mode on CUDA +struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { + CSPRNGGeneratorImpl(bool use_rd) : c10::GeneratorImpl{at::Device(at::DeviceType::CPU), at::DispatchKeySet(at::DispatchKey::CustomRNGKeyId)}, use_rd_{use_rd} {} + CSPRNGGeneratorImpl(const std::string& token) : c10::GeneratorImpl{at::Device(at::DeviceType::CPU), at::DispatchKeySet(at::DispatchKey::CustomRNGKeyId)}, use_rd_{true}, rd_{token} {} + CSPRNGGeneratorImpl(uint64_t seed) : c10::GeneratorImpl{at::Device(at::DeviceType::CPU), at::DispatchKeySet(at::DispatchKey::CustomRNGKeyId)}, use_rd_{false}, mt_{static_cast(seed)} { } + ~CSPRNGGeneratorImpl() = default; + uint32_t random() { return use_rd_ ? rd_() : mt_(); } + uint64_t random64() { return use_rd_ ? make64BitsFrom32Bits(rd_(), rd_()) : make64BitsFrom32Bits(mt_(), mt_()); } + + void set_current_seed(uint64_t seed) override { throw std::runtime_error("not implemented"); } + uint64_t current_seed() const override { throw std::runtime_error("not implemented"); } + uint64_t seed() override { throw std::runtime_error("not implemented"); } + CSPRNGGeneratorImpl* clone_impl() const override { throw std::runtime_error("not implemented"); } + + static at::DeviceType device_type() { return at::DeviceType::CPU; } + + bool use_rd_; + std::random_device rd_; + std::mt19937 mt_; +}; diff --git a/torchcsprng/csrc/kernels_decls.inc b/torchcsprng/csrc/kernels_decls.inc new file mode 100644 index 0000000..6fbfadc --- /dev/null +++ b/torchcsprng/csrc/kernels_decls.inc @@ -0,0 +1,57 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +// ==================================================== Random ======================================================== + +at::Tensor& random_(at::Tensor& self, c10::optional generator); + +at::Tensor& random_from_to(at::Tensor& self, int64_t from, optional to, c10::optional generator); + +at::Tensor& random_to(at::Tensor& self, int64_t to, c10::optional generator); + +// ==================================================== Uniform ======================================================= + +at::Tensor& uniform_(at::Tensor& self, double from, double to, c10::optional generator); + +// ==================================================== Normal ======================================================== + +at::Tensor& normal_(at::Tensor& self, double mean, double std, c10::optional generator); + +at::Tensor& normal_Tensor_float_out(at::Tensor& output, const at::Tensor& mean, double std, c10::optional gen); + +at::Tensor& normal_float_Tensor_out(at::Tensor& output, double mean, const at::Tensor& std, c10::optional gen); + +at::Tensor& normal_Tensor_Tensor_out(at::Tensor& output, const at::Tensor& mean, const at::Tensor& std, c10::optional gen); + +at::Tensor normal_Tensor_float(const at::Tensor& mean, double std, c10::optional gen); + +at::Tensor normal_float_Tensor(double mean, const at::Tensor& std, c10::optional gen); + +at::Tensor normal_Tensor_Tensor(const at::Tensor& mean, const at::Tensor& std, c10::optional gen); + +// ==================================================== Cauchy ======================================================== + +at::Tensor& cauchy_(at::Tensor& self, double median, double sigma, c10::optional generator); + +// ================================================== LogNormal ======================================================= + +at::Tensor& log_normal_(at::Tensor& self, double mean, double std, c10::optional gen); + +// ================================================== Geometric ======================================================= + +at::Tensor& geometric_(at::Tensor& self, double p, c10::optional gen); + +// ================================================== Exponential ===================================================== + +at::Tensor& exponential_(at::Tensor& self, double lambda, c10::optional gen); + +// ================================================Encrypt/Decrypt===================================================== + +Tensor encrypt(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode); + +Tensor decrypt(Tensor input, Tensor output, Tensor key, const std::string& cipher, const std::string& mode); From f44a079732a59593b4c5220578d139e16c8b11fd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 9 Dec 2020 04:30:48 -0800 Subject: [PATCH 138/750] 2020-12-09 nightly release (abf5bbc9ccfe8a1834faf5141f8888a8cb24ef73) --- .circleci/config.yml | 55 +++++++++++++++ .../unittest/linux/scripts/environment.yml | 1 + .circleci/unittest/linux/scripts/setup_env.sh | 7 +- .../unittest/windows/scripts/environment.yml | 1 + packaging/torchcsprng/meta.yaml | 1 + packaging/wheel/osx_wheel.sh | 2 +- packaging/windows/build_csprng.bat | 2 +- test/test_csprng.py | 68 +++++++++++++------ 8 files changed, 114 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2d96046..2e7a1f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -394,6 +394,49 @@ jobs: - store_test_results: path: test-results + unittest_macos_cpu: + <<: *binary_common + macos: + xcode: "9.4.1" + resource_class: large + steps: + - checkout + - designate_upload_channel + - run: + name: Install wget + command: HOMEBREW_NO_AUTO_UPDATE=1 brew install wget + # Disable brew auto update which is very slow + - run: + name: Generate cache key + # This will refresh cache on Sundays, nightly build should generate new cache. + command: echo "$(date +"%Y-%U")" > .circleci-weekly + - restore_cache: + + keys: + - env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + - run: + name: Setup + command: .circleci/unittest/linux/scripts/setup_env.sh + - save_cache: + + key: env-v3-macos-{{ arch }}-py<< parameters.python_version >>-{{ checksum ".circleci/unittest/linux/scripts/environment.yml" }}-{{ checksum ".circleci-weekly" }} + + paths: + - conda + - env + - run: + name: Install torchcsprng + command: .circleci/unittest/linux/scripts/install.sh + - run: + name: Run tests + command: .circleci/unittest/linux/scripts/run_test.sh + - run: + name: Post process + command: .circleci/unittest/linux/scripts/post_process.sh + - store_test_results: + path: test-results + workflows: build: jobs: @@ -848,6 +891,18 @@ workflows: cu_version: cu101 name: unittest_windows_gpu_py3.8 python_version: '3.8' + - unittest_macos_cpu: + cu_version: cpu + name: unittest_macos_cpu_py3.6 + python_version: '3.6' + - unittest_macos_cpu: + cu_version: cpu + name: unittest_macos_cpu_py3.7 + python_version: '3.7' + - unittest_macos_cpu: + cu_version: cpu + name: unittest_macos_cpu_py3.8 + python_version: '3.8' nightly: jobs: # - circleci_consistency diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index 688cc59..f92ccca 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -8,6 +8,7 @@ dependencies: - codecov - pip - ca-certificates + - pycrypto - pip: - future - scipy diff --git a/.circleci/unittest/linux/scripts/setup_env.sh b/.circleci/unittest/linux/scripts/setup_env.sh index 303042f..054ebf2 100755 --- a/.circleci/unittest/linux/scripts/setup_env.sh +++ b/.circleci/unittest/linux/scripts/setup_env.sh @@ -14,10 +14,15 @@ env_dir="${root_dir}/env" cd "${root_dir}" +case "$(uname -s)" in + Darwin*) os=MacOSX;; + *) os=Linux +esac + # 1. Install conda at ./conda if [ ! -d "${conda_dir}" ]; then printf "* Installing conda\n" - wget -O miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh + wget -O miniconda.sh "http://repo.continuum.io/miniconda/Miniconda3-latest-${os}-x86_64.sh" bash ./miniconda.sh -b -f -p "${conda_dir}" fi eval "$(${conda_dir}/bin/conda shell.bash hook)" diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index 688cc59..f92ccca 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -8,6 +8,7 @@ dependencies: - codecov - pip - ca-certificates + - pycrypto - pip: - future - scipy diff --git a/packaging/torchcsprng/meta.yaml b/packaging/torchcsprng/meta.yaml index 29d9590..1b4570d 100644 --- a/packaging/torchcsprng/meta.yaml +++ b/packaging/torchcsprng/meta.yaml @@ -45,6 +45,7 @@ build: # requires: # - pytest # - scipy +# - pycrypto # commands: # pytest . --verbose diff --git a/packaging/wheel/osx_wheel.sh b/packaging/wheel/osx_wheel.sh index 80d9f06..566f956 100644 --- a/packaging/wheel/osx_wheel.sh +++ b/packaging/wheel/osx_wheel.sh @@ -41,7 +41,7 @@ do echo "Building against ${TORCHAUDIO_PYTORCH_DEPENDENCY_VERSION}" # install torchcsprng dependencies - pip install ninja scipy pytest + pip install ninja scipy pytest pycrypto python setup.py clean python setup.py bdist_wheel diff --git a/packaging/windows/build_csprng.bat b/packaging/windows/build_csprng.bat index 85aec48..e6da23d 100644 --- a/packaging/windows/build_csprng.bat +++ b/packaging/windows/build_csprng.bat @@ -64,7 +64,7 @@ FOR %%v IN (%DESIRED_PYTHON%) DO ( set PYTHON_VERSION_STR=%%v set PYTHON_VERSION_STR=!PYTHON_VERSION_STR:.=! conda remove -n py!PYTHON_VERSION_STR! --all -y || rmdir %CONDA_HOME%\envs\py!PYTHON_VERSION_STR! /s - conda create -n py!PYTHON_VERSION_STR! -y -q -c defaults -c conda-forge numpy>=1.11 mkl>=2018 python=%%v ca-certificates scipy + conda create -n py!PYTHON_VERSION_STR! -y -q -c defaults -c conda-forge numpy>=1.11 mkl>=2018 python=%%v ca-certificates scipy pycrypto ) :: Uncomment for stable releases diff --git a/test/test_csprng.py b/test/test_csprng.py index 2f5c6db..b78087c 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -12,6 +12,8 @@ import random import time import os +from Crypto.Cipher import AES +from Crypto.Util import Counter try: import torchcsprng as csprng @@ -302,7 +304,7 @@ def test_cpu_parallel(self): def measure(size): t = torch.empty(size, dtype=torch.float32, device='cpu') start = time.time() - for i in range(10): + for i in range(20): t.normal_(generator=urandom_gen) finish = time.time() return finish - start @@ -352,35 +354,61 @@ def sizeof(dtype): else: return torch.iinfo(dtype).bits // 8 - for device in self.all_devices: - for key_dtype in self.all_dtypes: - key_size = key_size_bytes // sizeof(key_dtype) - key = torch.empty(key_size, dtype=key_dtype, device=device).random_() - for initial_dtype in self.all_dtypes: + def pad(data, pad_size): + if len(data) % pad_size == 0: + return data + length = pad_size - (len(data) % pad_size) + return data + bytes([0])*length + + def create_aes(m, k): + if m == "ecb": + return AES.new(k.tobytes(), AES.MODE_ECB) + elif m == "ctr": + ctr = Counter.new(AES.block_size * 8, initial_value=0, little_endian=True) + return AES.new(k.tobytes(), AES.MODE_CTR, counter=ctr) + else: + return None + + for key_dtype in self.all_dtypes: + key_size = key_size_bytes // sizeof(key_dtype) + key = torch.empty(key_size, dtype=key_dtype).random_() + key_np = key.numpy().view(np.int8) + for initial_dtype in self.all_dtypes: + for initial_size in [0, 4, 8, 15, 16, 23, 42]: + initial = torch.empty(initial_size, dtype=initial_dtype).random_() + initial_np = initial.numpy().view(np.int8) for encrypted_dtype in self.all_dtypes: + encrypted_size = (initial_size * sizeof(initial_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) + encrypted = torch.zeros(encrypted_size, dtype=encrypted_dtype) for decrypted_dtype in self.all_dtypes: - for initial_size in [0, 4, 8, 15, 16, 23, 42]: - for mode in ["ecb", "ctr"]: - encrypted_size = (initial_size * sizeof(initial_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) - decrypted_size = (encrypted_size * sizeof(encrypted_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(decrypted_dtype) + decrypted_size = (encrypted_size * sizeof(encrypted_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(decrypted_dtype) + decrypted = torch.zeros(decrypted_size, dtype=decrypted_dtype) + for mode in ["ecb", "ctr"]: + for device in self.all_devices: + key = key.to(device) + initial = initial.to(device) + encrypted = encrypted.to(device) + decrypted = decrypted.to(device) - initial = torch.empty(initial_size, dtype=initial_dtype, device=device).random_() - encrypted = torch.empty(encrypted_size, dtype=encrypted_dtype, device=device).random_() - decrypted = torch.empty(decrypted_size, dtype=decrypted_dtype, device=device).random_() + csprng.encrypt(initial, encrypted, key, "aes128", mode) + encrypted_np = encrypted.cpu().numpy().view(np.int8) - initial_np = initial.cpu().numpy().view(np.int8) - decrypted_np = decrypted.cpu().numpy().view(np.int8) - padding_size_bytes = initial_size * sizeof(initial_dtype) - decrypted_size * sizeof(decrypted_dtype) - if padding_size_bytes != 0: - decrypted_np = decrypted_np[:padding_size_bytes] + aes = create_aes(mode, key_np) - csprng.encrypt(initial, encrypted, key, "aes128", mode) + encrypted_expected = np.frombuffer(aes.encrypt(pad(initial_np.tobytes(), block_size_bytes)), dtype=np.int8) + self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) csprng.decrypt(encrypted, decrypted, key, "aes128", mode) decrypted_np = decrypted.cpu().numpy().view(np.int8) + + aes = create_aes(mode, key_np) + + decrypted_expected = np.frombuffer(aes.decrypt(pad(encrypted_np.tobytes(), block_size_bytes)), dtype=np.int8) + self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) + + padding_size_bytes = initial_size * sizeof(initial_dtype) - decrypted_size * sizeof(decrypted_dtype) if padding_size_bytes != 0: decrypted_np = decrypted_np[:padding_size_bytes] - self.assertTrue(np.array_equal(initial_np, decrypted_np)) if __name__ == '__main__': From b095e204fd3142da09edd5c950b99eecec286053 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 10 Dec 2020 04:30:43 -0800 Subject: [PATCH 139/750] 2020-12-10 nightly release (abf5bbc9ccfe8a1834faf5141f8888a8cb24ef73) From 2d15fac5ceb2e2b5e67eef5c7d678954d79a2385 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 11 Dec 2020 04:30:38 -0800 Subject: [PATCH 140/750] 2020-12-11 nightly release (abf5bbc9ccfe8a1834faf5141f8888a8cb24ef73) From 6b28b4a5bf37731017c4039b74c0f224e685cf41 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 12 Dec 2020 04:30:35 -0800 Subject: [PATCH 141/750] 2020-12-12 nightly release (96ec4fb66130fcdafa641fb656d90a6e79f53f99) --- test/test_csprng.py | 12 +++++------- torchcsprng/csrc/kernels_body.inc | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index b78087c..f50c66a 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -377,11 +377,12 @@ def create_aes(m, k): for initial_size in [0, 4, 8, 15, 16, 23, 42]: initial = torch.empty(initial_size, dtype=initial_dtype).random_() initial_np = initial.numpy().view(np.int8) + initial_size_bytes = initial_size * sizeof(initial_dtype) for encrypted_dtype in self.all_dtypes: - encrypted_size = (initial_size * sizeof(initial_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) + encrypted_size = (initial_size_bytes + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) encrypted = torch.zeros(encrypted_size, dtype=encrypted_dtype) for decrypted_dtype in self.all_dtypes: - decrypted_size = (encrypted_size * sizeof(encrypted_dtype) + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(decrypted_dtype) + decrypted_size = (initial_size_bytes + sizeof(decrypted_dtype) - 1) // sizeof(decrypted_dtype) decrypted = torch.zeros(decrypted_size, dtype=decrypted_dtype) for mode in ["ecb", "ctr"]: for device in self.all_devices: @@ -399,16 +400,13 @@ def create_aes(m, k): self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) csprng.decrypt(encrypted, decrypted, key, "aes128", mode) - decrypted_np = decrypted.cpu().numpy().view(np.int8) + decrypted_np = decrypted.cpu().numpy().view(np.int8)[:initial_size_bytes] aes = create_aes(mode, key_np) - decrypted_expected = np.frombuffer(aes.decrypt(pad(encrypted_np.tobytes(), block_size_bytes)), dtype=np.int8) + decrypted_expected = np.frombuffer(aes.decrypt(pad(encrypted_np.tobytes(), block_size_bytes)), dtype=np.int8)[:initial_size_bytes] self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) - padding_size_bytes = initial_size * sizeof(initial_dtype) - decrypted_size * sizeof(decrypted_dtype) - if padding_size_bytes != 0: - decrypted_np = decrypted_np[:padding_size_bytes] self.assertTrue(np.array_equal(initial_np, decrypted_np)) if __name__ == '__main__': diff --git a/torchcsprng/csrc/kernels_body.inc b/torchcsprng/csrc/kernels_body.inc index dd7c02e..639976b 100644 --- a/torchcsprng/csrc/kernels_body.inc +++ b/torchcsprng/csrc/kernels_body.inc @@ -420,7 +420,8 @@ Tensor decrypt(Tensor input, Tensor output, Tensor key, const std::string& ciphe TORCH_CHECK(input.device() == output.device() && input.device() == key.device(), "input, output and key tensors must have the same device"); const auto output_size_bytes = output.numel() * output.itemsize(); const auto input_size_bytes = input.numel() * input.itemsize(); - TORCH_CHECK(output_size_bytes == input_size_bytes, "input and output tensors must have the same size in byte"); + const auto diff = input_size_bytes - output_size_bytes; + TORCH_CHECK(0 <= diff && diff < aes::block_t_size, "output tensor size in bytes must be less then or equal to input tensor size in bytes, the difference must be less than block size"); TORCH_CHECK(input_size_bytes % aes::block_t_size == 0, "input tensor size in bytes must divisible by cipher block size in bytes"); check_cipher(cipher, key); const auto key_bytes = reinterpret_cast(key.contiguous().data_ptr()); From e2b4854ec775013a33379c0b6f6c5e145ca87377 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 13 Dec 2020 04:30:57 -0800 Subject: [PATCH 142/750] 2020-12-13 nightly release (96ec4fb66130fcdafa641fb656d90a6e79f53f99) From b1622ffaa42cb7e85b25782d37f0e9fbae95759d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 14 Dec 2020 04:30:34 -0800 Subject: [PATCH 143/750] 2020-12-14 nightly release (96ec4fb66130fcdafa641fb656d90a6e79f53f99) From e240aad66886efdba428750e83a3b4122173bfd9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 15 Dec 2020 04:30:42 -0800 Subject: [PATCH 144/750] 2020-12-15 nightly release (96ec4fb66130fcdafa641fb656d90a6e79f53f99) From d142df048b438a861722602d16f41184ae1b26c0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 16 Dec 2020 04:30:38 -0800 Subject: [PATCH 145/750] 2020-12-16 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) --- test/test_csprng.py | 51 +++++++++++++++++++++++++++++++++++++ torchcsprng/csrc/csprng.cpp | 42 +++++++++++++++--------------- 2 files changed, 72 insertions(+), 21 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index f50c66a..8fc89cb 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -409,5 +409,56 @@ def create_aes(m, k): self.assertTrue(np.array_equal(initial_np, decrypted_np)) + def test_encrypt_decrypt_inplace(self): + key_size_bytes = 16 + + def sizeof(dtype): + if dtype == torch.bool: + return 1 + elif dtype.is_floating_point: + return torch.finfo(dtype).bits // 8 + else: + return torch.iinfo(dtype).bits // 8 + + def create_aes(m, k): + if m == "ecb": + return AES.new(k.tobytes(), AES.MODE_ECB) + elif m == "ctr": + ctr = Counter.new(AES.block_size * 8, initial_value=0, little_endian=True) + return AES.new(k.tobytes(), AES.MODE_CTR, counter=ctr) + else: + return None + + for key_dtype in self.all_dtypes: + key_size = key_size_bytes // sizeof(key_dtype) + key = torch.empty(key_size, dtype=key_dtype).random_() + key_np = key.numpy().view(np.int8) + for initial_dtype in self.all_dtypes: + for initial_size_bytes in [0, 16, 256]: + initial_size = initial_size_bytes // sizeof(initial_dtype) + initial = torch.empty(initial_size, dtype=initial_dtype).random_() + initial_np = initial.numpy().view(np.int8) + initial_np_copy = np.copy(initial_np) + for mode in ["ecb", "ctr"]: + for device in self.all_devices: + key = key.to(device) + initial = initial.to(device) + + csprng.encrypt(initial, initial, key, "aes128", mode) + encrypted_np = initial.cpu().numpy().view(np.int8) + aes = create_aes(mode, key_np) + encrypted_expected = np.frombuffer(aes.encrypt(initial_np_copy.tobytes()), dtype=np.int8) + self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) + + encrypted_np_copy = np.copy(encrypted_np) + + csprng.decrypt(initial, initial, key, "aes128", mode) + decrypted_np = initial.cpu().numpy().view(np.int8) + aes = create_aes(mode, key_np) + decrypted_expected = np.frombuffer(aes.decrypt(encrypted_np_copy.tobytes()), dtype=np.int8) + self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) + + self.assertTrue(np.array_equal(initial_np_copy, decrypted_np)) + if __name__ == '__main__': unittest.main() diff --git a/torchcsprng/csrc/csprng.cpp b/torchcsprng/csrc/csprng.cpp index b0abc45..04384fe 100644 --- a/torchcsprng/csrc/csprng.cpp +++ b/torchcsprng/csrc/csprng.cpp @@ -93,7 +93,7 @@ Tensor& normal_(Tensor& self, double mean, double std, c10::optional } } -Tensor& normal_Tensor_float_out(Tensor& output, const Tensor& mean, double std, c10::optional gen) { +Tensor& normal_Tensor_float_out(const Tensor& mean, double std, c10::optional gen, Tensor& output) { if (output.device().type() == DeviceType::CPU) { return cpu::normal_Tensor_float_out(output, mean, std, gen); #ifdef WITH_CUDA @@ -105,7 +105,7 @@ Tensor& normal_Tensor_float_out(Tensor& output, const Tensor& mean, double std, } } -Tensor& normal_float_Tensor_out(Tensor& output, double mean, const Tensor& std, c10::optional gen) { +Tensor& normal_float_Tensor_out(double mean, const Tensor& std, c10::optional gen, Tensor& output) { if (output.device().type() == DeviceType::CPU) { return cpu::normal_float_Tensor_out(output, mean, std, gen); #ifdef WITH_CUDA @@ -117,7 +117,7 @@ Tensor& normal_float_Tensor_out(Tensor& output, double mean, const Tensor& std, } } -Tensor& normal_Tensor_Tensor_out(Tensor& output, const Tensor& mean, const Tensor& std, c10::optional gen) { +Tensor& normal_Tensor_Tensor_out(const Tensor& mean, const Tensor& std, c10::optional gen, Tensor& output) { if (output.device().type() == DeviceType::CPU) { return cpu::normal_Tensor_Tensor_out(output, mean, std, gen); #ifdef WITH_CUDA @@ -272,12 +272,12 @@ namespace { } } // namespace -Tensor& randperm_generator_out(Tensor& result, int64_t n, c10::optional generator) { +Tensor& randperm_generator_out(int64_t n, c10::optional generator, Tensor& result) { TORCH_CHECK(n >= 0, "n must be non-negative, got", n); check_supported_max_int_with_precision(n, result); if (result.device().type() == at::kCUDA) { auto result_cpu = at::empty({n}, result.options().device(kCPU)); - randperm_generator_out(result_cpu, n, generator); + randperm_generator_out(n, generator, result_cpu); result.resize_({n}); return result.copy_(result_cpu); } @@ -344,29 +344,29 @@ bool supports_cuda() { TORCH_LIBRARY_IMPL(aten, CustomRNGKeyId, m) { // Random - m.impl_UNBOXED("random_.from", random_from_to); - m.impl_UNBOXED("random_.to", random_to); - m.impl_UNBOXED("random_", random_); + m.impl("random_.from", random_from_to); + m.impl("random_.to", random_to); + m.impl("random_", random_); // Uniform - m.impl_UNBOXED("uniform_", uniform_); + m.impl("uniform_", uniform_); // Normal - m.impl_UNBOXED("normal_", normal_); - m.impl_UNBOXED("normal.Tensor_float_out", normal_Tensor_float_out); - m.impl_UNBOXED("normal.float_Tensor_out", normal_float_Tensor_out); - m.impl_UNBOXED("normal.Tensor_Tensor_out", normal_Tensor_Tensor_out); - m.impl_UNBOXED("normal.Tensor_float", normal_Tensor_float); - m.impl_UNBOXED("normal.float_Tensor", normal_float_Tensor); - m.impl_UNBOXED("normal.Tensor_Tensor", normal_Tensor_Tensor); + m.impl("normal_", normal_); + m.impl("normal.Tensor_float_out", normal_Tensor_float_out); + m.impl("normal.float_Tensor_out", normal_float_Tensor_out); + m.impl("normal.Tensor_Tensor_out", normal_Tensor_Tensor_out); + m.impl("normal.Tensor_float", normal_Tensor_float); + m.impl("normal.float_Tensor", normal_float_Tensor); + m.impl("normal.Tensor_Tensor", normal_Tensor_Tensor); // Cauchy - m.impl_UNBOXED("cauchy_", cauchy_); + m.impl("cauchy_", cauchy_); // LogNormal - m.impl_UNBOXED("log_normal_", log_normal_); + m.impl("log_normal_", log_normal_); // Geometric - m.impl_UNBOXED("geometric_", geometric_); + m.impl("geometric_", geometric_); // Exponential - m.impl_UNBOXED("exponential_", exponential_); + m.impl("exponential_", exponential_); // Random permutation - m.impl_UNBOXED("randperm.generator_out", randperm_generator_out); + m.impl("randperm.generator_out", randperm_generator_out); } PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { From caf561f057501d77f97802776f2c06d0859c9f38 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 17 Dec 2020 04:30:37 -0800 Subject: [PATCH 146/750] 2020-12-17 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From ad0bda47dbe8db03eb9479517a0402f94f345b25 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 18 Dec 2020 04:30:38 -0800 Subject: [PATCH 147/750] 2020-12-18 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From d4bd89f9d37df17b5e1d8f6456df269c2fca6d36 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 19 Dec 2020 04:30:42 -0800 Subject: [PATCH 148/750] 2020-12-19 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 6180fb0af455a463cb3a8f5fc38007b523fbb64c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 20 Dec 2020 04:30:38 -0800 Subject: [PATCH 149/750] 2020-12-20 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 7a1a9a1f914dc71a3f8df4c4d177306d84dc85cb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 21 Dec 2020 04:30:38 -0800 Subject: [PATCH 150/750] 2020-12-21 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 9b1a6a6d5542d4333fbd5c4b30a032cd120a73ae Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 22 Dec 2020 04:30:32 -0800 Subject: [PATCH 151/750] 2020-12-22 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 351c1bc617ccc8eb4e1666220a24bb315a7e7e24 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 23 Dec 2020 04:30:37 -0800 Subject: [PATCH 152/750] 2020-12-23 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 20c2a3be1271700b2a645daac6dae164fdc27118 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 24 Dec 2020 04:30:35 -0800 Subject: [PATCH 153/750] 2020-12-24 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 1b4431e99d077c2b37932e566e53b55b852bf24a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 25 Dec 2020 04:30:33 -0800 Subject: [PATCH 154/750] 2020-12-25 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From c3b0448246349cd2bfb74eb1238785cf01b571a6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 26 Dec 2020 04:30:36 -0800 Subject: [PATCH 155/750] 2020-12-26 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 62093773d9e505f1e686e985d90e8e0ca6793c9c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 27 Dec 2020 04:30:48 -0800 Subject: [PATCH 156/750] 2020-12-27 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 7822be9e0f9873fe762070cd1641749c71dbf434 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 28 Dec 2020 04:30:32 -0800 Subject: [PATCH 157/750] 2020-12-28 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 6777630709d25cf7f7338c6adeee9d2930e27ea1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 29 Dec 2020 04:30:35 -0800 Subject: [PATCH 158/750] 2020-12-29 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 5e778bcd9eaf5e169b66d302469defe82ef6ad86 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 30 Dec 2020 04:30:40 -0800 Subject: [PATCH 159/750] 2020-12-30 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 0fd33829cb27ad75fd11a661f291176111ddccb1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 31 Dec 2020 04:30:36 -0800 Subject: [PATCH 160/750] 2020-12-31 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From c02b34bd86fbc6cc57e5c7ed7c56deec66adabcb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 1 Jan 2021 04:30:42 -0800 Subject: [PATCH 161/750] 2021-01-01 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From de8114cf897d0f173e059a022c45a127da5b7e5e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 2 Jan 2021 04:30:44 -0800 Subject: [PATCH 162/750] 2021-01-02 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 7f484f062f9aedb56393a282f295210bab48a041 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 3 Jan 2021 04:30:35 -0800 Subject: [PATCH 163/750] 2021-01-03 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From b6fbb3b09445381963785ec596ab7a865ee2947b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 4 Jan 2021 04:30:34 -0800 Subject: [PATCH 164/750] 2021-01-04 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 2ca1a469168463755933f0ad71fbb06c4b1e2482 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 5 Jan 2021 04:31:04 -0800 Subject: [PATCH 165/750] 2021-01-05 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From fcd1fbb7b213fe8b957717a75642541e0d754bfe Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 6 Jan 2021 04:30:33 -0800 Subject: [PATCH 166/750] 2021-01-06 nightly release (ba3bcabfd0141ac6e67245114471f8cd1f21a7c0) From 4e781eab15f4b941198e86eaaa64501edd10900a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 7 Jan 2021 04:30:37 -0800 Subject: [PATCH 167/750] 2021-01-07 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) --- torchcsprng/csrc/kernels_commons.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/torchcsprng/csrc/kernels_commons.h b/torchcsprng/csrc/kernels_commons.h index 0a28d1f..8f20e3c 100644 --- a/torchcsprng/csrc/kernels_commons.h +++ b/torchcsprng/csrc/kernels_commons.h @@ -37,6 +37,9 @@ struct CSPRNGGeneratorImpl : public c10::GeneratorImpl { static at::DeviceType device_type() { return at::DeviceType::CPU; } + void set_state(const c10::TensorImpl& new_state) override { throw std::runtime_error("not implemented"); } + c10::intrusive_ptr get_state() const override { throw std::runtime_error("not implemented"); } + bool use_rd_; std::random_device rd_; std::mt19937 mt_; From 301ec55c454c0c49f6f9ba576538882e2b5aee36 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 8 Jan 2021 04:30:38 -0800 Subject: [PATCH 168/750] 2021-01-08 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 8128c74da5875936e01d252c8ec26f3ab0832d05 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 9 Jan 2021 04:30:33 -0800 Subject: [PATCH 169/750] 2021-01-09 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From ba97242078c973f0d8814c06787dcff35279faf3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 10 Jan 2021 04:30:38 -0800 Subject: [PATCH 170/750] 2021-01-10 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From be4a28f6cb5af8b0f3446be504d4ef4de5eae5e1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 11 Jan 2021 04:30:55 -0800 Subject: [PATCH 171/750] 2021-01-11 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 16f62a6a4ff3ae48dc5245caded979f6fac4c9c6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 12 Jan 2021 04:30:37 -0800 Subject: [PATCH 172/750] 2021-01-12 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 35ee6206bd9c9b7083a075edb7887dd3410f209a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 13 Jan 2021 04:30:44 -0800 Subject: [PATCH 173/750] 2021-01-13 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 8b3d4417d3165ed250e3be5782ce3e34fe95c725 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 14 Jan 2021 04:30:56 -0800 Subject: [PATCH 174/750] 2021-01-14 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 915bf5cbcf1d93fddc0c8a8c835938a5b52ee1bd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 15 Jan 2021 04:30:41 -0800 Subject: [PATCH 175/750] 2021-01-15 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 949867709c785941e715bd6bdce7faf48232a3f6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 16 Jan 2021 04:30:56 -0800 Subject: [PATCH 176/750] 2021-01-16 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From e3539c7e59a13a7abcf10456575825cb015e1ea8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 17 Jan 2021 04:31:10 -0800 Subject: [PATCH 177/750] 2021-01-17 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From ebbb55902449031c41b512ba908373eaf1ce7074 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 18 Jan 2021 04:31:33 -0800 Subject: [PATCH 178/750] 2021-01-18 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From c1a35d7aa43129b1baa8828f2bc442ebe3053cf2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 19 Jan 2021 04:30:39 -0800 Subject: [PATCH 179/750] 2021-01-19 nightly release (876dfbdc6292ee8ce56bb31f9a04dbe061e5f6bb) From 81a3a876c0a1881b0fad18a71d05c9c9783f674e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 20 Jan 2021 04:30:38 -0800 Subject: [PATCH 180/750] 2021-01-20 nightly release (0c02bb21d3e6d204cd3b1f49faa489b6161d712d) --- .circleci/config.yml | 153 ------------------------------------------- 1 file changed, 153 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e7a1f6..000a315 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -446,11 +446,6 @@ workflows: name: binary_linux_wheel_py3.6_cpu python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_wheel: - cu_version: cu92 - name: binary_linux_wheel_py3.6_cu92 - python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_wheel: cu_version: cu101 name: binary_linux_wheel_py3.6_cu101 @@ -471,11 +466,6 @@ workflows: name: binary_linux_wheel_py3.7_cpu python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_wheel: - cu_version: cu92 - name: binary_linux_wheel_py3.7_cu92 - python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_wheel: cu_version: cu101 name: binary_linux_wheel_py3.7_cu101 @@ -496,11 +486,6 @@ workflows: name: binary_linux_wheel_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_wheel: - cu_version: cu92 - name: binary_linux_wheel_py3.8_cu92 - python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_wheel: cu_version: cu101 name: binary_linux_wheel_py3.8_cu101 @@ -634,11 +619,6 @@ workflows: name: binary_linux_conda_py3.6_cpu python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_conda: - cu_version: cu92 - name: binary_linux_conda_py3.6_cu92 - python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_conda: cu_version: cu101 name: binary_linux_conda_py3.6_cu101 @@ -659,11 +639,6 @@ workflows: name: binary_linux_conda_py3.7_cpu python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_conda: - cu_version: cu92 - name: binary_linux_conda_py3.7_cu92 - python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_conda: cu_version: cu101 name: binary_linux_conda_py3.7_cu101 @@ -684,11 +659,6 @@ workflows: name: binary_linux_conda_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 - - binary_linux_conda: - cu_version: cu92 - name: binary_linux_conda_py3.8_cu92 - python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda92 - binary_linux_conda: cu_version: cu101 name: binary_linux_conda_py3.8_cu101 @@ -930,27 +900,6 @@ workflows: requires: - nightly_binary_linux_wheel_py3.6_cpu subfolder: cpu/ - - binary_linux_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.6_cu92 - python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.6_cu92_upload - requires: - - nightly_binary_linux_wheel_py3.6_cu92 - subfolder: cu92/ - binary_linux_wheel: cu_version: cu101 filters: @@ -1035,27 +984,6 @@ workflows: requires: - nightly_binary_linux_wheel_py3.7_cpu subfolder: cpu/ - - binary_linux_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.7_cu92 - python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.7_cu92_upload - requires: - - nightly_binary_linux_wheel_py3.7_cu92 - subfolder: cu92/ - binary_linux_wheel: cu_version: cu101 filters: @@ -1140,27 +1068,6 @@ workflows: requires: - nightly_binary_linux_wheel_py3.8_cpu subfolder: cpu/ - - binary_linux_wheel: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.8_cu92 - python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_wheel_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.8_cu92_upload - requires: - - nightly_binary_linux_wheel_py3.8_cu92 - subfolder: cu92/ - binary_linux_wheel: cu_version: cu101 filters: @@ -1547,26 +1454,6 @@ workflows: name: nightly_binary_linux_conda_py3.6_cpu_upload requires: - nightly_binary_linux_conda_py3.6_cpu - - binary_linux_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.6_cu92 - python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.6_cu92_upload - requires: - - nightly_binary_linux_conda_py3.6_cu92 - binary_linux_conda: cu_version: cu101 filters: @@ -1647,26 +1534,6 @@ workflows: name: nightly_binary_linux_conda_py3.7_cpu_upload requires: - nightly_binary_linux_conda_py3.7_cpu - - binary_linux_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.7_cu92 - python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.7_cu92_upload - requires: - - nightly_binary_linux_conda_py3.7_cu92 - binary_linux_conda: cu_version: cu101 filters: @@ -1747,26 +1614,6 @@ workflows: name: nightly_binary_linux_conda_py3.8_cpu_upload requires: - nightly_binary_linux_conda_py3.8_cpu - - binary_linux_conda: - cu_version: cu92 - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.8_cu92 - python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda92 - - binary_conda_upload: - context: org-member - filters: - branches: - only: nightly - tags: - only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.8_cu92_upload - requires: - - nightly_binary_linux_conda_py3.8_cu92 - binary_linux_conda: cu_version: cu101 filters: From da7b3c47ac34db002b3b63385b6065721140d243 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 21 Jan 2021 04:30:58 -0800 Subject: [PATCH 181/750] 2021-01-21 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) --- .circleci/config.yml | 491 ++++++++++++++++++ .../unittest/linux/scripts/environment.yml | 1 + .../unittest/windows/scripts/environment.yml | 1 + packaging/pkg_helpers.bash | 1 + packaging/windows/templates/build_task.yml | 12 + setup.py | 3 + 6 files changed, 509 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 000a315..7d609e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -160,6 +160,10 @@ jobs: xcode: "9.4.1" steps: - checkout_merge +# - run: +# name: Install libomp +# command: HOMEBREW_NO_AUTO_UPDATE=1 brew install libomp +# # Disable brew auto update which is very slow - run: # Cannot easily deduplicate this as source'ing activate # will set environment variables which we need to propagate @@ -182,6 +186,10 @@ jobs: xcode: "9.4.1" steps: - checkout_merge +# - run: +# name: Install libomp +# command: HOMEBREW_NO_AUTO_UPDATE=1 brew install libomp +# # Disable brew auto update which is very slow - run: command: | curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh @@ -406,6 +414,10 @@ jobs: name: Install wget command: HOMEBREW_NO_AUTO_UPDATE=1 brew install wget # Disable brew auto update which is very slow +# - run: +# name: Install libomp +# command: HOMEBREW_NO_AUTO_UPDATE=1 brew install libomp +# # Disable brew auto update which is very slow - run: name: Generate cache key # This will refresh cache on Sundays, nightly build should generate new cache. @@ -501,6 +513,26 @@ workflows: name: binary_linux_wheel_py3.8_cu110 python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda110 + - binary_linux_wheel: + cu_version: cpu + name: binary_linux_wheel_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_wheel: + cu_version: cu101 + name: binary_linux_wheel_py3.9_cu101 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda101 + - binary_linux_wheel: + cu_version: cu102 + name: binary_linux_wheel_py3.9_cu102 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_wheel: + cu_version: cu110 + name: binary_linux_wheel_py3.9_cu110 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_macos_wheel: cu_version: cpu name: binary_macos_wheel_py3.6_cpu @@ -516,6 +548,11 @@ workflows: name: binary_macos_wheel_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 + - binary_macos_wheel: + cu_version: cpu + name: binary_macos_wheel_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 - binary_win_wheel: cu_version: cpu filters: @@ -614,6 +651,32 @@ workflows: cu_version: cu110 name: binary_win_wheel_py3.8_cu110 python_version: '3.8' + - binary_win_wheel: + cu_version: cpu + name: binary_win_wheel_py3.9_cpu + python_version: '3.9' + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.9_cu101 + python_version: '3.9' + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_wheel_py3.9_cu102 + python_version: '3.9' + - binary_win_wheel: + cu_version: cu110 + name: binary_win_wheel_py3.9_cu110 + python_version: '3.9' - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.6_cpu @@ -674,6 +737,26 @@ workflows: name: binary_linux_conda_py3.8_cu110 python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda110 + - binary_linux_conda: + cu_version: cpu + name: binary_linux_conda_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_conda: + cu_version: cu101 + name: binary_linux_conda_py3.9_cu101 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda101 + - binary_linux_conda: + cu_version: cu102 + name: binary_linux_conda_py3.9_cu102 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_linux_conda: + cu_version: cu110 + name: binary_linux_conda_py3.9_cu110 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda110 - binary_macos_conda: cu_version: cpu name: binary_macos_conda_py3.6_cpu @@ -689,6 +772,11 @@ workflows: name: binary_macos_conda_py3.8_cpu python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 +# - binary_macos_conda: +# cu_version: cpu +# name: binary_macos_conda_py3.9_cpu +# python_version: '3.9' +# wheel_docker_image: pytorch/manylinux-cuda102 - binary_win_conda: cu_version: cpu filters: @@ -787,6 +875,32 @@ workflows: cu_version: cu110 name: binary_win_conda_py3.8_cu110 python_version: '3.8' + - binary_win_conda: + cu_version: cpu + name: binary_win_conda_py3.9_cpu + python_version: '3.9' + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.9_cu101 + python_version: '3.9' + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: master + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: binary_win_conda_py3.9_cu102 + python_version: '3.9' + - binary_win_conda: + cu_version: cu110 + name: binary_win_conda_py3.9_cu110 + python_version: '3.9' # - python_lint # - python_type_check # - clang_format @@ -827,6 +941,10 @@ workflows: cu_version: cu101 name: unittest_linux_gpu_py3.8 python_version: '3.8' + - unittest_linux_gpu: + cu_version: cu101 + name: unittest_linux_gpu_py3.9 + python_version: '3.9' - unittest_windows_cpu: cu_version: cpu name: unittest_windows_cpu_py3.6 @@ -839,6 +957,10 @@ workflows: cu_version: cpu name: unittest_windows_cpu_py3.8 python_version: '3.8' + - unittest_windows_cpu: + cu_version: cpu + name: unittest_windows_cpu_py3.9 + python_version: '3.9' - unittest_windows_gpu: cu_version: cu101 filters: @@ -861,6 +983,10 @@ workflows: cu_version: cu101 name: unittest_windows_gpu_py3.8 python_version: '3.8' + - unittest_windows_gpu: + cu_version: cu101 + name: unittest_windows_gpu_py3.9 + python_version: '3.9' - unittest_macos_cpu: cu_version: cpu name: unittest_macos_cpu_py3.6 @@ -873,6 +999,10 @@ workflows: cu_version: cpu name: unittest_macos_cpu_py3.8 python_version: '3.8' +# - unittest_macos_cpu: +# cu_version: cpu +# name: unittest_macos_cpu_py3.9 +# python_version: '3.9' nightly: jobs: # - circleci_consistency @@ -1131,6 +1261,90 @@ workflows: requires: - nightly_binary_linux_wheel_py3.8_cu110 subfolder: cu110/ + - binary_linux_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py39_cpu_upload + requires: + - nightly_binary_linux_wheel_py3.9_cpu + subfolder: cpu/ + - binary_linux_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu101 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda101 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu101_upload + requires: + - nightly_binary_linux_wheel_py3.9_cu101 + subfolder: cu101/ + - binary_linux_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu102 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu102_upload + requires: + - nightly_binary_linux_wheel_py3.9_cu102 + subfolder: cu102/ + - binary_linux_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu110 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_wheel_py3.9_cu110_upload + requires: + - nightly_binary_linux_wheel_py3.9_cu110 + subfolder: cu110/ - binary_macos_wheel: cu_version: cpu filters: @@ -1194,6 +1408,27 @@ workflows: requires: - nightly_binary_macos_wheel_py3.8_cpu subfolder: '' + - binary_macos_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_macos_wheel_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_macos_wheel_py3.9_cpu_upload + requires: + - nightly_binary_macos_wheel_py3.9_cpu + subfolder: '' - binary_win_wheel: cu_version: cpu filters: @@ -1434,6 +1669,86 @@ workflows: requires: - nightly_binary_win_wheel_py3.8_cu110 subfolder: cu110/ + - binary_win_wheel: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cpu + python_version: '3.9' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cpu_upload + requires: + - nightly_binary_win_wheel_py3.9_cpu + subfolder: cpu/ + - binary_win_wheel: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu101 + python_version: '3.9' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu101_upload + requires: + - nightly_binary_win_wheel_py3.9_cu101 + subfolder: cu101/ + - binary_win_wheel: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu102 + python_version: '3.9' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu102_upload + requires: + - nightly_binary_win_wheel_py3.9_cu102 + subfolder: cu102/ + - binary_win_wheel: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu110 + python_version: '3.9' + - binary_wheel_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_wheel_py3.9_cu110_upload + requires: + - nightly_binary_win_wheel_py3.9_cu110 + subfolder: cu110/ - binary_linux_conda: cu_version: cpu filters: @@ -1674,6 +1989,86 @@ workflows: name: nightly_binary_linux_conda_py3.8_cu110_upload requires: - nightly_binary_linux_conda_py3.8_cu110 + - binary_linux_conda: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cpu + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cpu_upload + requires: + - nightly_binary_linux_conda_py3.9_cpu + - binary_linux_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu101 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda101 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu101_upload + requires: + - nightly_binary_linux_conda_py3.9_cu101 + - binary_linux_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu102 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda102 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu102_upload + requires: + - nightly_binary_linux_conda_py3.9_cu102 + - binary_linux_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu110 + python_version: '3.9' + wheel_docker_image: pytorch/manylinux-cuda110 + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_linux_conda_py3.9_cu110_upload + requires: + - nightly_binary_linux_conda_py3.9_cu110 - binary_macos_conda: cu_version: cpu filters: @@ -1734,6 +2129,26 @@ workflows: name: nightly_binary_macos_conda_py3.8_cpu_upload requires: - nightly_binary_macos_conda_py3.8_cpu +# - binary_macos_conda: +# cu_version: cpu +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_macos_conda_py3.9_cpu +# python_version: '3.9' +# wheel_docker_image: pytorch/manylinux-cuda102 +# - binary_conda_upload: +# context: org-member +# filters: +# branches: +# only: nightly +# tags: +# only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ +# name: nightly_binary_macos_conda_py3.9_cpu_upload +# requires: +# - nightly_binary_macos_conda_py3.9_cpu - binary_win_conda: cu_version: cpu filters: @@ -1962,3 +2377,79 @@ workflows: name: nightly_binary_win_conda_py3.8_cu110_upload requires: - nightly_binary_win_conda_py3.8_cu110 + - binary_win_conda: + cu_version: cpu + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cpu + python_version: '3.9' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cpu_upload + requires: + - nightly_binary_win_conda_py3.9_cpu + - binary_win_conda: + cu_version: cu101 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu101 + python_version: '3.9' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu101_upload + requires: + - nightly_binary_win_conda_py3.9_cu101 + - binary_win_conda: + cu_version: cu102 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu102 + python_version: '3.9' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu102_upload + requires: + - nightly_binary_win_conda_py3.9_cu102 + - binary_win_conda: + cu_version: cu110 + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu110 + python_version: '3.9' + - binary_conda_upload: + context: org-member + filters: + branches: + only: nightly + tags: + only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ + name: nightly_binary_win_conda_py3.9_cu110_upload + requires: + - nightly_binary_win_conda_py3.9_cu110 diff --git a/.circleci/unittest/linux/scripts/environment.yml b/.circleci/unittest/linux/scripts/environment.yml index f92ccca..ca96279 100644 --- a/.circleci/unittest/linux/scripts/environment.yml +++ b/.circleci/unittest/linux/scripts/environment.yml @@ -1,5 +1,6 @@ channels: - pytorch + - conda-forge - defaults dependencies: - numpy diff --git a/.circleci/unittest/windows/scripts/environment.yml b/.circleci/unittest/windows/scripts/environment.yml index f92ccca..ca96279 100644 --- a/.circleci/unittest/windows/scripts/environment.yml +++ b/.circleci/unittest/windows/scripts/environment.yml @@ -1,5 +1,6 @@ channels: - pytorch + - conda-forge - defaults dependencies: - numpy diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 06da1cc..44d074d 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -194,6 +194,7 @@ setup_wheel_python() { 3.6) python_abi=cp36-cp36m ;; 3.7) python_abi=cp37-cp37m ;; 3.8) python_abi=cp38-cp38 ;; + 3.9) python_abi=cp39-cp39 ;; *) echo "Unrecognized PYTHON_VERSION=$PYTHON_VERSION" exit 1 diff --git a/packaging/windows/templates/build_task.yml b/packaging/windows/templates/build_task.yml index 124e4a1..18d4f8e 100644 --- a/packaging/windows/templates/build_task.yml +++ b/packaging/windows/templates/build_task.yml @@ -58,6 +58,9 @@ jobs: PY3.8: DESIRED_PYTHON: 3.8 CUDA_VERSION: cpu + PY3.9: + DESIRED_PYTHON: 3.9 + CUDA_VERSION: cpu ${{ if ne(parameters.spec, 'CPU') }}: PY3.5_92: DESIRED_PYTHON: 3.5 @@ -71,6 +74,9 @@ jobs: PY3.8_92: DESIRED_PYTHON: 3.8 CUDA_VERSION: 92 + PY3.9_92: + DESIRED_PYTHON: 3.9 + CUDA_VERSION: 92 PY3.5_101: DESIRED_PYTHON: 3.5 CUDA_VERSION: 101 @@ -83,6 +89,9 @@ jobs: PY3.8_101: DESIRED_PYTHON: 3.8 CUDA_VERSION: 101 + PY3.9_101: + DESIRED_PYTHON: 3.9 + CUDA_VERSION: 101 PY3.5_102: DESIRED_PYTHON: 3.5 CUDA_VERSION: 102 @@ -95,6 +104,9 @@ jobs: PY3.8_102: DESIRED_PYTHON: 3.8 CUDA_VERSION: 102 + PY3.9_102: + DESIRED_PYTHON: 3.9 + CUDA_VERSION: 102 pool: ${{ if eq(parameters.msagent, 'true') }}: diff --git a/setup.py b/setup.py index 1559737..b165357 100644 --- a/setup.py +++ b/setup.py @@ -88,6 +88,8 @@ def get_extensions(): cxx_flags = append_flags(cxx_flags, ['-fopenmp']) elif sys.platform == 'win32': cxx_flags = append_flags(cxx_flags, ['/openmp']) + # elif sys.platform == 'darwin': + # cxx_flags = append_flags(cxx_flags, ['-Xpreprocessor', '-fopenmp']) if build_cuda: extension = CUDAExtension @@ -167,6 +169,7 @@ def run(self): 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Artificial Intelligence', From 66fa00f6048a79a91d3ba96d99d0411b53aa3d0b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 22 Jan 2021 04:30:35 -0800 Subject: [PATCH 182/750] 2021-01-22 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From c6b15b3f356419864919d033c6c4c1460744febe Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 23 Jan 2021 04:31:00 -0800 Subject: [PATCH 183/750] 2021-01-23 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From 92aba8186a198b8b1eaa61d3d4d26ecae9566fc0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 24 Jan 2021 04:30:50 -0800 Subject: [PATCH 184/750] 2021-01-24 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From 05cfa70cbc91e23a544c2db43fbdc1d9b1156d2c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 25 Jan 2021 04:31:59 -0800 Subject: [PATCH 185/750] 2021-01-25 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From d5ea4f351f899bfb11f3fcb2c93ed14611462ea7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 27 Jan 2021 04:30:22 -0800 Subject: [PATCH 186/750] 2021-01-27 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From 14373da2067ab2fec3fec3cd0d08cf4c6b8b6be5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 28 Jan 2021 04:30:16 -0800 Subject: [PATCH 187/750] 2021-01-28 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From e194a37e174e2c48bd7cd7d16f6adb967c5a773b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 29 Jan 2021 04:30:15 -0800 Subject: [PATCH 188/750] 2021-01-29 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From 0e15d6e9f6f0c7d94c607f6e43608d888307d107 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 30 Jan 2021 04:30:14 -0800 Subject: [PATCH 189/750] 2021-01-30 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From d3ac176f8482b33042758582f9c980d611c622b7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 31 Jan 2021 04:31:09 -0800 Subject: [PATCH 190/750] 2021-01-31 nightly release (a37f5a7d0cad322ac83c5ba41f179c9e3319ee83) From 7de13d28fcd1bdac4f4c4dec2b46af9e335aece6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 1 Feb 2021 04:30:13 -0800 Subject: [PATCH 191/750] 2021-02-01 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) --- test/test_csprng.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_csprng.py b/test/test_csprng.py index 8fc89cb..feedde9 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -297,6 +297,7 @@ def test_non_contiguous_vs_contiguous(self): if not x1 <= x < x2 and not y1 <= y < y2 and not z1 <= z < z2: self.assertTrue(t[x, y, z] == 0) + @unittest.skipIf(IS_SANDCASTLE or IS_FBCODE, "Does not work on Sandcastle") @unittest.skipIf(torch.get_num_threads() < 2, "requires multithreading CPU") def test_cpu_parallel(self): urandom_gen = csprng.create_random_device_generator('/dev/urandom') From 36e3ec5ff1863ef7b1ed3a5df45e22ca84d95546 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 2 Feb 2021 04:30:11 -0800 Subject: [PATCH 192/750] 2021-02-02 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 076f9fe593a124e7453db92540cedc1058a8cfd6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 3 Feb 2021 04:30:41 -0800 Subject: [PATCH 193/750] 2021-02-03 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From c9abe6d2953982113890b64668ad531951171366 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 4 Feb 2021 04:30:27 -0800 Subject: [PATCH 194/750] 2021-02-04 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 362eacfd82701c4cef36aea354eeab4b5633f8f4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 5 Feb 2021 04:30:20 -0800 Subject: [PATCH 195/750] 2021-02-05 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From f41beff1750131cac06576879998aa46e7907dce Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 6 Feb 2021 04:30:14 -0800 Subject: [PATCH 196/750] 2021-02-06 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From fb60edd9804939f15e5d263bf4a8313e06f748d6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 7 Feb 2021 04:30:12 -0800 Subject: [PATCH 197/750] 2021-02-07 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 8241f792fce076f00e858975c2c7d4ec6bdbcc2e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 8 Feb 2021 04:30:21 -0800 Subject: [PATCH 198/750] 2021-02-08 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 336c203b3880b5511ec8fba8020071ae5ed6cf72 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 9 Feb 2021 04:30:09 -0800 Subject: [PATCH 199/750] 2021-02-09 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From fd7368bfc91ad14a5b69427e8e096ebc594e257d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 10 Feb 2021 04:30:10 -0800 Subject: [PATCH 200/750] 2021-02-10 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From ad9b82c992b81601afb8d4186994b901ec7f8e0a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 11 Feb 2021 04:30:16 -0800 Subject: [PATCH 201/750] 2021-02-11 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 75db49815a289eeef08f88d085a95df95d3dbd85 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 12 Feb 2021 04:30:13 -0800 Subject: [PATCH 202/750] 2021-02-12 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From f6b89855c34e8db28e8741a40dec05a858932724 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 13 Feb 2021 04:30:17 -0800 Subject: [PATCH 203/750] 2021-02-13 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From e62c377492b6370e9b2bcf4abc735989b71ec55d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 14 Feb 2021 04:30:19 -0800 Subject: [PATCH 204/750] 2021-02-14 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 73878cd5396ca3dd51613c480abba82189522d17 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 15 Feb 2021 04:30:22 -0800 Subject: [PATCH 205/750] 2021-02-15 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 1c0310e1ef26fba03f7e51a5c7791f6130d9bedc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 16 Feb 2021 04:30:15 -0800 Subject: [PATCH 206/750] 2021-02-16 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 652b90ad5ac781bfe1000420a0837f31d3aec48a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 17 Feb 2021 04:30:08 -0800 Subject: [PATCH 207/750] 2021-02-17 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 28864f1ed9d550d2ece1dc954d4b79fdf031df75 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 18 Feb 2021 04:30:09 -0800 Subject: [PATCH 208/750] 2021-02-18 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 46f119bf28f44bda8b0339ad151cd59a4b275c57 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 19 Feb 2021 04:31:18 -0800 Subject: [PATCH 209/750] 2021-02-19 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From da95f632a05445757ef504a3d96d25691a4bde2f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 20 Feb 2021 04:30:12 -0800 Subject: [PATCH 210/750] 2021-02-20 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 08f2c37197b24c9bd6c02529fcd16284f902685f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 21 Feb 2021 04:30:13 -0800 Subject: [PATCH 211/750] 2021-02-21 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 4756e3d912304b8d69d09abe01775f480bd0cd91 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 22 Feb 2021 04:30:21 -0800 Subject: [PATCH 212/750] 2021-02-22 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From f5abe5c511eb5bb299a60870ae515cb3ac79ec2c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 23 Feb 2021 04:30:17 -0800 Subject: [PATCH 213/750] 2021-02-23 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 710b67781652e9a7f0019fb3af4d7f816925f9e9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 24 Feb 2021 11:15:26 -0800 Subject: [PATCH 214/750] 2021-02-24 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From f64fce7ddbaece7eb676b3dc6e06549ca92ccdbd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 25 Feb 2021 04:30:23 -0800 Subject: [PATCH 215/750] 2021-02-25 nightly release (11255665f11f3de6823d9df2e89e24e3dd32a065) From 5cbd817abcd9fa7980c7809817b2d8f01347134f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 26 Feb 2021 04:30:18 -0800 Subject: [PATCH 216/750] 2021-02-26 nightly release (3122f456523be981d4271a060a172447875564b9) --- .circleci/config.yml | 245 ++++++++++---------- packaging/pkg_helpers.bash | 28 +++ packaging/windows/internal/cuda_install.bat | 40 ++++ 3 files changed, 192 insertions(+), 121 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d609e9..0c32bf8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,7 +98,9 @@ jobs: resource_class: 2xlarge+ steps: - checkout_merge - - run: packaging/build_conda.sh + - run: + no_output_timeout: 20m + command: packaging/build_conda.sh - store_artifacts: path: /opt/conda/conda-bld/linux-64 - persist_to_workspace: @@ -115,6 +117,7 @@ jobs: - checkout_merge - run: name: Build conda packages + no_output_timeout: 20m command: | set -ex source packaging/windows/internal/vc_install_helper.sh @@ -469,10 +472,10 @@ workflows: python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_wheel: - cu_version: cu110 - name: binary_linux_wheel_py3.6_cu110 + cu_version: cu111 + name: binary_linux_wheel_py3.6_cu111 python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_wheel: cu_version: cpu name: binary_linux_wheel_py3.7_cpu @@ -489,10 +492,10 @@ workflows: python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_wheel: - cu_version: cu110 - name: binary_linux_wheel_py3.7_cu110 + cu_version: cu111 + name: binary_linux_wheel_py3.7_cu111 python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_wheel: cu_version: cpu name: binary_linux_wheel_py3.8_cpu @@ -509,10 +512,10 @@ workflows: python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_wheel: - cu_version: cu110 - name: binary_linux_wheel_py3.8_cu110 + cu_version: cu111 + name: binary_linux_wheel_py3.8_cu111 python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_wheel: cu_version: cpu name: binary_linux_wheel_py3.9_cpu @@ -529,10 +532,10 @@ workflows: python_version: '3.9' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_wheel: - cu_version: cu110 - name: binary_linux_wheel_py3.9_cu110 + cu_version: cu111 + name: binary_linux_wheel_py3.9_cu111 python_version: '3.9' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_macos_wheel: cu_version: cpu name: binary_macos_wheel_py3.6_cpu @@ -581,13 +584,13 @@ workflows: name: binary_win_wheel_py3.6_cu102 python_version: '3.6' - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: master tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.6_cu110 + name: binary_win_wheel_py3.6_cu111 python_version: '3.6' - binary_win_wheel: cu_version: cpu @@ -617,13 +620,13 @@ workflows: name: binary_win_wheel_py3.7_cu102 python_version: '3.7' - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: master tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_wheel_py3.7_cu110 + name: binary_win_wheel_py3.7_cu111 python_version: '3.7' - binary_win_wheel: cu_version: cpu @@ -648,8 +651,8 @@ workflows: name: binary_win_wheel_py3.8_cu102 python_version: '3.8' - binary_win_wheel: - cu_version: cu110 - name: binary_win_wheel_py3.8_cu110 + cu_version: cu111 + name: binary_win_wheel_py3.8_cu111 python_version: '3.8' - binary_win_wheel: cu_version: cpu @@ -674,8 +677,8 @@ workflows: name: binary_win_wheel_py3.9_cu102 python_version: '3.9' - binary_win_wheel: - cu_version: cu110 - name: binary_win_wheel_py3.9_cu110 + cu_version: cu111 + name: binary_win_wheel_py3.9_cu111 python_version: '3.9' - binary_linux_conda: cu_version: cpu @@ -693,10 +696,10 @@ workflows: python_version: '3.6' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_conda: - cu_version: cu110 - name: binary_linux_conda_py3.6_cu110 + cu_version: cu111 + name: binary_linux_conda_py3.6_cu111 python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.7_cpu @@ -713,10 +716,10 @@ workflows: python_version: '3.7' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_conda: - cu_version: cu110 - name: binary_linux_conda_py3.7_cu110 + cu_version: cu111 + name: binary_linux_conda_py3.7_cu111 python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.8_cpu @@ -733,10 +736,10 @@ workflows: python_version: '3.8' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_conda: - cu_version: cu110 - name: binary_linux_conda_py3.8_cu110 + cu_version: cu111 + name: binary_linux_conda_py3.8_cu111 python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_linux_conda: cu_version: cpu name: binary_linux_conda_py3.9_cpu @@ -753,10 +756,10 @@ workflows: python_version: '3.9' wheel_docker_image: pytorch/manylinux-cuda102 - binary_linux_conda: - cu_version: cu110 - name: binary_linux_conda_py3.9_cu110 + cu_version: cu111 + name: binary_linux_conda_py3.9_cu111 python_version: '3.9' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_macos_conda: cu_version: cpu name: binary_macos_conda_py3.6_cpu @@ -805,13 +808,13 @@ workflows: name: binary_win_conda_py3.6_cu102 python_version: '3.6' - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: master tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.6_cu110 + name: binary_win_conda_py3.6_cu111 python_version: '3.6' - binary_win_conda: cu_version: cpu @@ -841,13 +844,13 @@ workflows: name: binary_win_conda_py3.7_cu102 python_version: '3.7' - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: master tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: binary_win_conda_py3.7_cu110 + name: binary_win_conda_py3.7_cu111 python_version: '3.7' - binary_win_conda: cu_version: cpu @@ -872,8 +875,8 @@ workflows: name: binary_win_conda_py3.8_cu102 python_version: '3.8' - binary_win_conda: - cu_version: cu110 - name: binary_win_conda_py3.8_cu110 + cu_version: cu111 + name: binary_win_conda_py3.8_cu111 python_version: '3.8' - binary_win_conda: cu_version: cpu @@ -898,8 +901,8 @@ workflows: name: binary_win_conda_py3.9_cu102 python_version: '3.9' - binary_win_conda: - cu_version: cu110 - name: binary_win_conda_py3.9_cu110 + cu_version: cu111 + name: binary_win_conda_py3.9_cu111 python_version: '3.9' # - python_lint # - python_type_check @@ -1073,15 +1076,15 @@ workflows: - nightly_binary_linux_wheel_py3.6_cu102 subfolder: cu102/ - binary_linux_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.6_cu110 + name: nightly_binary_linux_wheel_py3.6_cu111 python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_wheel_upload: context: org-member filters: @@ -1089,10 +1092,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.6_cu110_upload + name: nightly_binary_linux_wheel_py3.6_cu111_upload requires: - - nightly_binary_linux_wheel_py3.6_cu110 - subfolder: cu110/ + - nightly_binary_linux_wheel_py3.6_cu111 + subfolder: cu111/ - binary_linux_wheel: cu_version: cpu filters: @@ -1157,15 +1160,15 @@ workflows: - nightly_binary_linux_wheel_py3.7_cu102 subfolder: cu102/ - binary_linux_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.7_cu110 + name: nightly_binary_linux_wheel_py3.7_cu111 python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_wheel_upload: context: org-member filters: @@ -1173,10 +1176,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.7_cu110_upload + name: nightly_binary_linux_wheel_py3.7_cu111_upload requires: - - nightly_binary_linux_wheel_py3.7_cu110 - subfolder: cu110/ + - nightly_binary_linux_wheel_py3.7_cu111 + subfolder: cu111/ - binary_linux_wheel: cu_version: cpu filters: @@ -1241,15 +1244,15 @@ workflows: - nightly_binary_linux_wheel_py3.8_cu102 subfolder: cu102/ - binary_linux_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.8_cu110 + name: nightly_binary_linux_wheel_py3.8_cu111 python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_wheel_upload: context: org-member filters: @@ -1257,10 +1260,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.8_cu110_upload + name: nightly_binary_linux_wheel_py3.8_cu111_upload requires: - - nightly_binary_linux_wheel_py3.8_cu110 - subfolder: cu110/ + - nightly_binary_linux_wheel_py3.8_cu111 + subfolder: cu111/ - binary_linux_wheel: cu_version: cpu filters: @@ -1325,15 +1328,15 @@ workflows: - nightly_binary_linux_wheel_py3.9_cu102 subfolder: cu102/ - binary_linux_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.9_cu110 + name: nightly_binary_linux_wheel_py3.9_cu111 python_version: '3.9' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_wheel_upload: context: org-member filters: @@ -1341,10 +1344,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_wheel_py3.9_cu110_upload + name: nightly_binary_linux_wheel_py3.9_cu111_upload requires: - - nightly_binary_linux_wheel_py3.9_cu110 - subfolder: cu110/ + - nightly_binary_linux_wheel_py3.9_cu111 + subfolder: cu111/ - binary_macos_wheel: cu_version: cpu filters: @@ -1490,13 +1493,13 @@ workflows: - nightly_binary_win_wheel_py3.6_cu102 subfolder: cu102/ - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu110 + name: nightly_binary_win_wheel_py3.6_cu111 python_version: '3.6' - binary_wheel_upload: context: org-member @@ -1505,10 +1508,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.6_cu110_upload + name: nightly_binary_win_wheel_py3.6_cu111_upload requires: - - nightly_binary_win_wheel_py3.6_cu110 - subfolder: cu110/ + - nightly_binary_win_wheel_py3.6_cu111 + subfolder: cu111/ - binary_win_wheel: cu_version: cpu filters: @@ -1570,13 +1573,13 @@ workflows: - nightly_binary_win_wheel_py3.7_cu102 subfolder: cu102/ - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu110 + name: nightly_binary_win_wheel_py3.7_cu111 python_version: '3.7' - binary_wheel_upload: context: org-member @@ -1585,10 +1588,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.7_cu110_upload + name: nightly_binary_win_wheel_py3.7_cu111_upload requires: - - nightly_binary_win_wheel_py3.7_cu110 - subfolder: cu110/ + - nightly_binary_win_wheel_py3.7_cu111 + subfolder: cu111/ - binary_win_wheel: cu_version: cpu filters: @@ -1650,13 +1653,13 @@ workflows: - nightly_binary_win_wheel_py3.8_cu102 subfolder: cu102/ - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu110 + name: nightly_binary_win_wheel_py3.8_cu111 python_version: '3.8' - binary_wheel_upload: context: org-member @@ -1665,10 +1668,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.8_cu110_upload + name: nightly_binary_win_wheel_py3.8_cu111_upload requires: - - nightly_binary_win_wheel_py3.8_cu110 - subfolder: cu110/ + - nightly_binary_win_wheel_py3.8_cu111 + subfolder: cu111/ - binary_win_wheel: cu_version: cpu filters: @@ -1730,13 +1733,13 @@ workflows: - nightly_binary_win_wheel_py3.9_cu102 subfolder: cu102/ - binary_win_wheel: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.9_cu110 + name: nightly_binary_win_wheel_py3.9_cu111 python_version: '3.9' - binary_wheel_upload: context: org-member @@ -1745,10 +1748,10 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_wheel_py3.9_cu110_upload + name: nightly_binary_win_wheel_py3.9_cu111_upload requires: - - nightly_binary_win_wheel_py3.9_cu110 - subfolder: cu110/ + - nightly_binary_win_wheel_py3.9_cu111 + subfolder: cu111/ - binary_linux_conda: cu_version: cpu filters: @@ -1810,15 +1813,15 @@ workflows: requires: - nightly_binary_linux_conda_py3.6_cu102 - binary_linux_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.6_cu110 + name: nightly_binary_linux_conda_py3.6_cu111 python_version: '3.6' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_conda_upload: context: org-member filters: @@ -1826,9 +1829,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.6_cu110_upload + name: nightly_binary_linux_conda_py3.6_cu111_upload requires: - - nightly_binary_linux_conda_py3.6_cu110 + - nightly_binary_linux_conda_py3.6_cu111 - binary_linux_conda: cu_version: cpu filters: @@ -1890,15 +1893,15 @@ workflows: requires: - nightly_binary_linux_conda_py3.7_cu102 - binary_linux_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.7_cu110 + name: nightly_binary_linux_conda_py3.7_cu111 python_version: '3.7' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_conda_upload: context: org-member filters: @@ -1906,9 +1909,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.7_cu110_upload + name: nightly_binary_linux_conda_py3.7_cu111_upload requires: - - nightly_binary_linux_conda_py3.7_cu110 + - nightly_binary_linux_conda_py3.7_cu111 - binary_linux_conda: cu_version: cpu filters: @@ -1970,15 +1973,15 @@ workflows: requires: - nightly_binary_linux_conda_py3.8_cu102 - binary_linux_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.8_cu110 + name: nightly_binary_linux_conda_py3.8_cu111 python_version: '3.8' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_conda_upload: context: org-member filters: @@ -1986,9 +1989,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.8_cu110_upload + name: nightly_binary_linux_conda_py3.8_cu111_upload requires: - - nightly_binary_linux_conda_py3.8_cu110 + - nightly_binary_linux_conda_py3.8_cu111 - binary_linux_conda: cu_version: cpu filters: @@ -2050,15 +2053,15 @@ workflows: requires: - nightly_binary_linux_conda_py3.9_cu102 - binary_linux_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.9_cu110 + name: nightly_binary_linux_conda_py3.9_cu111 python_version: '3.9' - wheel_docker_image: pytorch/manylinux-cuda110 + wheel_docker_image: pytorch/manylinux-cuda111 - binary_conda_upload: context: org-member filters: @@ -2066,9 +2069,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_linux_conda_py3.9_cu110_upload + name: nightly_binary_linux_conda_py3.9_cu111_upload requires: - - nightly_binary_linux_conda_py3.9_cu110 + - nightly_binary_linux_conda_py3.9_cu111 - binary_macos_conda: cu_version: cpu filters: @@ -2207,13 +2210,13 @@ workflows: requires: - nightly_binary_win_conda_py3.6_cu102 - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu110 + name: nightly_binary_win_conda_py3.6_cu111 python_version: '3.6' - binary_conda_upload: context: org-member @@ -2222,9 +2225,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.6_cu110_upload + name: nightly_binary_win_conda_py3.6_cu111_upload requires: - - nightly_binary_win_conda_py3.6_cu110 + - nightly_binary_win_conda_py3.6_cu111 - binary_win_conda: cu_version: cpu filters: @@ -2283,13 +2286,13 @@ workflows: requires: - nightly_binary_win_conda_py3.7_cu102 - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu110 + name: nightly_binary_win_conda_py3.7_cu111 python_version: '3.7' - binary_conda_upload: context: org-member @@ -2298,9 +2301,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.7_cu110_upload + name: nightly_binary_win_conda_py3.7_cu111_upload requires: - - nightly_binary_win_conda_py3.7_cu110 + - nightly_binary_win_conda_py3.7_cu111 - binary_win_conda: cu_version: cpu filters: @@ -2359,13 +2362,13 @@ workflows: requires: - nightly_binary_win_conda_py3.8_cu102 - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu110 + name: nightly_binary_win_conda_py3.8_cu111 python_version: '3.8' - binary_conda_upload: context: org-member @@ -2374,9 +2377,9 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.8_cu110_upload + name: nightly_binary_win_conda_py3.8_cu111_upload requires: - - nightly_binary_win_conda_py3.8_cu110 + - nightly_binary_win_conda_py3.8_cu111 - binary_win_conda: cu_version: cpu filters: @@ -2435,13 +2438,13 @@ workflows: requires: - nightly_binary_win_conda_py3.9_cu102 - binary_win_conda: - cu_version: cu110 + cu_version: cu111 filters: branches: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.9_cu110 + name: nightly_binary_win_conda_py3.9_cu111 python_version: '3.9' - binary_conda_upload: context: org-member @@ -2450,6 +2453,6 @@ workflows: only: nightly tags: only: /v[0-9]+(\.[0-9]+)*-rc[0-9]+/ - name: nightly_binary_win_conda_py3.9_cu110_upload + name: nightly_binary_win_conda_py3.9_cu111_upload requires: - - nightly_binary_win_conda_py3.9_cu110 + - nightly_binary_win_conda_py3.9_cu111 diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 44d074d..dad9622 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -49,6 +49,28 @@ setup_cuda() { # Now work out the CUDA settings case "$CU_VERSION" in + cu112) + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.2" + else + export CUDA_HOME=/usr/local/cuda-11.2/ + fi + export FORCE_CUDA=1 + # Hard-coding gencode flags is temporary situation until + # https://github.com/pytorch/pytorch/pull/23408 lands + export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_50,code=compute_50" + ;; + cu111) + if [[ "$OSTYPE" == "msys" ]]; then + export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1" + else + export CUDA_HOME=/usr/local/cuda-11.1/ + fi + export FORCE_CUDA=1 + # Hard-coding gencode flags is temporary situation until + # https://github.com/pytorch/pytorch/pull/23408 lands + export NVCC_FLAGS="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_86,code=sm_86 -gencode=arch=compute_50,code=compute_50" + ;; cu110) if [[ "$OSTYPE" == "msys" ]]; then export CUDA_HOME="C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.0" @@ -278,6 +300,12 @@ setup_conda_cudatoolkit_constraint() { export CONDA_CUDATOOLKIT_CONSTRAINT="" else case "$CU_VERSION" in + cu112) + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.2,<11.3 # [not osx]" + ;; + cu111) + export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.1,<11.2 # [not osx]" + ;; cu110) export CONDA_CUDATOOLKIT_CONSTRAINT="- cudatoolkit >=11.0,<11.1 # [not osx]" ;; diff --git a/packaging/windows/internal/cuda_install.bat b/packaging/windows/internal/cuda_install.bat index b6b26c0..9ca08e1 100644 --- a/packaging/windows/internal/cuda_install.bat +++ b/packaging/windows/internal/cuda_install.bat @@ -19,6 +19,8 @@ if %CUDA_VER% EQU 100 goto cuda100 if %CUDA_VER% EQU 101 goto cuda101 if %CUDA_VER% EQU 102 goto cuda102 if %CUDA_VER% EQU 110 goto cuda110 +if %CUDA_VER% EQU 111 goto cuda111 +if %CUDA_VER% EQU 112 goto cuda112 echo CUDA %CUDA_VERSION_STR% is not supported exit /b 1 @@ -107,6 +109,44 @@ if not exist "%SRC_DIR%\temp_build\cudnn-11.0-windows-x64-v8.0.4.30.zip" ( goto cuda_common +:cuda111 + +if not exist "%SRC_DIR%\temp_build\cuda_11.1.0_456.43_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cuda_11.1.0_456.43_win10.exe --output "%SRC_DIR%\temp_build\cuda_11.1.0_456.43_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_11.1.0_456.43_win10.exe" + set "ARGS=nvcc_11.1 cuobjdump_11.1 nvprune_11.1 nvprof_11.1 cupti_11.1 cublas_11.1 cublas_dev_11.1 cudart_11.1 cufft_11.1 cufft_dev_11.1 curand_11.1 curand_dev_11.1 cusolver_11.1 cusolver_dev_11.1 cusparse_11.1 cusparse_dev_11.1 npp_11.1 npp_dev_11.1 nvrtc_11.1 nvrtc_dev_11.1 nvml_dev_11.1" +) + +@REM There is no downloadable driver for Tesla on CUDA 11.1 yet. We will use +@REM the driver inside CUDA +if "%JOB_EXECUTOR%" == "windows-with-nvidia-gpu" set "ARGS=%ARGS% Display.Driver" + +if not exist "%SRC_DIR%\temp_build\cudnn-11.1-windows-x64-v8.0.5.39.zip" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cudnn-11.1-windows-x64-v8.0.5.39.zip --output "%SRC_DIR%\temp_build\cudnn-11.1-windows-x64-v8.0.5.39.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-11.1-windows-x64-v8.0.5.39.zip" +) + +goto cuda_common + +:cuda112 + +if not exist "%SRC_DIR%\temp_build\cuda_11.2.0_460.89_win10.exe" ( + curl -k -L https://ossci-windows.s3.amazonaws.com/cuda_11.2.0_460.89_win10.exe --output "%SRC_DIR%\temp_build\cuda_11.2.0_460.89_win10.exe" + if errorlevel 1 exit /b 1 + set "CUDA_SETUP_FILE=%SRC_DIR%\temp_build\cuda_11.2.0_460.89_win10.exe" + set "ARGS=nvcc_11.2 cuobjdump_11.2 nvprune_11.2 nvprof_11.2 cupti_11.2 cublas_11.2 cublas_dev_11.2 cudart_11.2 cufft_11.2 cufft_dev_11.2 curand_11.2 curand_dev_11.2 cusolver_11.2 cusolver_dev_11.2 cusparse_11.2 cusparse_dev_11.2 npp_11.2 npp_dev_11.2 nvrtc_11.2 nvrtc_dev_11.2 nvml_dev_11.2" +) + +if not exist "%SRC_DIR%\temp_build\cudnn-11.2-windows-x64-v8.1.0.77.zip" ( + curl -k -L http://s3.amazonaws.com/ossci-windows/cudnn-11.2-windows-x64-v8.1.0.77.zip --output "%SRC_DIR%\temp_build\cudnn-11.2-windows-x64-v8.1.0.77.zip" + if errorlevel 1 exit /b 1 + set "CUDNN_SETUP_FILE=%SRC_DIR%\temp_build\cudnn-11.2-windows-x64-v8.1.0.77.zip" +) + +goto cuda_common + :cuda_common if not exist "%SRC_DIR%\temp_build\NvToolsExt.7z" ( From 152dda148a94a295bcf6155d63a52ae5098145db Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 27 Feb 2021 04:30:12 -0800 Subject: [PATCH 217/750] 2021-02-27 nightly release (3122f456523be981d4271a060a172447875564b9) From 487462c78ef1e88c9a906e505aee677a45ecbb12 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 28 Feb 2021 04:30:14 -0800 Subject: [PATCH 218/750] 2021-02-28 nightly release (3122f456523be981d4271a060a172447875564b9) From 996a3f968331f084930f04ff1a5e19fc38a6c037 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 1 Mar 2021 04:30:30 -0800 Subject: [PATCH 219/750] 2021-03-01 nightly release (3122f456523be981d4271a060a172447875564b9) From f472155648d1505b3b6c76d25427e3bb0cf235bc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 2 Mar 2021 04:30:11 -0800 Subject: [PATCH 220/750] 2021-03-02 nightly release (3122f456523be981d4271a060a172447875564b9) From df681d244ef1a102c549065b331b4421c9f6135b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 3 Mar 2021 04:30:10 -0800 Subject: [PATCH 221/750] 2021-03-03 nightly release (3122f456523be981d4271a060a172447875564b9) From 52fc03d4edf9756559d98b703b2f98df392247fb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 4 Mar 2021 04:30:10 -0800 Subject: [PATCH 222/750] 2021-03-04 nightly release (0e6179d5c6c1f19f42ec92afedbc300940030a00) --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 9e8f5f9..c181bf5 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.0a0 +0.3.0a0 From 18c3d5c846e348597c0f6fe159789045850cc9df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 5 Mar 2021 04:30:19 -0800 Subject: [PATCH 223/750] 2021-03-05 nightly release (006936c38af8eb49b6e9922a3bcf34bf231730fb) --- README.md | 77 ++++++--- examples/csprng.ipynb | 226 ++++++++++++++++++++++++ examples/encrypt_decrypt.ipynb | 307 +++++++++++++++++++++++++++++++++ torchcsprng/__init__.py | 6 + 4 files changed, 591 insertions(+), 25 deletions(-) create mode 100644 examples/csprng.ipynb create mode 100644 examples/encrypt_decrypt.ipynb diff --git a/README.md b/README.md index bc4ce73..5d60005 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # PyTorch/CSPRNG -torchcsprng is a [PyTorch C++/CUDA extension](https://pytorch.org/tutorials/advanced/cpp_extension.html) that provides [cryptographically secure pseudorandom number generators](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) for PyTorch. - [![CircleCI](https://circleci.com/gh/pytorch/csprng.svg?style=shield&circle-token=64701692dd7f13f31019612289f0200fdb661dc2)](https://circleci.com/gh/pytorch/csprng) +torchcsprng is a [PyTorch C++/CUDA extension](https://pytorch.org/tutorials/advanced/cpp_extension.html) that provides: + +- [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) 128-bit encryption/decryption in two modes: [ECB](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)) and [CTR](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pytorch/csprng/blob/master/examples/encrypt_decrypt.ipynb) +- [cryptographically secure pseudorandom number generators](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) for PyTorch. [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pytorch/csprng/blob/master/examples/csprng.ipynb) + ## Design torchcsprng generates a random 128-bit key on CPU using one of its generators and runs @@ -22,6 +25,24 @@ Advantages: ## Features +torchcsprng 0.2.0 exposes new API for tensor encryption/decryption. Tensor encryption/decryption API is dtype agnostic, so a tensor of any dtype can be encrypted and the result can be stored to a tensor of any dtype. An encryption key also can be a tensor of any dtype. Currently torchcsprng supports [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) cipher with 128-bit key in two modes: [ECB](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)) and [CTR](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)). + +* `torchcsprng.encrypt(input: Tensor, output: Tensor, key: Tensor, cipher: string, mode: string)` + +> - `input` tensor can be any CPU or CUDA tensor of any dtype and size in bytes(zero-padding is used to make its size in bytes divisible by block size in bytes) +> - `output` tensor can have any dtype and the same device as `input` tensor and the size in bytes rounded up to the block size in bytes(16 bytes for AES 128) +> - `key` tensor can have any dtype and the same device as `input` tensor and size in bytes equal to 16 for AES 128 +> - `cipher` currently can be only one supported value `"aes128"` +> - `mode` currently can be either [`"ecb"`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)) or [`"ctr"`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) + +* `torchcsprng.decrypt(input: Tensor, output: Tensor, key: Tensor, cipher: string, mode: string)` + +> - `input` tensor can be any CPU or CUDA tensor of any dtype with size in bytes divisible by the block size in bytes(16 bytes for AES 128) +> - `output` tensor can have any dtype but the same device as `input` tensor and the same size in bytes as `input` tensor +> - `key` tensor can have any dtype and the same device as `input` tensor and size in bytes equal to 16 for AES 128 +> - `cipher` currently can be only one supported value `"aes128"` +> - `mode` currently can be either [`"ecb"`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)) or [`"ctr"`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) + torchcsprng exposes two methods to create crypto-secure and non-crypto-secure PRNGs: | Method to create PRNG | Is crypto-secure? | Has seed? | Underlying implementation | @@ -48,52 +69,58 @@ The following list of methods supports all forementioned PRNGs: ## Installation -CSPRNG works with Python 3.6/3.7/3.8 on the following operating systems and can be used with PyTorch tensors on the following devices: +CSPRNG works with Python 3.6-3.9 on the following operating systems and can be used with PyTorch tensors on the following devices: | Tensor Device Type | Linux | macOS | MS Window | |--------------------|-----------|---------------|----------------| | CPU | Supported | Supported | Supported | -| CUDA | Supported | Not Supported | Coming | +| CUDA | Supported | Not Supported | Supported since 0.2.0 | + +The following is the corresponding CSPRNG versions and supported Python versions. + +| PyTorch | CSPRNG | Python | CUDA | +|---------|--------|----------|------------------| +| 1.8.0 | 0.2.0 | 3.7-3.9 | 10.1, 10.2, 11.1 | +| 1.7.1 | 0.1.4 | 3.6-3.8 | 9.2, 10.1, 10.2 | +| 1.7.0 | 0.1.3 | 3.6-3.8 | 9.2, 10.1, 10.2 | +| 1.6.0 | 0.1.2 | 3.6-3.8 | 9.2, 10.1, 10.2 | + ### Binary Installation Anaconda: -| OS | CUDA | | -|---------|-----------------------------------------------|----------------------------------------------| -| Linux | 9.2

10.1

10.2

None | conda install torchcsprng cudatoolkit=9.2 -c pytorch

conda install torchcsprng cudatoolkit=10.1 -c pytorch

conda install torchcsprng cudatoolkit=10.2 -c pytorch

conda install torchcsprng cpuonly -c pytorch | -| macOS | None | conda install torchcsprng cpuonly -c pytorch | -| Windows | None | conda install torchcsprng cpuonly -c pytorch | +| OS | CUDA | | +|---------------|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Linux/Windows | 10.1

10.2

11.1

None | conda install torchcsprng cudatoolkit=10.1 -c pytorch -c conda-forge

conda install torchcsprng cudatoolkit=10.2 -c pytorch -c conda-forge

conda install torchcsprng cudatoolkit=11.1 -c pytorch -c conda-forge

conda install torchcsprng cpuonly -c pytorch -c conda-forge | +| macOS | None | conda install torchcsprng -c pytorch | pip: -| OS | CUDA | | -|---------|-----------------------------------------------|-------------------------------------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | pip install torchcsprng==0.1.2+cu92 torch==1.6.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng==0.1.2+cu101 torch==1.6.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

pip install torchcsprng torch

pip install torchcsprng==0.1.2+cpu torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | -| macOS | None | pip install torchcsprng torch | -| Windows | None | pip install torchcsprng torch -f https://download.pytorch.org/whl/torch_stable.html | +| OS | CUDA | | +|---------------|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Linux/Windows | 10.1

10.2

11.1

None | pip install torchcsprng==0.2.0+cu101 torch==1.8.0+cu101 -f https://download.pytorch.org/whl/cu101/torch_stable.html

pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu102/torch_stable.html

pip install torchcsprng==0.2.0+cu111 torch==1.8.0+cu111 -f https://download.pytorch.org/whl/cu111/torch_stable.html

pip install torchcsprng==0.2.0+cpu torch==1.8.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html | +| macOS | None | pip install torchcsprng torch | ### Nightly builds: Anaconda: -| OS | CUDA | | -|---------|-----------------------------------------------|------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | conda install torchcsprng cudatoolkit=9.2 -c pytorch-nightly

conda install torchcsprng cudatoolkit=10.1 -c pytorch-nightly

conda install torchcsprng cudatoolkit=10.2 -c pytorch-nightly

conda install torchcsprng cpuonly -c pytorch-nightly | -| macOS | None | conda install torchcsprng cpuonly -c pytorch-nightly | -| Windows | None | conda install torchcsprng cpuonly -c pytorch-nightly | +| OS | CUDA | | +|---------------|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Linux/Windows | 10.1

10.2

11.1

None | conda install torchcsprng cudatoolkit=10.1 -c pytorch-nightly -c conda-forge

conda install torchcsprng cudatoolkit=10.2 -c pytorch-nightly -c conda-forge

conda install torchcsprng cudatoolkit=11.1 -c pytorch-nightly -c conda-forge

conda install torchcsprng cpuonly -c pytorch-nightly -c conda-forge | +| macOS | None | conda install torchcsprng -c pytorch-nightly | pip: -| OS | CUDA | | -|---------|-----------------------------------------------|----------------------------------------------------------------------------------------------------| -| Linux | 9.2

10.1

10.2

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | -| macOS | None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | -| Windows | None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| OS | CUDA | | +|---------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Linux/Windows | 10.1

10.2

11.1

None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu101/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html

pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | +| macOS | None | pip install --pre torchcsprng -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html | ### From Source -torchcsprng is a Python C++/CUDA extension that depends on PyTorch. In order to build CSPRNG from source it is required to have Python(>=3.6) with PyTorch(>=1.6.0) installed and C++ compiler(gcc/clang for Linux, XCode for macOS, Visual Studio for MS Windows). +torchcsprng is a Python C++/CUDA extension that depends on PyTorch. In order to build CSPRNG from source it is required to have Python(>=3.7) with PyTorch(>=1.8.0) installed and C++ compiler(gcc/clang for Linux, XCode for macOS, Visual Studio for MS Windows). To build torchcsprng you can run the following: ```console python setup.py install diff --git a/examples/csprng.ipynb b/examples/csprng.ipynb new file mode 100644 index 0000000..e0e719c --- /dev/null +++ b/examples/csprng.ipynb @@ -0,0 +1,226 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "csprng.ipynb", + "provenance": [], + "collapsed_sections": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "Lpno_zUJT8ms" + }, + "source": [ + "# Cryptographically secure pseudorandom number generators for PyTorch\n", + "\n", + "The torchcsprng API is available in `torchcsprng` module:\n" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "db4YYky-PDI_" + }, + "source": [ + "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu102/torch_stable.html" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "O1s_j8CPPHSn" + }, + "source": [ + "import torch\n", + "import torchcsprng as csprng" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "o1Kz25IoS9m-" + }, + "source": [ + "device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "HLlLxkDIUWCG" + }, + "source": [ + "Create crypto-secure PRNG from /dev/urandom:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "yyyYlq5kUQss" + }, + "source": [ + "urandom_gen = csprng.create_random_device_generator('/dev/urandom')" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "xbUCnJfkUdUI" + }, + "source": [ + "Create empty boolean tensor on the `device` and initialize it with random values from `urandom_gen`:\n" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "zmj_VlIzUYIO" + }, + "source": [ + "torch.empty(10, dtype=torch.bool, device=device).random_(generator=urandom_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ycODsYhtUud9" + }, + "source": [ + "Create empty int16 tensor on the `device` and initialize it with random values in range [0, 100) from `urandom_gen`:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "uel-jbW9UlZH" + }, + "source": [ + "torch.empty(10, dtype=torch.int16, device=device).random_(100, generator=urandom_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "1jXW1FEmVMW_" + }, + "source": [ + "Create non-crypto-secure MT19937 PRNG:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "sL-cwFGfVOrp" + }, + "source": [ + "mt19937_gen = csprng.create_mt19937_generator()\n", + "torch.empty(10, dtype=torch.int64, device=device).random_(torch.iinfo(torch.int64).min, to=None, generator=mt19937_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "KW96wT4UVXBm" + }, + "source": [ + "Create crypto-secure PRNG from default random device:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "tjwbuE6FVRgm" + }, + "source": [ + "default_device_gen = csprng.create_random_device_generator()\n", + "torch.randn(10, device=device, generator=default_device_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "qYgdkZAYVfZT" + }, + "source": [ + "Create non-crypto-secure MT19937 PRNG with seed:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "xjOsYOxxVbzg" + }, + "source": [ + "mt19937_gen = csprng.create_mt19937_generator(42)\n", + "first = torch.empty(10, device=device).geometric_(p=0.2, generator=mt19937_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "cV77v7tHVlRd" + }, + "source": [ + "Recreate MT19937 PRNG with the same seed:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "i0O2lC0hVjAg" + }, + "source": [ + "mt19937_gen = csprng.create_mt19937_generator(42)\n", + "second = torch.empty(10, device=device).geometric_(p=0.2, generator=mt19937_gen)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "OcgSK0mejcef" + }, + "source": [ + "Check that `first` equals to `second`:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "vMx1BRO3jh7L" + }, + "source": [ + "assert (first == second).all()" + ], + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/examples/encrypt_decrypt.ipynb b/examples/encrypt_decrypt.ipynb new file mode 100644 index 0000000..54a5a66 --- /dev/null +++ b/examples/encrypt_decrypt.ipynb @@ -0,0 +1,307 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "encrypt_decrypt.ipynb", + "provenance": [], + "collapsed_sections": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "4JG-7IJgz_dK" + }, + "source": [ + "# PyTorch/CSPRNG encrypt/decrypt examples" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "H8TZemj30JvQ" + }, + "source": [ + "torchcsprng 0.2.0 exposes new API for tensor encryption/decryption. Tensor encryption/decryption API is dtype agnostic, so a tensor of any dtype can be encrypted and the result can be stored to a tensor of any dtype. An encryption key also can be a tensor of any dtype. Currently torchcsprng supports AES cipher with 128-bit key in two modes: ECB and CTR." + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "jC1O-C25vI0W" + }, + "source": [ + "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu102/torch_stable.html" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "su2RWWdOrWFU" + }, + "source": [ + "import torch\n", + "import torchcsprng as csprng" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "NHTOLPZ_3254" + }, + "source": [ + "device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "17L0sgmy0R6o" + }, + "source": [ + "torchcsprng implementation of AES with 128 bit key requires to have a key tensor of 16 bytes but of any dtype" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "rw7WYZ-50To9" + }, + "source": [ + "key = torch.empty(16, dtype=torch.uint8, device=device).random_(0, 256)\n", + "key" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "RRfvyfHM4MY1" + }, + "source": [ + "Alternatively it can be a tensor of 8 elements of `torch.int16` or even 4 elements of `torch.float32`" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "rCy01t1-0dtO" + }, + "source": [ + "The size of input tensor is 42 * (32/8) = 168 bytes. AES 128 operates with 16-bytes blocks, so zero-padding of 8 bytes will be used to form 176 bytes(eleven 16-bytes blocks)" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "LcuVmhyU0WTn" + }, + "source": [ + "initial = torch.empty(42, dtype=torch.float32, device=device).normal_(-24.0, 42.0)\n", + "initial" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "rPNq2u4e3tlJ" + }, + "source": [ + "torchcsprng requires output tensor to be of the same size in bytes as input tensor rounded up to 16 bytes(AES 128 block size), so if `torch.int64` is dtype of the destination tensor size must be 176 / (64/8) = 22" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "RAJya9GT0gb4" + }, + "source": [ + "encrypted = torch.empty(22, dtype=torch.int64, device=device)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "-DCI4QOh4oGX" + }, + "source": [ + "Call `torchcsprng.encrypt` to encrypt `initial` tensor in [ECB](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_(ECB)) mode with 128-bit `key` tensor and store the result to `encrypted` tensor." + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "TK4OjPRq4lsJ" + }, + "source": [ + "csprng.encrypt(initial, encrypted, key, \"aes128\", \"ecb\")" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "yXUAwFHh5PSy" + }, + "source": [ + "Create an output tensor" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "4LtJ-kD446DJ" + }, + "source": [ + "decrypted = torch.empty_like(initial)" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "8VcF04mf6Rn5" + }, + "source": [ + "Call `torchcsprng.decrypt` to decrypt `encrypted` tensor in ECB mode with 128-bit `key` tensor and store the result to `decrypted` tensor." + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "kojXCFGK5v6l" + }, + "source": [ + "csprng.decrypt(encrypted, decrypted, key, \"aes128\", \"ecb\")" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "9dEBSPD6EFSu" + }, + "source": [ + "Let's check that `decrypted` equals to `initial`:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "yOc1ftnM5yyj" + }, + "source": [ + "assert (decrypted == initial).all()" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "cQWyteLlE4mQ" + }, + "source": [ + "Another example is to use [CTR](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_(CTR)) mode with 128-bit `key` tensor of 4 elements of dtype `dtype=torch.float32`:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "ZFInqYawD7ks" + }, + "source": [ + "key = torch.empty(4, dtype=torch.float32, device=device).random_()\n", + "key" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "FRz94NaZGyRS" + }, + "source": [ + "Let's encrypt 100 elements `torch.bool` tensor and store the result in 56 elements `torch.int16` tensor:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "8uiqxiehF_is" + }, + "source": [ + "initial = torch.empty(100, dtype=torch.bool, device=device).random_()\n", + "initial" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "G0URlmQYGfcW" + }, + "source": [ + "encrypted = torch.empty(56, dtype=torch.int16, device=device)\n", + "csprng.encrypt(initial, encrypted, key, \"aes128\", \"ctr\")" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "U9Zz2oXoHw9Q" + }, + "source": [ + "Decrypt it back and check that `decrypted` equals to `initial`:" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "YXNcdUbXHoPC" + }, + "source": [ + "decrypted = torch.empty_like(initial)\n", + "csprng.decrypt(encrypted, decrypted, key, \"aes128\", \"ctr\")\n", + "decrypted" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "ie7epw1SKrdQ" + }, + "source": [ + "assert (decrypted == initial).all()" + ], + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py index de611ff..f45f8f0 100644 --- a/torchcsprng/__init__.py +++ b/torchcsprng/__init__.py @@ -7,3 +7,9 @@ import torch from torchcsprng._C import * + + +try: + from .version import __version__, git_version # noqa: F401 +except ImportError: + pass From f0e6dbdd7f91c95549db34b91cbbafc714a5824b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 8 Mar 2021 17:12:15 -0800 Subject: [PATCH 224/750] 2021-03-08 nightly release (5cbde12d3125bb189519775820eec4f66591f6f1) --- README.md | 4 ++++ examples/csprng.ipynb | 4 ++-- examples/encrypt_decrypt.ipynb | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d60005..3bfe568 100644 --- a/README.md +++ b/README.md @@ -205,3 +205,7 @@ We appreciate all contributions. If you are planning to contribute back bug-fixe ## License torchcsprng is BSD 3-clause licensed. See the license file [here](https://github.com/pytorch/csprng/blob/master/LICENSE) + +## [Terms of Use](https://opensource.facebook.com/legal/terms) + +## [Privacy Policy](https://opensource.facebook.com/legal/privacy) diff --git a/examples/csprng.ipynb b/examples/csprng.ipynb index e0e719c..1f6b477 100644 --- a/examples/csprng.ipynb +++ b/examples/csprng.ipynb @@ -30,7 +30,7 @@ "id": "db4YYky-PDI_" }, "source": [ - "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu102/torch_stable.html" + "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu101/torch_stable.html" ], "execution_count": null, "outputs": [] @@ -223,4 +223,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/examples/encrypt_decrypt.ipynb b/examples/encrypt_decrypt.ipynb index 54a5a66..3de8968 100644 --- a/examples/encrypt_decrypt.ipynb +++ b/examples/encrypt_decrypt.ipynb @@ -37,7 +37,7 @@ "id": "jC1O-C25vI0W" }, "source": [ - "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu102/torch_stable.html" + "!pip install torchcsprng==0.2.0 torch==1.8.0 -f https://download.pytorch.org/whl/cu101/torch_stable.html" ], "execution_count": null, "outputs": [] @@ -304,4 +304,4 @@ "outputs": [] } ] -} \ No newline at end of file +} From 33c28fbae2e64d7c5f615b9df3d728afbb5d9380 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 9 Mar 2021 04:30:20 -0800 Subject: [PATCH 225/750] 2021-03-09 nightly release (5cbde12d3125bb189519775820eec4f66591f6f1) From ef4167cd0d86e53266672c4ead33638aa91d91e2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 10 Mar 2021 04:30:08 -0800 Subject: [PATCH 226/750] 2021-03-10 nightly release (5cbde12d3125bb189519775820eec4f66591f6f1) From aabaca4fbeb097530c57c65218a2f1b37f18b0c8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 11 Mar 2021 04:30:15 -0800 Subject: [PATCH 227/750] 2021-03-11 nightly release (5cbde12d3125bb189519775820eec4f66591f6f1) From 72681fead2c0f57809adda6929a3636379abe4d3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 12 Mar 2021 04:30:18 -0800 Subject: [PATCH 228/750] 2021-03-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) --- test/test_csprng.py | 132 ++++++++++++++++++------------ torchcsprng/__init__.pyi | 4 + torchcsprng/csrc/kernels_body.inc | 18 ++-- 3 files changed, 95 insertions(+), 59 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index feedde9..cfdb1ef 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -23,6 +23,19 @@ IS_SANDCASTLE = os.getenv('SANDCASTLE') == '1' or os.getenv('TW_JOB_USER') == 'sandcastle' IS_FBCODE = os.getenv('PYTORCH_TEST_FBCODE') == '1' + +def to_numpy(t, dtype=torch.float): + if t.dtype == torch.bfloat16: + t = t.to(dtype) + return t.numpy() + + +def to_bytes(t): + if t.dtype == torch.bfloat16: + t = t.view(torch.int16) + return t.cpu().numpy().view(np.int8) + + class TestCSPRNG(unittest.TestCase): all_generators = [ @@ -34,9 +47,13 @@ class TestCSPRNG(unittest.TestCase): int_dtypes = [torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64] - fp_ftypes = [torch.float, torch.double] + standard_fp_dtypes = [torch.float, torch.double] + + non_standard_fp_dtypes = [torch.half, torch.bfloat16] + + fp_dtypes = standard_fp_dtypes + non_standard_fp_dtypes - num_dtypes = int_dtypes + fp_ftypes + num_dtypes = int_dtypes + fp_dtypes all_dtypes = num_dtypes + [torch.bool] @@ -52,14 +69,22 @@ def test_random_kstest(self): to_inc = 2**24 elif dtype == torch.double: to_inc = 2**53 + elif dtype == torch.half: + to_inc = 2**11 + elif dtype == torch.bfloat16: + to_inc = 2**8 else: to_inc = torch.iinfo(dtype).max t = torch.empty(self.size, dtype=dtype, device=device).random_(generator=gen) - res = stats.kstest(t.cpu(), stats.randint.cdf, args=(0, to_inc)) + res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_inc)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + no_cuda = not torch.cuda.is_available() or not csprng.supports_cuda() + + no_cuda_message = "CUDA is not available or csprng was not compiled with CUDA support" + + @unittest.skipIf(no_cuda, no_cuda_message) def test_random_cpu_vs_cuda(self): for dtype in self.num_dtypes: gen = csprng.create_mt19937_generator(42) @@ -74,10 +99,10 @@ def test_random_to_kstest(self): for gen in self.all_generators: for dtype in self.num_dtypes: t = torch.zeros(self.size, dtype=dtype, device=device).random_(to_, generator=gen) - res = stats.kstest(t.cpu(), stats.randint.cdf, args=(0, to_)) + res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_random_to_cpu_vs_cuda(self): to_ = 42 for dtype in self.num_dtypes: @@ -95,10 +120,10 @@ def test_random_from_to_kstest(self): for to_ in [42, 99, 123]: if from_ < to_: t = torch.zeros(self.size, dtype=dtype, device=device).random_(from_, to_, generator=gen) - res = stats.kstest(t.cpu(), stats.randint.cdf, args=(from_, to_)) + res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(from_, to_)) self.assertTrue(res.statistic < 0.2) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_random_from_to_cpu_vs_cuda(self): for dtype in self.num_dtypes: for from_ in [0, 24, 42]: @@ -127,7 +152,7 @@ def test_random_bool(self): self.assertEqual(t.max(), True) self.assertTrue(0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_random_bool_cpu_vs_cuda(self): gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=torch.bool, device='cpu').random_(generator=gen) @@ -138,17 +163,17 @@ def test_random_bool_cpu_vs_cuda(self): def test_uniform_kstest(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for from_ in [-42, 0, 4.2]: for to_ in [-4.2, 0, 42]: if to_ > from_: t = torch.empty(self.size, dtype=dtype, device=device).uniform_(from_, to_, generator=gen) - res = stats.kstest(t.cpu().to(torch.double), 'uniform', args=(from_, (to_ - from_))) + res = stats.kstest(to_numpy(t.cpu(), torch.double), 'uniform', args=(from_, (to_ - from_))) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_uniform_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for from_ in [-42, 0, 4.2]: for to_ in [-4.2, 0, 42]: if to_ > from_: @@ -156,95 +181,101 @@ def test_uniform_cpu_vs_cuda(self): cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').uniform_(from_, to_, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').uniform_(from_, to_, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-9) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_normal_kstest(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: t = torch.empty(self.size, dtype=dtype, device=device).normal_(mean=mean, std=std, generator=gen) - res = stats.kstest(t.cpu().to(torch.double), 'norm', args=(mean, std)) + res = stats.kstest(to_numpy(t.cpu(), torch.double), 'norm', args=(mean, std)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_normal_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').normal_(mean=mean, std=std, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').normal_(mean=mean, std=std, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-9) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_log_normal_kstest(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: t = torch.empty(self.size, dtype=dtype, device=device).log_normal_(mean=mean, std=std, generator=gen) - res = stats.kstest(t.cpu().to(torch.double), 'lognorm', args=(std, 0, math.exp(mean))) - self.assertTrue(res.statistic < 0.1) + res = stats.kstest(to_numpy(t.cpu(), torch.double), 'lognorm', args=(std, 0, math.exp(mean))) + if dtype in [torch.half, torch.bfloat16]: + self.assertTrue(res.statistic < 0.4) + else: + self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_log_normal_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').log_normal_(mean=mean, std=std, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').log_normal_(mean=mean, std=std, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-4) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-4, equal_nan=True)) def test_exponential_kstest(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for lambd in [0.5, 1.0, 5.0]: t = torch.empty(self.size, dtype=dtype, device=device).exponential_(lambd=lambd, generator=gen) - res = stats.kstest(t.cpu().to(torch.double), 'expon', args=(0, 1 / lambd,)) + res = stats.kstest(to_numpy(t.cpu(), torch.double), 'expon', args=(0, 1 / lambd,)) self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) @unittest.skip("https://github.com/pytorch/pytorch/issues/38662") def test_exponential_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for lambd in [0.5, 1.0, 5.0]: gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').exponential_(lambd=lambd, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').exponential_(lambd=lambd, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-9) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_cauchy_kstest(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for median in [-10, 0, 50]: for sigma in [0.5, 1.0, 10.0]: t = torch.empty(self.size, dtype=dtype, device=device).cauchy_(median=median, sigma=sigma, generator=gen) - res = stats.kstest(t.cpu().to(torch.double), 'cauchy', args=(median, sigma)) - self.assertTrue(res.statistic < 0.1) + res = stats.kstest(to_numpy(t.cpu(), torch.double), 'cauchy', args=(median, sigma)) + if dtype in [torch.half, torch.bfloat16]: + self.assertTrue(res.statistic < 0.4) + else: + self.assertTrue(res.statistic < 0.1) - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_cauchy_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for median in [-10, 0, 50]: for sigma in [0.5, 1.0, 10.0]: gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').cauchy_(median=median, sigma=sigma, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').cauchy_(median=median, sigma=sigma, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-9) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_geometric(self): for device in self.all_devices: for gen in self.all_generators: - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for p in [0.2, 0.5, 0.8]: t = torch.empty(self.size, dtype=dtype, device=device).geometric_(p=p, generator=gen) # actual = np.histogram(t.cpu().to(torch.double), np.arange(1, 100))[0] @@ -252,15 +283,15 @@ def test_geometric(self): # res = stats.chisquare(actual, expected) # self.assertAlmostEqual(res.pvalue, 1.0, delta=0.5) TODO https://github.com/pytorch/csprng/issues/7 - @unittest.skipIf(not torch.cuda.is_available() or not csprng.supports_cuda(), "CUDA is not available or csprng was not compiled with CUDA support") + @unittest.skipIf(no_cuda, no_cuda_message) def test_geometric_cpu_vs_cuda(self): - for dtype in self.fp_ftypes: + for dtype in self.fp_dtypes: for p in [0.2, 0.5, 0.8]: gen = csprng.create_mt19937_generator(42) cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').geometric_(p=p, generator=gen) gen = csprng.create_mt19937_generator(42) cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').geometric_(p=p, generator=gen) - self.assertTrue((cpu_t - cuda_t.cpu()).abs().max() < 1e-9) + self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9, equal_nan=True)) def test_non_contiguous_vs_contiguous(self): size = 10 @@ -317,9 +348,8 @@ def measure(size): @unittest.skipIf(IS_SANDCASTLE or IS_FBCODE, "Does not work on Sandcastle") def test_version(self): - import torchcsprng.version as version - self.assertTrue(version.__version__) - self.assertTrue(version.git_version) + self.assertTrue(csprng.__version__) + self.assertTrue(csprng.git_version) def test_randperm(self): for device in self.all_devices: @@ -373,11 +403,11 @@ def create_aes(m, k): for key_dtype in self.all_dtypes: key_size = key_size_bytes // sizeof(key_dtype) key = torch.empty(key_size, dtype=key_dtype).random_() - key_np = key.numpy().view(np.int8) + key_np = to_bytes(key) for initial_dtype in self.all_dtypes: for initial_size in [0, 4, 8, 15, 16, 23, 42]: initial = torch.empty(initial_size, dtype=initial_dtype).random_() - initial_np = initial.numpy().view(np.int8) + initial_np = to_bytes(initial) initial_size_bytes = initial_size * sizeof(initial_dtype) for encrypted_dtype in self.all_dtypes: encrypted_size = (initial_size_bytes + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) @@ -393,7 +423,7 @@ def create_aes(m, k): decrypted = decrypted.to(device) csprng.encrypt(initial, encrypted, key, "aes128", mode) - encrypted_np = encrypted.cpu().numpy().view(np.int8) + encrypted_np = to_bytes(encrypted) aes = create_aes(mode, key_np) @@ -401,7 +431,7 @@ def create_aes(m, k): self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) csprng.decrypt(encrypted, decrypted, key, "aes128", mode) - decrypted_np = decrypted.cpu().numpy().view(np.int8)[:initial_size_bytes] + decrypted_np = to_bytes(decrypted)[:initial_size_bytes] aes = create_aes(mode, key_np) @@ -433,12 +463,12 @@ def create_aes(m, k): for key_dtype in self.all_dtypes: key_size = key_size_bytes // sizeof(key_dtype) key = torch.empty(key_size, dtype=key_dtype).random_() - key_np = key.numpy().view(np.int8) + key_np = to_bytes(key) for initial_dtype in self.all_dtypes: for initial_size_bytes in [0, 16, 256]: initial_size = initial_size_bytes // sizeof(initial_dtype) initial = torch.empty(initial_size, dtype=initial_dtype).random_() - initial_np = initial.numpy().view(np.int8) + initial_np = to_bytes(initial) initial_np_copy = np.copy(initial_np) for mode in ["ecb", "ctr"]: for device in self.all_devices: @@ -446,7 +476,7 @@ def create_aes(m, k): initial = initial.to(device) csprng.encrypt(initial, initial, key, "aes128", mode) - encrypted_np = initial.cpu().numpy().view(np.int8) + encrypted_np = to_bytes(initial) aes = create_aes(mode, key_np) encrypted_expected = np.frombuffer(aes.encrypt(initial_np_copy.tobytes()), dtype=np.int8) self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) @@ -454,7 +484,7 @@ def create_aes(m, k): encrypted_np_copy = np.copy(encrypted_np) csprng.decrypt(initial, initial, key, "aes128", mode) - decrypted_np = initial.cpu().numpy().view(np.int8) + decrypted_np = to_bytes(initial) aes = create_aes(mode, key_np) decrypted_expected = np.frombuffer(aes.decrypt(encrypted_np_copy.tobytes()), dtype=np.int8) self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) diff --git a/torchcsprng/__init__.pyi b/torchcsprng/__init__.pyi index 2ad274d..3ab1142 100644 --- a/torchcsprng/__init__.pyi +++ b/torchcsprng/__init__.pyi @@ -15,3 +15,7 @@ def create_mt19937_generator(seed: int = 0): ... def encrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... def decrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... + +def __version__() -> str: ... + +def git_version() -> str: ... diff --git a/torchcsprng/csrc/kernels_body.inc b/torchcsprng/csrc/kernels_body.inc index 639976b..bcf1e26 100644 --- a/torchcsprng/csrc/kernels_body.inc +++ b/torchcsprng/csrc/kernels_body.inc @@ -102,6 +102,8 @@ struct UIntType {}; template <> struct UIntType { using type = uint64_t; }; template <> struct UIntType { using type = uint32_t; }; +template <> struct UIntType { using type = uint16_t; }; +template <> struct UIntType { using type = uint16_t; }; template <> struct UIntType { using type = uint64_t; }; template <> struct UIntType { using type = uint32_t; }; template <> struct UIntType { using type = uint32_t; }; @@ -116,7 +118,7 @@ struct RandomKernel { void operator()(TensorIterator& iter, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_ALL_TYPES_AND(ScalarType::Bool, iter.dtype(), "random_kernel", [&] { + AT_DISPATCH_ALL_TYPES_AND3(at::ScalarType::Bool, at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "random_kernel", [&] { aes_helper::type>(iter, key, [] TORCH_CSPRNG_HOST_DEVICE (RNGValues<1>* generator) -> scalar_t { uniform_int_distribution random; @@ -168,7 +170,7 @@ struct RandomFromToKernel { void operator()(TensorIterator& iter, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_ALL_TYPES_AND(at::ScalarType::BFloat16, iter.dtype(), "random_full_64_bits_range_kernel", [&] { + AT_DISPATCH_ALL_TYPES_AND3(at::ScalarType::Bool, at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "random_full_64_bits_range_kernel", [&] { if (std::is_same::value || std::is_same::value || std::is_same::value || @@ -201,7 +203,7 @@ struct UniformKernel { void operator()(TensorIterator& iter, double from, double to, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "uniform_kernel", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "uniform_kernel", [&] { aes_helper(iter, key, [from, to] TORCH_CSPRNG_HOST_DEVICE (RNGValues<1>* generator) -> scalar_t { uniform_real_distribution uniform(from, to); @@ -224,7 +226,7 @@ struct NormalKernel { auto iter = TensorIterator::nullary_op(self); const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "normal_kernel", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "normal_kernel", [&] { aes_helper(iter, key, [mean, std] TORCH_CSPRNG_HOST_DEVICE (RNGValues<2>* gen) -> scalar_t { normal_distribution normal(mean, std); @@ -270,7 +272,7 @@ struct CauchyKernel { void operator()(TensorIterator& iter, double median, double sigma, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "cauchy_kernel", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "cauchy_kernel", [&] { aes_helper(iter, key, [median, sigma] TORCH_CSPRNG_HOST_DEVICE (RNGValues<1>* gen) -> scalar_t { cauchy_distribution cauchy(median, sigma); @@ -292,7 +294,7 @@ struct LogNormalKernel { void operator()(TensorIterator& iter, double mean, double std, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "log_normal", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "log_normal", [&] { aes_helper(iter, key, [mean, std] TORCH_CSPRNG_HOST_DEVICE (RNGValues<2>* gen) -> scalar_t { lognormal_distribution logNormal(mean, std); @@ -314,7 +316,7 @@ struct GeometricKernel { void operator()(TensorIterator& iter, double p, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "geometric_kernel", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "geometric_kernel", [&] { aes_helper::type, 1>(iter, key, [p] TORCH_CSPRNG_HOST_DEVICE (RNGValues<1>* gen) -> scalar_t { geometric_distribution geometric(p); @@ -336,7 +338,7 @@ struct ExponentialKernel { void operator()(TensorIterator& iter, double lambda, c10::optional generator) { const Tensor key_t = aes128_key_tensor(*generator).to(iter.device()); const auto key = key_t.data_ptr(); - AT_DISPATCH_FLOATING_TYPES(iter.dtype(), "exponential_kernel", [&] { + AT_DISPATCH_FLOATING_TYPES_AND2(at::ScalarType::Half, at::ScalarType::BFloat16, iter.dtype(), "exponential_kernel", [&] { aes_helper(iter, key, [lambda] TORCH_CSPRNG_HOST_DEVICE (RNGValues<1>* gen) -> scalar_t { exponential_distribution exponential(lambda); From a16fee8f0af765c9cd875caa9916f878a0ab62dd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 13 Mar 2021 04:30:15 -0800 Subject: [PATCH 229/750] 2021-03-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 321ac829e55122a0a82c97f52d88880b723bd6ce Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 14 Mar 2021 04:30:33 -0700 Subject: [PATCH 230/750] 2021-03-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 195ef55480c9c814dd5754ef4bc550952c8a2031 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 15 Mar 2021 04:30:16 -0700 Subject: [PATCH 231/750] 2021-03-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ca1ac8c60d1f32247baa3f2c2022552cb875ab7e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 16 Mar 2021 04:30:11 -0700 Subject: [PATCH 232/750] 2021-03-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e2ca0fa02fe81fd59dcb8c0453add7c3120ba199 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 17 Mar 2021 04:31:22 -0700 Subject: [PATCH 233/750] 2021-03-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4ac44c26f567013acd0d2b2a9798ea37cbc146b9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 18 Mar 2021 04:30:14 -0700 Subject: [PATCH 234/750] 2021-03-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 96d6a0922f84b240ae4c8af768b9b35bb7122ca2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 19 Mar 2021 04:30:19 -0700 Subject: [PATCH 235/750] 2021-03-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ec22d95854f9b0550867916970005a35bf16e17c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 20 Mar 2021 04:30:19 -0700 Subject: [PATCH 236/750] 2021-03-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 3493ab024f772eaf205cd36bcffa8c65ec0a26eb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 21 Mar 2021 04:30:16 -0700 Subject: [PATCH 237/750] 2021-03-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9df00d8895cbcf4bf0cf9e3a04db4cfc9508beca Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 22 Mar 2021 04:30:20 -0700 Subject: [PATCH 238/750] 2021-03-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 97691f26b96a1ae7d98865436c2c3ab09ad30306 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 23 Mar 2021 04:30:11 -0700 Subject: [PATCH 239/750] 2021-03-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e54da421857ce406b858a56221fd98003cd998cf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 24 Mar 2021 04:30:13 -0700 Subject: [PATCH 240/750] 2021-03-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From dce8c84be13fa528b5a90425be3bb8e48f4bb56d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 25 Mar 2021 04:30:17 -0700 Subject: [PATCH 241/750] 2021-03-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 3c9a902ae07c8e7703388a206c754fb468435b16 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 26 Mar 2021 04:30:23 -0700 Subject: [PATCH 242/750] 2021-03-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From dbbb66ea57f3e094ad9de85c3cf099059cdd95d2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 27 Mar 2021 04:30:18 -0700 Subject: [PATCH 243/750] 2021-03-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 45dd70c5c021f33cfbe3fccff4ae31686e0fbb32 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 28 Mar 2021 04:30:18 -0700 Subject: [PATCH 244/750] 2021-03-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 0eb59894a55fc60aa4d00b1dacda56b7992fff08 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 29 Mar 2021 04:30:27 -0700 Subject: [PATCH 245/750] 2021-03-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 71b43c7ddbce75b7d6ec95a385931bc48a5d6988 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 30 Mar 2021 04:30:07 -0700 Subject: [PATCH 246/750] 2021-03-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 173ac67a80059464c051dc3b39fbce5d3d164c04 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 31 Mar 2021 04:30:14 -0700 Subject: [PATCH 247/750] 2021-03-31 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e8e137655af3d5bd0f4162cd4fd933066a60d2e7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 1 Apr 2021 04:30:24 -0700 Subject: [PATCH 248/750] 2021-04-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 75f1dcff6785fe8daac7238e734397c77ec5ef4c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 2 Apr 2021 04:30:32 -0700 Subject: [PATCH 249/750] 2021-04-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6c2422ee791bf1de0ec4f64deaea51bb923ece00 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 3 Apr 2021 04:30:23 -0700 Subject: [PATCH 250/750] 2021-04-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4dab58bce50255670234bd2d51814ae48ad5cb32 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 4 Apr 2021 04:30:30 -0700 Subject: [PATCH 251/750] 2021-04-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 98670987a1f9a1ff1e6761293a339b34543422c4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 5 Apr 2021 04:30:18 -0700 Subject: [PATCH 252/750] 2021-04-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 30641c1b62b7a6a648f319b20f85ce5fb43f5943 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 6 Apr 2021 04:30:08 -0700 Subject: [PATCH 253/750] 2021-04-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6a2b36a9b2f40e2451435edd7771c2ea35cc7fe2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 7 Apr 2021 04:30:19 -0700 Subject: [PATCH 254/750] 2021-04-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5b9b1ace1b1e0d834accf1925dabe05a3277cfbc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 8 Apr 2021 04:30:12 -0700 Subject: [PATCH 255/750] 2021-04-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 61066f4bc298a3afc69c97bd5a2e6209f075642f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 9 Apr 2021 04:30:29 -0700 Subject: [PATCH 256/750] 2021-04-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 74a25f72ec1819def06e1d281b84fb832c18ccb0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 10 Apr 2021 04:30:15 -0700 Subject: [PATCH 257/750] 2021-04-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 430cfa5ecb65a88080669e918b7572927e393132 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 11 Apr 2021 04:30:36 -0700 Subject: [PATCH 258/750] 2021-04-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 182d45912a1d47fd778801d1c462faa70ebc56d2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 12 Apr 2021 04:30:33 -0700 Subject: [PATCH 259/750] 2021-04-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4646ef7e6ad3479de7fc711d44b8a78f39786210 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 13 Apr 2021 04:30:15 -0700 Subject: [PATCH 260/750] 2021-04-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 620bf79eae629196640e0fcaa6595a55a1258f5b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 14 Apr 2021 04:30:11 -0700 Subject: [PATCH 261/750] 2021-04-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f9fa5dcca0c64a37198ca7d21da5b3215fa5b9df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 15 Apr 2021 04:30:13 -0700 Subject: [PATCH 262/750] 2021-04-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From bcbd055599ea46834c528e1e29b734175342750b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 16 Apr 2021 04:30:10 -0700 Subject: [PATCH 263/750] 2021-04-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 798d62ddee7824b4e164536e62d7df70f3a4d2db Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 17 Apr 2021 04:30:30 -0700 Subject: [PATCH 264/750] 2021-04-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6ec0fa757cc1151fc8e2f34bf91e4b54e03b784e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 18 Apr 2021 04:30:35 -0700 Subject: [PATCH 265/750] 2021-04-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 986e5dcdddca9310b21c504f9dbb6fbaae9a3105 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 19 Apr 2021 04:30:10 -0700 Subject: [PATCH 266/750] 2021-04-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 963104ec4fd9cef870a10ce54d09cd566d06cdc2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 20 Apr 2021 04:30:16 -0700 Subject: [PATCH 267/750] 2021-04-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 440f1e99469078863a0bcb60058ef4781708ed6c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 21 Apr 2021 04:30:15 -0700 Subject: [PATCH 268/750] 2021-04-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 46afaaceb78cb4f0500ce23194071d4e4d1e6bfe Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 22 Apr 2021 04:30:11 -0700 Subject: [PATCH 269/750] 2021-04-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b93fd0b0b81a7f7e64d0281ddf0b24ad05c1dea3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 23 Apr 2021 04:30:13 -0700 Subject: [PATCH 270/750] 2021-04-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4c65c28e1564c1b06172c06bf20e6de3f56f919b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 24 Apr 2021 04:30:54 -0700 Subject: [PATCH 271/750] 2021-04-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 1c6723a2bb1e2ee1b389cab73d773bcc672e4779 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 25 Apr 2021 04:30:55 -0700 Subject: [PATCH 272/750] 2021-04-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 96b2364fefbd4eda3cda41df9cd56fc022873003 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 26 Apr 2021 04:30:33 -0700 Subject: [PATCH 273/750] 2021-04-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 0b80d7d23ea8a74df510af761408098e12c6dbbd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 27 Apr 2021 04:30:28 -0700 Subject: [PATCH 274/750] 2021-04-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b73b1cf5a0a14eba7480485e79292aee99c2bccd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 28 Apr 2021 04:30:29 -0700 Subject: [PATCH 275/750] 2021-04-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 43f6b426da0894034065bd0c6d586f254d55dbfc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 29 Apr 2021 04:31:10 -0700 Subject: [PATCH 276/750] 2021-04-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 68bf5e08094ba4cbba0340777058252dc0fad0df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 30 Apr 2021 04:30:40 -0700 Subject: [PATCH 277/750] 2021-04-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6448908f6662f10a4acec610a934fa3598bf933d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 1 May 2021 04:30:47 -0700 Subject: [PATCH 278/750] 2021-05-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 7abfd7c60d6d977d00e8e8b1c0e7ce58e52f155e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 2 May 2021 04:30:31 -0700 Subject: [PATCH 279/750] 2021-05-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From bd497c966fe2f02a2aa8cd0f6b1518798a4a0fca Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 3 May 2021 04:31:08 -0700 Subject: [PATCH 280/750] 2021-05-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 1ccae776b0034e03b45e81eefeab9e4cc878a08a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 4 May 2021 04:31:02 -0700 Subject: [PATCH 281/750] 2021-05-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 8fe65fd593a4b6ce6722a32d9cf62c0143a74f20 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 5 May 2021 04:30:58 -0700 Subject: [PATCH 282/750] 2021-05-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 687d12c19b34c8920b5108a02898dba8537b1ed8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 6 May 2021 04:31:22 -0700 Subject: [PATCH 283/750] 2021-05-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 351174345fb4d844a5a330c45c0d01a90103e66b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 7 May 2021 04:31:09 -0700 Subject: [PATCH 284/750] 2021-05-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 821d0370b3c6b376ed6c7947324fbc0a9c5c1664 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 8 May 2021 04:30:57 -0700 Subject: [PATCH 285/750] 2021-05-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f3713bee346f35b96b38d15a96948644ad9e43e8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 9 May 2021 04:30:58 -0700 Subject: [PATCH 286/750] 2021-05-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From eb168f8c364df503e89e64dce1acce7e8a5e79f2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 10 May 2021 04:30:25 -0700 Subject: [PATCH 287/750] 2021-05-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a4867bba4d07c5aee45d61aca2ea7650822eea1e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 11 May 2021 04:30:58 -0700 Subject: [PATCH 288/750] 2021-05-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9fdb7e1b2146097f5d3e1936a6702a287b486889 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 12 May 2021 04:30:56 -0700 Subject: [PATCH 289/750] 2021-05-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ad45ae52c585ea84241dee8066b5194ffefd05e4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 13 May 2021 04:31:13 -0700 Subject: [PATCH 290/750] 2021-05-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a527ba75c8b4a57f8e3af7b5c8005182eb6e56c7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 14 May 2021 04:31:14 -0700 Subject: [PATCH 291/750] 2021-05-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 14651cd628f84472a47be7c72c478bc5cc767610 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 15 May 2021 04:30:37 -0700 Subject: [PATCH 292/750] 2021-05-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ca3311e068a8d24bfc999765d65e5398a51a6c49 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 16 May 2021 04:30:44 -0700 Subject: [PATCH 293/750] 2021-05-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6662b1522852914f72e66dde872c2df23ce1f50c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 17 May 2021 04:31:52 -0700 Subject: [PATCH 294/750] 2021-05-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5041026d01a9dc0fc0eb25bd4a0d002e31a8166f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 18 May 2021 04:31:36 -0700 Subject: [PATCH 295/750] 2021-05-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 352aa192353dbf6cd6e0e9e749ad28a2be455167 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 19 May 2021 04:30:59 -0700 Subject: [PATCH 296/750] 2021-05-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e8c3155dd2289a284f54e0acb89ca01a642a423f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 20 May 2021 04:30:33 -0700 Subject: [PATCH 297/750] 2021-05-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From d9dc7fa3511947d5571a247438104a82fabb8d87 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 21 May 2021 04:31:07 -0700 Subject: [PATCH 298/750] 2021-05-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b6c6a2b9c8aff52662d5c16cfbc41244a645ba6d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 22 May 2021 04:30:43 -0700 Subject: [PATCH 299/750] 2021-05-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9bfdee5e06ec2e647eece7fc94e19e99e17b5597 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 23 May 2021 04:31:00 -0700 Subject: [PATCH 300/750] 2021-05-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From caffa0e08980c72e048648521672798a08be7dcf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 24 May 2021 04:30:36 -0700 Subject: [PATCH 301/750] 2021-05-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 7c4da9b1334f2e9dc64e9bf8478e04138e75bdc3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 25 May 2021 04:30:34 -0700 Subject: [PATCH 302/750] 2021-05-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ad723799e28c24ac1aef254012be6a2a434931fc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 26 May 2021 04:31:25 -0700 Subject: [PATCH 303/750] 2021-05-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 1743e69ca1319c369b38766aa3bbedbdcac4c8b1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 27 May 2021 04:31:49 -0700 Subject: [PATCH 304/750] 2021-05-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a6e7e7a3854b64868d00cdf930300b7e72fe77df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 28 May 2021 04:30:28 -0700 Subject: [PATCH 305/750] 2021-05-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From de0def8f6b7b083f9411ff7e2f35b604b7201014 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 29 May 2021 04:31:22 -0700 Subject: [PATCH 306/750] 2021-05-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b90544593bc781637039a93b8ab80da147c2ab25 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 30 May 2021 04:30:42 -0700 Subject: [PATCH 307/750] 2021-05-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4e16c309da85a800b0498506cbd0f79ffae5237d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 31 May 2021 04:30:55 -0700 Subject: [PATCH 308/750] 2021-05-31 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 39adddcb17f14afbf95128d014cbc892a63c23b2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 1 Jun 2021 04:30:45 -0700 Subject: [PATCH 309/750] 2021-06-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4c2c62c6c4a05546e8a35e1600b91676ea7688c8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 2 Jun 2021 04:30:54 -0700 Subject: [PATCH 310/750] 2021-06-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 2ac91683f17f19269a94211905ffcc377f5b7d1d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 3 Jun 2021 04:38:53 -0700 Subject: [PATCH 311/750] 2021-06-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b3296c110a6f9f80922c7687c4d0cff9fe3f5607 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 4 Jun 2021 04:32:04 -0700 Subject: [PATCH 312/750] 2021-06-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5562a77e507537973ee61b8d65c7fccedb5fb2d3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 5 Jun 2021 04:31:03 -0700 Subject: [PATCH 313/750] 2021-06-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5039adbc41ebf839550b1d0779656d432ae1996f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 6 Jun 2021 04:31:24 -0700 Subject: [PATCH 314/750] 2021-06-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5fe7e099e28176e58fe64808ffbb11afd156bb82 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 7 Jun 2021 04:30:48 -0700 Subject: [PATCH 315/750] 2021-06-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a53e32a37c61d04d6b50303fe7807873db3750b1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 8 Jun 2021 04:33:04 -0700 Subject: [PATCH 316/750] 2021-06-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f9fee7bb06abe6058dacf6b1eb703307bf85f14d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 9 Jun 2021 04:31:02 -0700 Subject: [PATCH 317/750] 2021-06-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a14c4cc962ef4b82f95675b2c7a3fc2b5914be46 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 10 Jun 2021 04:31:11 -0700 Subject: [PATCH 318/750] 2021-06-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From bf3dd7c6a13b14f9265953c2dfdbf23ad7ad433c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 11 Jun 2021 04:30:36 -0700 Subject: [PATCH 319/750] 2021-06-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9db52140da5583a0972333dd64b5644a90b4bec6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 12 Jun 2021 04:31:24 -0700 Subject: [PATCH 320/750] 2021-06-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ae1969a36bd9c7b5f98fcf9701da1f5f98a76b6c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 13 Jun 2021 04:30:36 -0700 Subject: [PATCH 321/750] 2021-06-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 0be88e4f592f72430e648ee35d3d69fe0854cba4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 14 Jun 2021 04:30:52 -0700 Subject: [PATCH 322/750] 2021-06-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 54519857a0ae5d9101dc200242df1fe7a8bf3a65 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 15 Jun 2021 04:30:38 -0700 Subject: [PATCH 323/750] 2021-06-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From c08dfc1f5feedd44b3f02a090092163780423a8e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 16 Jun 2021 04:30:40 -0700 Subject: [PATCH 324/750] 2021-06-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From d50a55c3701b7d7f76b0d4051db543bd1bde39be Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 17 Jun 2021 04:33:22 -0700 Subject: [PATCH 325/750] 2021-06-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 12884e5a944eaacee1b66f256ed8b469989ff882 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 18 Jun 2021 04:30:34 -0700 Subject: [PATCH 326/750] 2021-06-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 60540906c08a04fb3eb319b5b4fa0b8479ff7937 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 19 Jun 2021 04:30:54 -0700 Subject: [PATCH 327/750] 2021-06-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 8631147afc23f73487c98aa74227bca2eaa54979 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 20 Jun 2021 04:31:16 -0700 Subject: [PATCH 328/750] 2021-06-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 188414adb154c911ebb6e87ace37c4186e24f777 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 21 Jun 2021 04:32:22 -0700 Subject: [PATCH 329/750] 2021-06-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 8cecca4b004ca90b048e230aeccc167678e1f7f1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 22 Jun 2021 04:32:37 -0700 Subject: [PATCH 330/750] 2021-06-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From fd2b96350c55a08f7ef60ddc93a48dabbb695a97 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 23 Jun 2021 04:31:19 -0700 Subject: [PATCH 331/750] 2021-06-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From d1e6e85f4e36ca9900ccd5bc1d9dd471b8aecdb0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 24 Jun 2021 04:30:43 -0700 Subject: [PATCH 332/750] 2021-06-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 80ab404f410bea23178a11cd7c4a35a8c9ae557f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 25 Jun 2021 04:30:51 -0700 Subject: [PATCH 333/750] 2021-06-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From fe91ce2b1c47c9e2d6d097418f56c511b4afa94c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 26 Jun 2021 04:30:38 -0700 Subject: [PATCH 334/750] 2021-06-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9e110dc32d03c87882c259c49eb156a5a3f11cde Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 27 Jun 2021 04:31:04 -0700 Subject: [PATCH 335/750] 2021-06-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f6f07a709fb563158aea4ea1ba34d167e613072f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 28 Jun 2021 04:30:36 -0700 Subject: [PATCH 336/750] 2021-06-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From c72ebeb8c57b8117df2ff80a79d9d62a65a5a20d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 29 Jun 2021 04:33:17 -0700 Subject: [PATCH 337/750] 2021-06-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 719ac9f73080d91b320f6fe24573b605de8b274e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 30 Jun 2021 04:35:29 -0700 Subject: [PATCH 338/750] 2021-06-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 46d24b20edfdcc22e3b3edf548ca805be97e46e4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 1 Jul 2021 04:31:48 -0700 Subject: [PATCH 339/750] 2021-07-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 170204e0233584798de21a29880544431efb234b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 2 Jul 2021 04:31:56 -0700 Subject: [PATCH 340/750] 2021-07-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 8c9d534b055e0777c81fc01cedf526a736ead8bd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 3 Jul 2021 04:30:32 -0700 Subject: [PATCH 341/750] 2021-07-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From c4e0631c71f76d1bdf6fe0ad6c8c838f32e84838 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 4 Jul 2021 04:33:16 -0700 Subject: [PATCH 342/750] 2021-07-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6f75699488db1c65cdf5465d0abcee8f8db4503b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 5 Jul 2021 04:30:26 -0700 Subject: [PATCH 343/750] 2021-07-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a80a794eab1a3f40d9d35b3bd4036773f1b23645 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 6 Jul 2021 04:34:56 -0700 Subject: [PATCH 344/750] 2021-07-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 32cb59fef7e71d99be02c1ff8886de32ccaf3adc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 7 Jul 2021 04:30:31 -0700 Subject: [PATCH 345/750] 2021-07-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6c7af65565caca602f04fbda2088c481b1e3ee20 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 8 Jul 2021 04:30:56 -0700 Subject: [PATCH 346/750] 2021-07-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 172cc67f859163fcaba4cc57d1092b94988c1648 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 9 Jul 2021 04:30:33 -0700 Subject: [PATCH 347/750] 2021-07-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 7eb97d2b66754ff86ef4406edeb4684fd4b5c0f0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 10 Jul 2021 04:30:58 -0700 Subject: [PATCH 348/750] 2021-07-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4a2622a2f0543409d3c2f88381e8f321509cae29 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 11 Jul 2021 04:30:39 -0700 Subject: [PATCH 349/750] 2021-07-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5ef70ee208122e824afd7968bb86529ffeafa12a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 12 Jul 2021 04:35:23 -0700 Subject: [PATCH 350/750] 2021-07-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 28e09e11f4e05d7ae4b97e0030f315d9e5318766 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 13 Jul 2021 04:31:38 -0700 Subject: [PATCH 351/750] 2021-07-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From cc404533834c7b31786cbf1da95263880e8a15ec Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 14 Jul 2021 04:32:06 -0700 Subject: [PATCH 352/750] 2021-07-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 01e547a44c1d62778163fe9569e43881dd84ad14 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 15 Jul 2021 04:31:23 -0700 Subject: [PATCH 353/750] 2021-07-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6d4e1f3e2084fe01f35a0008a4747814359a8d7f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 16 Jul 2021 04:30:26 -0700 Subject: [PATCH 354/750] 2021-07-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f9bfd25eeadcfe6e0e4c6e48b7279faef790ab7c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 17 Jul 2021 04:34:28 -0700 Subject: [PATCH 355/750] 2021-07-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f8489b10d2da234b597224f7d50611f8681316c1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 18 Jul 2021 04:31:21 -0700 Subject: [PATCH 356/750] 2021-07-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 399a0d4daf0b0e45c667df848524283410034a99 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 19 Jul 2021 04:30:53 -0700 Subject: [PATCH 357/750] 2021-07-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e6fa32374714e56cd1588deb3eb9931d7ae1c63e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 20 Jul 2021 04:30:34 -0700 Subject: [PATCH 358/750] 2021-07-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 1d2731ea039456e9ec6aa5c4414e41fde079f078 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 21 Jul 2021 04:31:05 -0700 Subject: [PATCH 359/750] 2021-07-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From dd7956e8d71a96b3594e05f11cf0a1aa28324d4d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 22 Jul 2021 04:30:41 -0700 Subject: [PATCH 360/750] 2021-07-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 67b6c2cdd5a62b352125008f35ac2a0aeaae4361 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 23 Jul 2021 04:30:41 -0700 Subject: [PATCH 361/750] 2021-07-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b0276abf46582fb0cceb61d0bbcda1bfcdfde7dc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 24 Jul 2021 04:31:57 -0700 Subject: [PATCH 362/750] 2021-07-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 41207a348c604382ddea72fdab3e3404d595f809 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 25 Jul 2021 04:30:50 -0700 Subject: [PATCH 363/750] 2021-07-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 65eea277d50c597669c23f91901124920980c943 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 26 Jul 2021 04:31:58 -0700 Subject: [PATCH 364/750] 2021-07-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4debabac96a46e49665534424ab4f026e8d29ec0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 27 Jul 2021 04:30:31 -0700 Subject: [PATCH 365/750] 2021-07-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From bcd26f258c95fb838cce5aab939ea61ac71346ba Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 28 Jul 2021 04:31:40 -0700 Subject: [PATCH 366/750] 2021-07-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 6aac18195af2a2cd2733ad53ad83835378043187 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 29 Jul 2021 04:33:32 -0700 Subject: [PATCH 367/750] 2021-07-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4a34478da33dc683e41110e5cc05dabc922ac8d0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 30 Jul 2021 04:31:15 -0700 Subject: [PATCH 368/750] 2021-07-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 566af0521786e47c5975c364f587c037b7642139 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 31 Jul 2021 04:33:13 -0700 Subject: [PATCH 369/750] 2021-07-31 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 861e60b4b49c1ea3f33dba7f9ba5f4990df1b773 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 1 Aug 2021 04:30:45 -0700 Subject: [PATCH 370/750] 2021-08-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ba79d55bfe6b28ac4ac3f07f94b541b0ef177ded Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 2 Aug 2021 04:32:41 -0700 Subject: [PATCH 371/750] 2021-08-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 3f56c830efe50aa7ecf321dd56be97e731f8be63 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 3 Aug 2021 04:33:52 -0700 Subject: [PATCH 372/750] 2021-08-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ea4cb9306b48d06e8d4e33dc4d6c82ff23bf7e6f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 4 Aug 2021 04:33:21 -0700 Subject: [PATCH 373/750] 2021-08-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 342bcd22d0200368f86604f2a3b1e23525b6722a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 5 Aug 2021 04:31:10 -0700 Subject: [PATCH 374/750] 2021-08-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 98323c324453a2607dce5d8e1a9d8e4b095d7164 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 6 Aug 2021 04:35:42 -0700 Subject: [PATCH 375/750] 2021-08-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 195c3e0548ce9302e377dbf7bda75361c59c265c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 7 Aug 2021 04:31:33 -0700 Subject: [PATCH 376/750] 2021-08-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 104447216ed7bfd40b79221fda1111cc18310153 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 8 Aug 2021 04:33:43 -0700 Subject: [PATCH 377/750] 2021-08-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 287a24de54775fb12b558f9c0b18f5e56c95d8ac Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 9 Aug 2021 04:33:44 -0700 Subject: [PATCH 378/750] 2021-08-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ea9ce680f93091792676d13de0ea6c8a4e4bd5af Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 10 Aug 2021 04:31:49 -0700 Subject: [PATCH 379/750] 2021-08-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From cc7366d06af1e6bd25c0deae936b34cfb88f4c6a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 11 Aug 2021 04:32:04 -0700 Subject: [PATCH 380/750] 2021-08-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 14434937eca2e7201392fc4b8064a4fc236d9b62 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 12 Aug 2021 04:32:52 -0700 Subject: [PATCH 381/750] 2021-08-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 4f63c34e4d43d4f4a25b9e7bd3808025b421c5bd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 13 Aug 2021 04:34:19 -0700 Subject: [PATCH 382/750] 2021-08-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 1aad1a0704e1020aded330676c64e33636d11091 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 14 Aug 2021 04:30:56 -0700 Subject: [PATCH 383/750] 2021-08-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 38fdf5576e9cbc9113cae5439d3e59700bb78386 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 15 Aug 2021 04:30:50 -0700 Subject: [PATCH 384/750] 2021-08-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From ef9dd4311b8010563fabfd01e7e4e4b84182fed3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 16 Aug 2021 04:31:05 -0700 Subject: [PATCH 385/750] 2021-08-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From bb9be94b675cc539ac958689cb3b6be62d8f450b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 17 Aug 2021 04:31:55 -0700 Subject: [PATCH 386/750] 2021-08-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 282eb240076a0d0038c6be6c1a8b6aef5352c9ab Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 18 Aug 2021 04:30:25 -0700 Subject: [PATCH 387/750] 2021-08-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 3fabfd4d01dbeaf534a5371a9190b6d586cfa2d3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 19 Aug 2021 04:32:16 -0700 Subject: [PATCH 388/750] 2021-08-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 470abd764a29d157d673a11361a5b42e6b861a9c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 20 Aug 2021 04:37:52 -0700 Subject: [PATCH 389/750] 2021-08-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a6efa2c4cf15267eeaa5f26276cd5e2928bdabff Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 21 Aug 2021 04:32:58 -0700 Subject: [PATCH 390/750] 2021-08-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a7956b3a6312d38a35673b410ee04a89485faacb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 22 Aug 2021 04:32:36 -0700 Subject: [PATCH 391/750] 2021-08-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 2dec34b43feb309d5b3236b0e09300206fe26266 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 23 Aug 2021 04:32:51 -0700 Subject: [PATCH 392/750] 2021-08-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From e807e285d51022d854d18919ee59652a2264f3e8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 24 Aug 2021 04:32:25 -0700 Subject: [PATCH 393/750] 2021-08-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 8491d23926c85dd71145b77dfced186692c7ee14 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 25 Aug 2021 04:30:56 -0700 Subject: [PATCH 394/750] 2021-08-25 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 554c16fed8876c15d293f5856dd693ae5e6117e0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 26 Aug 2021 04:37:29 -0700 Subject: [PATCH 395/750] 2021-08-26 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From d6ec4325a4fb6c4dab3961ea0bea91daa14a1e33 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 27 Aug 2021 04:31:52 -0700 Subject: [PATCH 396/750] 2021-08-27 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5c714fb173d50c89b16ebf7076f524c5ec5dba09 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 28 Aug 2021 04:32:06 -0700 Subject: [PATCH 397/750] 2021-08-28 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 15b5cdfc1c23087cab0ebcbb2075c997b362861e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 29 Aug 2021 04:32:04 -0700 Subject: [PATCH 398/750] 2021-08-29 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 480157e878a3fa63957989b978090ea0e28876b8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 30 Aug 2021 04:33:33 -0700 Subject: [PATCH 399/750] 2021-08-30 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From be71e501860bd549a6b800eb9cbaa28ea3bb842c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 31 Aug 2021 04:35:23 -0700 Subject: [PATCH 400/750] 2021-08-31 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 2cc1a92c5d26f9b7cc460bf53218e9c66bba107b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 1 Sep 2021 04:32:45 -0700 Subject: [PATCH 401/750] 2021-09-01 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a5c0706e5ca5759df85a00334eb72df5c951d41a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 2 Sep 2021 04:31:08 -0700 Subject: [PATCH 402/750] 2021-09-02 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 9b9c68efa720ae1506bdb5c11ae81e229c49f096 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 3 Sep 2021 04:34:15 -0700 Subject: [PATCH 403/750] 2021-09-03 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 789443fafc0e99be66b1701db2555a4ccafd8dd6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 4 Sep 2021 04:30:45 -0700 Subject: [PATCH 404/750] 2021-09-04 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 291f90c49fd083cb5eb504b150a450a1cf530150 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 5 Sep 2021 04:33:21 -0700 Subject: [PATCH 405/750] 2021-09-05 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b620aef8fbe127149b7a95d8dab7a4929a88bd75 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 6 Sep 2021 04:34:59 -0700 Subject: [PATCH 406/750] 2021-09-06 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 7f5b73ecf41a588135d32b4f21b064f4f4f30396 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 7 Sep 2021 04:36:16 -0700 Subject: [PATCH 407/750] 2021-09-07 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 2305bc6a2ae409dbaa57e631c6904fd6b836991c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 8 Sep 2021 04:33:42 -0700 Subject: [PATCH 408/750] 2021-09-08 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From f6b4599712e2ca14da3f042b9880f56d6583d7a8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 9 Sep 2021 04:32:54 -0700 Subject: [PATCH 409/750] 2021-09-09 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 210b3915c44fe6811db4d265d3833950bd7b06cb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 10 Sep 2021 04:33:05 -0700 Subject: [PATCH 410/750] 2021-09-10 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 85271249d71f32f16ca573c04bbcfb54bd2b8c19 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 11 Sep 2021 04:31:14 -0700 Subject: [PATCH 411/750] 2021-09-11 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 7e9f33e99a242ad5f1cf0209e032244231064cc5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 12 Sep 2021 04:32:28 -0700 Subject: [PATCH 412/750] 2021-09-12 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 5c103db1b08ffc56cee2cb84a699fded228318cd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 13 Sep 2021 04:39:44 -0700 Subject: [PATCH 413/750] 2021-09-13 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 518361ab42d958b6e2ec1f40161554e12dc52ad0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 14 Sep 2021 04:32:43 -0700 Subject: [PATCH 414/750] 2021-09-14 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b65d6d8fda527371a4320553f67d3ca3d7f53849 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 15 Sep 2021 04:32:28 -0700 Subject: [PATCH 415/750] 2021-09-15 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 79adbd253ee0731a6d0988d50c6671daf39a3947 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 16 Sep 2021 04:31:59 -0700 Subject: [PATCH 416/750] 2021-09-16 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From a09860207d4b518e4d622c9bda997257973b7f87 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 17 Sep 2021 04:31:48 -0700 Subject: [PATCH 417/750] 2021-09-17 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 32633e743de8afe79359681777daa4786b631bb2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 18 Sep 2021 04:31:13 -0700 Subject: [PATCH 418/750] 2021-09-18 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 34d868cd74369ae0a1307ba68399f94912ec3700 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 19 Sep 2021 04:32:28 -0700 Subject: [PATCH 419/750] 2021-09-19 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b39535317e6ad43b23efab00bccbe84674c9260c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 20 Sep 2021 04:32:20 -0700 Subject: [PATCH 420/750] 2021-09-20 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 127eb24a26ff5de3468d1940e03c2dc2bb243f75 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 21 Sep 2021 04:32:29 -0700 Subject: [PATCH 421/750] 2021-09-21 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 793803bb5267d9de253f6848a434660ae00efd6d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 22 Sep 2021 04:32:50 -0700 Subject: [PATCH 422/750] 2021-09-22 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 743c06b21d7e20b0d7a5456c5e5e829a89222ea2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 23 Sep 2021 04:32:12 -0700 Subject: [PATCH 423/750] 2021-09-23 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From 72c88427d60b9a5c861e81da4f2b45713869afae Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 24 Sep 2021 04:32:17 -0700 Subject: [PATCH 424/750] 2021-09-24 nightly release (0f1c579d56df637a3efc2aedafd49f8e54e07f06) From b2e2f5b75337e3ad35233e183efd4affd9b59305 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 25 Sep 2021 04:31:15 -0700 Subject: [PATCH 425/750] 2021-09-25 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c32bf8..9406868 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -160,7 +160,7 @@ jobs: binary_macos_wheel: <<: *binary_common macos: - xcode: "9.4.1" + xcode: "12.0" steps: - checkout_merge # - run: @@ -186,7 +186,7 @@ jobs: binary_macos_conda: <<: *binary_common macos: - xcode: "9.4.1" + xcode: "12.0" steps: - checkout_merge # - run: @@ -408,7 +408,7 @@ jobs: unittest_macos_cpu: <<: *binary_common macos: - xcode: "9.4.1" + xcode: "12.0" resource_class: large steps: - checkout From a71f32f6d616ffbefbf719bc407bec88fd3b9f1d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 26 Sep 2021 04:35:01 -0700 Subject: [PATCH 426/750] 2021-09-26 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From e7143dd8edbe3935dfa5a266fbef0b909807bc56 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 27 Sep 2021 04:31:11 -0700 Subject: [PATCH 427/750] 2021-09-27 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 7eacb3c3e2bbdba5490fd6aba8c8866d437cd238 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 28 Sep 2021 04:31:12 -0700 Subject: [PATCH 428/750] 2021-09-28 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From d88a9e5e84094f4c62620b39fbe9ce0b63e57547 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 29 Sep 2021 04:33:25 -0700 Subject: [PATCH 429/750] 2021-09-29 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 47cd3124b8ea69fb70ed62a3f59f8e4c3da8738d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Sep 2021 04:31:15 -0700 Subject: [PATCH 430/750] 2021-09-30 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 7969fcc2a531b848f62e42ab8401b48d70b03d45 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 1 Oct 2021 04:35:16 -0700 Subject: [PATCH 431/750] 2021-10-01 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From f9b7617320e14cb466aeb69b4d07e18a32a66461 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 2 Oct 2021 04:35:16 -0700 Subject: [PATCH 432/750] 2021-10-02 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 9dd563ec7da3518215df835cab46d812ef4cdee5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 3 Oct 2021 04:35:25 -0700 Subject: [PATCH 433/750] 2021-10-03 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From b5b602ca8bc80234fdab478c0c4ec6f48fde75f3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 4 Oct 2021 04:33:10 -0700 Subject: [PATCH 434/750] 2021-10-04 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 4affc53c11282a84ca8e1b68965b15352b2fdbad Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 5 Oct 2021 04:30:48 -0700 Subject: [PATCH 435/750] 2021-10-05 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From f97c5f60b80f7bfa130a8431f9a6d3856ca24ea0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 6 Oct 2021 04:30:33 -0700 Subject: [PATCH 436/750] 2021-10-06 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 2f4b09d8213bd5d821788821cdf4dabe807a0fa2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 7 Oct 2021 04:33:29 -0700 Subject: [PATCH 437/750] 2021-10-07 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From d62ca51599ecdd4f3503870e8ff02192270c9277 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 8 Oct 2021 04:34:02 -0700 Subject: [PATCH 438/750] 2021-10-08 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From cce4a17982c0229ce26343c6f57061cafc229ddb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 9 Oct 2021 04:32:13 -0700 Subject: [PATCH 439/750] 2021-10-09 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 9f47bd0a90f06cd0e44c3cb94822fc0b345cccb8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 10 Oct 2021 04:31:25 -0700 Subject: [PATCH 440/750] 2021-10-10 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From ce537f18159710a07d1a096f999cea1d466d7d7e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 11 Oct 2021 04:32:51 -0700 Subject: [PATCH 441/750] 2021-10-11 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 0e74ad7a4b8d3247b7946e1d157293b6d9d4b6cd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 12 Oct 2021 04:40:22 -0700 Subject: [PATCH 442/750] 2021-10-12 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From e0b524b68e366c3e7fa8787e28ee05f13227d006 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 13 Oct 2021 04:30:47 -0700 Subject: [PATCH 443/750] 2021-10-13 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From ceb08af1b2452c79cd2c5a8d07958fde95b79520 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 14 Oct 2021 04:39:17 -0700 Subject: [PATCH 444/750] 2021-10-14 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 3dbce061de03bf25dc11cab99b8f3879ff175cec Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 15 Oct 2021 04:34:55 -0700 Subject: [PATCH 445/750] 2021-10-15 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 2d6b487c270b6a782c04de2ffe11d95f0b15673a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 16 Oct 2021 04:35:16 -0700 Subject: [PATCH 446/750] 2021-10-16 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From f633e3b6ead30f35a0e8e842a18ea4d0d2da2953 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 17 Oct 2021 04:33:28 -0700 Subject: [PATCH 447/750] 2021-10-17 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 4811aea55706879404220f51d76fc6162fe3afd3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 18 Oct 2021 04:46:12 -0700 Subject: [PATCH 448/750] 2021-10-18 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 3670199fe24000660c3fafc7e69b073b58c0a366 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 19 Oct 2021 04:31:56 -0700 Subject: [PATCH 449/750] 2021-10-19 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 7c2c9c66c99b55e8f4aeed1be7215f66449ee766 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 20 Oct 2021 04:35:01 -0700 Subject: [PATCH 450/750] 2021-10-20 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From ed3f6c3ce3ad902f3b64be6c8fe2abcb79bbd884 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 21 Oct 2021 04:31:20 -0700 Subject: [PATCH 451/750] 2021-10-21 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 88234978c778ae456c21a17dff1ff341eb90be35 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 22 Oct 2021 04:31:49 -0700 Subject: [PATCH 452/750] 2021-10-22 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From b81df80330411ae8ca239d4684ce86d42fe4bf19 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 23 Oct 2021 04:32:41 -0700 Subject: [PATCH 453/750] 2021-10-23 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 3c74d0d35078f2d4266f903151e4caeef3b3a866 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 24 Oct 2021 04:32:14 -0700 Subject: [PATCH 454/750] 2021-10-24 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From f32abd4444ea068165f4cb788b899effa43897a9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 25 Oct 2021 04:32:23 -0700 Subject: [PATCH 455/750] 2021-10-25 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 2ab9c929bd7b720c0e8d082d92f2ccd8d5dc7857 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 26 Oct 2021 04:43:07 -0700 Subject: [PATCH 456/750] 2021-10-26 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 75eb81dab518e9346805ff31b5550ab4c05a31be Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 27 Oct 2021 04:30:52 -0700 Subject: [PATCH 457/750] 2021-10-27 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From 474cae5757d0a98d84b8fee896c6a5495b9246e1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 28 Oct 2021 04:40:35 -0700 Subject: [PATCH 458/750] 2021-10-28 nightly release (e8c895cddb3e5cb4fb35956a30c6c090f5e8e5f8) From c00007f1a24934a2f5af23f594d47ec846ff72d3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 29 Oct 2021 04:34:24 -0700 Subject: [PATCH 459/750] 2021-10-29 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) --- packaging/wheel/relocate.py | 283 +++++++++++++++---------------- setup.py | 150 ++++++++-------- test/test_csprng.py | 330 ++++++++++++++++++++++++++---------- torchcsprng/__init__.pyi | 6 - 4 files changed, 461 insertions(+), 308 deletions(-) diff --git a/packaging/wheel/relocate.py b/packaging/wheel/relocate.py index b5b0db9..fd92b68 100644 --- a/packaging/wheel/relocate.py +++ b/packaging/wheel/relocate.py @@ -2,46 +2,63 @@ """Helper script to package wheels and relocate binaries.""" -# Standard library imports -import os -import io -import sys import glob -import shutil -import zipfile import hashlib +import io + +# Standard library imports +import os +import os.path as osp import platform +import shutil import subprocess -import os.path as osp +import sys +import zipfile from base64 import urlsafe_b64encode # Third party imports -if sys.platform == 'linux': +if sys.platform == "linux": from auditwheel.lddtree import lddtree from wheel.bdist_wheel import get_abi_tag ALLOWLIST = { - 'libgcc_s.so.1', 'libstdc++.so.6', 'libm.so.6', - 'libdl.so.2', 'librt.so.1', 'libc.so.6', - 'libnsl.so.1', 'libutil.so.1', 'libpthread.so.0', - 'libresolv.so.2', 'libX11.so.6', 'libXext.so.6', - 'libXrender.so.1', 'libICE.so.6', 'libSM.so.6', - 'libGL.so.1', 'libgobject-2.0.so.0', 'libgthread-2.0.so.0', - 'libglib-2.0.so.0', 'ld-linux-x86-64.so.2', 'ld-2.17.so' + "libgcc_s.so.1", + "libstdc++.so.6", + "libm.so.6", + "libdl.so.2", + "librt.so.1", + "libc.so.6", + "libnsl.so.1", + "libutil.so.1", + "libpthread.so.0", + "libresolv.so.2", + "libX11.so.6", + "libXext.so.6", + "libXrender.so.1", + "libICE.so.6", + "libSM.so.6", + "libGL.so.1", + "libgobject-2.0.so.0", + "libgthread-2.0.so.0", + "libglib-2.0.so.0", + "ld-linux-x86-64.so.2", + "ld-2.17.so", } WINDOWS_ALLOWLIST = { - 'MSVCP140.dll', 'KERNEL32.dll', - 'VCRUNTIME140_1.dll', 'VCRUNTIME140.dll', - 'api-ms-win-crt-heap-l1-1-0.dll', - 'api-ms-win-crt-runtime-l1-1-0.dll', - 'api-ms-win-crt-stdio-l1-1-0.dll', - 'api-ms-win-crt-filesystem-l1-1-0.dll', - 'api-ms-win-crt-string-l1-1-0.dll', - 'api-ms-win-crt-environment-l1-1-0.dll', - 'api-ms-win-crt-math-l1-1-0.dll', - 'api-ms-win-crt-convert-l1-1-0.dll' + "MSVCP140.dll", + "KERNEL32.dll", + "VCRUNTIME140_1.dll", + "VCRUNTIME140.dll", + "api-ms-win-crt-heap-l1-1-0.dll", + "api-ms-win-crt-runtime-l1-1-0.dll", + "api-ms-win-crt-stdio-l1-1-0.dll", + "api-ms-win-crt-filesystem-l1-1-0.dll", + "api-ms-win-crt-string-l1-1-0.dll", + "api-ms-win-crt-environment-l1-1-0.dll", + "api-ms-win-crt-math-l1-1-0.dll", + "api-ms-win-crt-convert-l1-1-0.dll", } @@ -64,20 +81,18 @@ def rehash(path, blocksize=1 << 20): """Return (hash, length) for path using hashlib.sha256()""" h = hashlib.sha256() length = 0 - with open(path, 'rb') as f: + with open(path, "rb") as f: for block in read_chunks(f, size=blocksize): length += len(block) h.update(block) - digest = 'sha256=' + urlsafe_b64encode( - h.digest() - ).decode('latin1').rstrip('=') + digest = "sha256=" + urlsafe_b64encode(h.digest()).decode("latin1").rstrip("=") # unicode/str python2 issues return (digest, str(length)) # type: ignore def unzip_file(file, dest): """Decompress zip `file` into directory `dest`.""" - with zipfile.ZipFile(file, 'r') as zip_ref: + with zipfile.ZipFile(file, "r") as zip_ref: zip_ref.extractall(dest) @@ -88,8 +103,7 @@ def is_program_installed(basename): On macOS systems, a .app is considered installed if it exists. """ - if (sys.platform == 'darwin' and basename.endswith('.app') and - osp.exists(basename)): + if sys.platform == "darwin" and basename.endswith(".app") and osp.exists(basename): return basename for path in os.environ["PATH"].split(os.pathsep): @@ -105,9 +119,9 @@ def find_program(basename): (return None if not found) """ names = [basename] - if os.name == 'nt': + if os.name == "nt": # Windows platforms - extensions = ('.exe', '.bat', '.cmd', '.dll') + extensions = (".exe", ".bat", ".cmd", ".dll") if not basename.endswith(extensions): names = [basename + ext for ext in extensions] + [basename] for name in names: @@ -118,19 +132,18 @@ def find_program(basename): def patch_new_path(library_path, new_dir): library = osp.basename(library_path) - name, *rest = library.split('.') - rest = '.'.join(rest) - hash_id = hashlib.sha256(library_path.encode('utf-8')).hexdigest()[:8] - new_name = '.'.join([name, hash_id, rest]) + name, *rest = library.split(".") + rest = ".".join(rest) + hash_id = hashlib.sha256(library_path.encode("utf-8")).hexdigest()[:8] + new_name = ".".join([name, hash_id, rest]) return osp.join(new_dir, new_name) def find_dll_dependencies(dumpbin, binary): - out = subprocess.run([dumpbin, "/dependents", binary], - stdout=subprocess.PIPE) - out = out.stdout.strip().decode('utf-8') - start_index = out.find('dependencies:') + len('dependencies:') - end_index = out.find('Summary') + out = subprocess.run([dumpbin, "/dependents", binary], stdout=subprocess.PIPE) + out = out.stdout.strip().decode("utf-8") + start_index = out.find("dependencies:") + len("dependencies:") + end_index = out.find("Summary") dlls = out[start_index:end_index].strip() dlls = dlls.split(os.linesep) dlls = [dll.strip() for dll in dlls] @@ -145,13 +158,13 @@ def relocate_elf_library(patchelf, output_dir, output_library, binary): rename and copy them into the wheel while updating their respective rpaths. """ - print('Relocating {0}'.format(binary)) + print("Relocating {0}".format(binary)) binary_path = osp.join(output_library, binary) ld_tree = lddtree(binary_path) - tree_libs = ld_tree['libs'] + tree_libs = ld_tree["libs"] - binary_queue = [(n, binary) for n in ld_tree['needed']] + binary_queue = [(n, binary) for n in ld_tree["needed"]] binary_paths = {binary: binary_path} binary_dependencies = {} @@ -160,13 +173,13 @@ def relocate_elf_library(patchelf, output_dir, output_library, binary): library_info = tree_libs[library] print(library) - if library_info['path'] is None: - print('Omitting {0}'.format(library)) + if library_info["path"] is None: + print("Omitting {0}".format(library)) continue if library in ALLOWLIST: # Omit glibc/gcc/system libraries - print('Omitting {0}'.format(library)) + print("Omitting {0}".format(library)) continue parent_dependencies = binary_dependencies.get(parent, []) @@ -176,11 +189,11 @@ def relocate_elf_library(patchelf, output_dir, output_library, binary): if library in binary_paths: continue - binary_paths[library] = library_info['path'] - binary_queue += [(n, library) for n in library_info['needed']] + binary_paths[library] = library_info["path"] + binary_queue += [(n, library) for n in library_info["needed"]] - print('Copying dependencies to wheel directory') - new_libraries_path = osp.join(output_dir, 'torchcsprng.libs') + print("Copying dependencies to wheel directory") + new_libraries_path = osp.join(output_dir, "torchcsprng.libs") os.makedirs(new_libraries_path) new_names = {binary: binary_path} @@ -189,11 +202,11 @@ def relocate_elf_library(patchelf, output_dir, output_library, binary): if library != binary: library_path = binary_paths[library] new_library_path = patch_new_path(library_path, new_libraries_path) - print('{0} -> {1}'.format(library, new_library_path)) + print("{0} -> {1}".format(library, new_library_path)) shutil.copyfile(library_path, new_library_path) new_names[library] = new_library_path - print('Updating dependency names by new files') + print("Updating dependency names by new files") for library in binary_paths: if library != binary: if library not in binary_dependencies: @@ -202,59 +215,35 @@ def relocate_elf_library(patchelf, output_dir, output_library, binary): new_library_name = new_names[library] for dep in library_dependencies: new_dep = osp.basename(new_names[dep]) - print('{0}: {1} -> {2}'.format(library, dep, new_dep)) + print("{0}: {1} -> {2}".format(library, dep, new_dep)) subprocess.check_output( - [ - patchelf, - '--replace-needed', - dep, - new_dep, - new_library_name - ], - cwd=new_libraries_path) - - print('Updating library rpath') + [patchelf, "--replace-needed", dep, new_dep, new_library_name], + cwd=new_libraries_path, + ) + + print("Updating library rpath") subprocess.check_output( - [ - patchelf, - '--set-rpath', - "$ORIGIN", - new_library_name - ], - cwd=new_libraries_path) + [patchelf, "--set-rpath", "$ORIGIN", new_library_name], + cwd=new_libraries_path, + ) subprocess.check_output( - [ - patchelf, - '--print-rpath', - new_library_name - ], - cwd=new_libraries_path) + [patchelf, "--print-rpath", new_library_name], cwd=new_libraries_path + ) print("Update library dependencies") library_dependencies = binary_dependencies[binary] for dep in library_dependencies: new_dep = osp.basename(new_names[dep]) - print('{0}: {1} -> {2}'.format(binary, dep, new_dep)) + print("{0}: {1} -> {2}".format(binary, dep, new_dep)) subprocess.check_output( - [ - patchelf, - '--replace-needed', - dep, - new_dep, - binary - ], - cwd=output_library) - - print('Update library rpath') + [patchelf, "--replace-needed", dep, new_dep, binary], cwd=output_library + ) + + print("Update library rpath") subprocess.check_output( - [ - patchelf, - '--set-rpath', - "$ORIGIN:$ORIGIN/../torchcsprng.libs", - binary_path - ], - cwd=output_library + [patchelf, "--set-rpath", "$ORIGIN:$ORIGIN/../torchcsprng.libs", binary_path], + cwd=output_library, ) @@ -265,7 +254,7 @@ def relocate_dll_library(dumpbin, output_dir, output_library, binary): Given a shared library, find the transitive closure of its dependencies, rename and copy them into the wheel. """ - print('Relocating {0}'.format(binary)) + print("Relocating {0}".format(binary)) binary_path = osp.join(output_library, binary) library_dlls = find_dll_dependencies(dumpbin, binary_path) @@ -275,19 +264,19 @@ def relocate_dll_library(dumpbin, output_dir, output_library, binary): while binary_queue != []: library, parent = binary_queue.pop(0) - if library in WINDOWS_ALLOWLIST or library.startswith('api-ms-win'): - print('Omitting {0}'.format(library)) + if library in WINDOWS_ALLOWLIST or library.startswith("api-ms-win"): + print("Omitting {0}".format(library)) continue library_path = find_program(library) if library_path is None: - print('{0} not found'.format(library)) + print("{0} not found".format(library)) continue - if osp.basename(osp.dirname(library_path)) == 'system32': + if osp.basename(osp.dirname(library_path)) == "system32": continue - print('{0}: {1}'.format(library, library_path)) + print("{0}: {1}".format(library, library_path)) parent_dependencies = binary_dependencies.get(parent, []) parent_dependencies.append(library) binary_dependencies[parent] = parent_dependencies @@ -299,55 +288,57 @@ def relocate_dll_library(dumpbin, output_dir, output_library, binary): downstream_dlls = find_dll_dependencies(dumpbin, library_path) binary_queue += [(n, library) for n in downstream_dlls] - print('Copying dependencies to wheel directory') - package_dir = osp.join(output_dir, 'torchcsprng') + print("Copying dependencies to wheel directory") + package_dir = osp.join(output_dir, "torchcsprng") for library in binary_paths: if library != binary: library_path = binary_paths[library] new_library_path = osp.join(package_dir, library) - print('{0} -> {1}'.format(library, new_library_path)) + print("{0} -> {1}".format(library, new_library_path)) shutil.copyfile(library_path, new_library_path) def compress_wheel(output_dir, wheel, wheel_dir, wheel_name): """Create RECORD file and compress wheel distribution.""" - print('Update RECORD file in wheel') - dist_info = glob.glob(osp.join(output_dir, '*.dist-info'))[0] - record_file = osp.join(dist_info, 'RECORD') + print("Update RECORD file in wheel") + dist_info = glob.glob(osp.join(output_dir, "*.dist-info"))[0] + record_file = osp.join(dist_info, "RECORD") - with open(record_file, 'w') as f: + with open(record_file, "w") as f: for root, _, files in os.walk(output_dir): for this_file in files: full_file = osp.join(root, this_file) rel_file = osp.relpath(full_file, output_dir) if full_file == record_file: - f.write('{0},,\n'.format(rel_file)) + f.write("{0},,\n".format(rel_file)) else: digest, size = rehash(full_file) - f.write('{0},{1},{2}\n'.format(rel_file, digest, size)) + f.write("{0},{1},{2}\n".format(rel_file, digest, size)) - print('Compressing wheel') + print("Compressing wheel") base_wheel_name = osp.join(wheel_dir, wheel_name) - shutil.make_archive(base_wheel_name, 'zip', output_dir) + shutil.make_archive(base_wheel_name, "zip", output_dir) os.remove(wheel) - shutil.move('{0}.zip'.format(base_wheel_name), wheel) + shutil.move("{0}.zip".format(base_wheel_name), wheel) shutil.rmtree(output_dir) def patch_linux(): # Get patchelf location - patchelf = find_program('patchelf') + patchelf = find_program("patchelf") if patchelf is None: - raise FileNotFoundError('Patchelf was not found in the system, please' - ' make sure that is available on the PATH.') + raise FileNotFoundError( + "Patchelf was not found in the system, please" + " make sure that is available on the PATH." + ) # Find wheel - print('Finding wheels...') - wheels = glob.glob(osp.join(PACKAGE_ROOT, 'dist', '*.whl')) - output_dir = osp.join(PACKAGE_ROOT, 'dist', '.wheel-process') + print("Finding wheels...") + wheels = glob.glob(osp.join(PACKAGE_ROOT, "dist", "*.whl")) + output_dir = osp.join(PACKAGE_ROOT, "dist", ".wheel-process") - image_binary = 'image.so' - video_binary = 'video_reader.so' + image_binary = "image.so" + video_binary = "video_reader.so" torchcsprng_binaries = [image_binary, video_binary] for wheel in wheels: if osp.exists(output_dir): @@ -355,37 +346,38 @@ def patch_linux(): os.makedirs(output_dir) - print('Unzipping wheel...') + print("Unzipping wheel...") wheel_file = osp.basename(wheel) wheel_dir = osp.dirname(wheel) - print('{0}'.format(wheel_file)) + print("{0}".format(wheel_file)) wheel_name, _ = osp.splitext(wheel_file) unzip_file(wheel, output_dir) - print('Finding ELF dependencies...') - output_library = osp.join(output_dir, 'torchcsprng') + print("Finding ELF dependencies...") + output_library = osp.join(output_dir, "torchcsprng") for binary in torchcsprng_binaries: if osp.exists(osp.join(output_library, binary)): - relocate_elf_library( - patchelf, output_dir, output_library, binary) + relocate_elf_library(patchelf, output_dir, output_library, binary) compress_wheel(output_dir, wheel, wheel_dir, wheel_name) def patch_win(): # Get dumpbin location - dumpbin = find_program('dumpbin') + dumpbin = find_program("dumpbin") if dumpbin is None: - raise FileNotFoundError('Dumpbin was not found in the system, please' - ' make sure that is available on the PATH.') + raise FileNotFoundError( + "Dumpbin was not found in the system, please" + " make sure that is available on the PATH." + ) # Find wheel - print('Finding wheels...') - wheels = glob.glob(osp.join(PACKAGE_ROOT, 'dist', '*.whl')) - output_dir = osp.join(PACKAGE_ROOT, 'dist', '.wheel-process') + print("Finding wheels...") + wheels = glob.glob(osp.join(PACKAGE_ROOT, "dist", "*.whl")) + output_dir = osp.join(PACKAGE_ROOT, "dist", ".wheel-process") - image_binary = 'image.pyd' - video_binary = 'video_reader.pyd' + image_binary = "image.pyd" + video_binary = "video_reader.pyd" torchcsprng_binaries = [image_binary, video_binary] for wheel in wheels: if osp.exists(output_dir): @@ -393,25 +385,24 @@ def patch_win(): os.makedirs(output_dir) - print('Unzipping wheel...') + print("Unzipping wheel...") wheel_file = osp.basename(wheel) wheel_dir = osp.dirname(wheel) - print('{0}'.format(wheel_file)) + print("{0}".format(wheel_file)) wheel_name, _ = osp.splitext(wheel_file) unzip_file(wheel, output_dir) - print('Finding DLL/PE dependencies...') - output_library = osp.join(output_dir, 'torchcsprng') + print("Finding DLL/PE dependencies...") + output_library = osp.join(output_dir, "torchcsprng") for binary in torchcsprng_binaries: if osp.exists(osp.join(output_library, binary)): - relocate_dll_library( - dumpbin, output_dir, output_library, binary) + relocate_dll_library(dumpbin, output_dir, output_library, binary) compress_wheel(output_dir, wheel, wheel_dir, wheel_name) -if __name__ == '__main__': - if sys.platform == 'linux': +if __name__ == "__main__": + if sys.platform == "linux": patch_linux() - elif sys.platform == 'win32': + elif sys.platform == "win32": patch_win() diff --git a/setup.py b/setup.py index b165357..ff1ad67 100644 --- a/setup.py +++ b/setup.py @@ -1,37 +1,44 @@ -import os -import sys -import subprocess -from setuptools import setup, find_packages import distutils.command.clean import glob +import os import shutil +import subprocess +import sys import torch -from torch.utils.cpp_extension import BuildExtension, CppExtension, \ - CUDAExtension, CUDA_HOME +from setuptools import setup, find_packages +from torch.utils.cpp_extension import ( + BuildExtension, + CppExtension, + CUDAExtension, + CUDA_HOME, +) -version = open('version.txt', 'r').read().strip() -sha = 'Unknown' -package_name = 'torchcsprng' +version = open("version.txt", "r").read().strip() +sha = "Unknown" +package_name = "torchcsprng" cwd = os.path.dirname(os.path.abspath(__file__)) try: - sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode( - 'ascii').strip() + sha = ( + subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=cwd) + .decode("ascii") + .strip() + ) except Exception: pass -if os.getenv('BUILD_VERSION'): - version = os.getenv('BUILD_VERSION') -elif sha != 'Unknown': - version += '+' + sha[:7] +if os.getenv("BUILD_VERSION"): + version = os.getenv("BUILD_VERSION") +elif sha != "Unknown": + version += "+" + sha[:7] print("Building wheel {}-{}".format(package_name, version)) def write_version_file(): - version_path = os.path.join(cwd, 'torchcsprng', 'version.py') - with open(version_path, 'w') as f: + version_path = os.path.join(cwd, "torchcsprng", "version.py") + with open(version_path, "w") as f: f.write("__version__ = '{}'\n".format(version)) f.write("git_version = {}\n".format(repr(sha))) # f.write("from torchcsprng.extension import _check_cuda_version\n") @@ -44,9 +51,9 @@ def write_version_file(): with open("README.md", "r") as fh: long_description = fh.read() -pytorch_dep = 'torch' -if os.getenv('PYTORCH_VERSION'): - pytorch_dep += "==" + os.getenv('PYTORCH_VERSION') +pytorch_dep = "torch" +if os.getenv("PYTORCH_VERSION"): + pytorch_dep += "==" + os.getenv("PYTORCH_VERSION") requirements = [ pytorch_dep, @@ -61,61 +68,60 @@ def append_flags(flags, flags_to_append): def get_extensions(): - build_cuda = torch.cuda.is_available() or os.getenv('FORCE_CUDA', - '0') == '1' + build_cuda = torch.cuda.is_available() or os.getenv("FORCE_CUDA", "0") == "1" - module_name = 'torchcsprng' + module_name = "torchcsprng" - extensions_dir = os.path.join(cwd, module_name, 'csrc') + extensions_dir = os.path.join(cwd, module_name, "csrc") - openmp = 'ATen parallel backend: OpenMP' in torch.__config__.parallel_info() + openmp = "ATen parallel backend: OpenMP" in torch.__config__.parallel_info() - main_file = glob.glob(os.path.join(extensions_dir, '*.cpp')) - source_cpu = glob.glob(os.path.join(extensions_dir, 'cpu', '*.cpp')) + main_file = glob.glob(os.path.join(extensions_dir, "*.cpp")) + source_cpu = glob.glob(os.path.join(extensions_dir, "cpu", "*.cpp")) sources = main_file + source_cpu extension = CppExtension define_macros = [] - cxx_flags = os.getenv('CXX_FLAGS', '') - if cxx_flags == '': + cxx_flags = os.getenv("CXX_FLAGS", "") + if cxx_flags == "": cxx_flags = [] else: - cxx_flags = cxx_flags.split(' ') + cxx_flags = cxx_flags.split(" ") if openmp: - if sys.platform == 'linux': - cxx_flags = append_flags(cxx_flags, ['-fopenmp']) - elif sys.platform == 'win32': - cxx_flags = append_flags(cxx_flags, ['/openmp']) + if sys.platform == "linux": + cxx_flags = append_flags(cxx_flags, ["-fopenmp"]) + elif sys.platform == "win32": + cxx_flags = append_flags(cxx_flags, ["/openmp"]) # elif sys.platform == 'darwin': # cxx_flags = append_flags(cxx_flags, ['-Xpreprocessor', '-fopenmp']) if build_cuda: extension = CUDAExtension - source_cuda = glob.glob(os.path.join(extensions_dir, 'cuda', '*.cu')) + source_cuda = glob.glob(os.path.join(extensions_dir, "cuda", "*.cu")) sources += source_cuda - define_macros += [('WITH_CUDA', None)] + define_macros += [("WITH_CUDA", None)] - nvcc_flags = os.getenv('NVCC_FLAGS', '') - if nvcc_flags == '': + nvcc_flags = os.getenv("NVCC_FLAGS", "") + if nvcc_flags == "": nvcc_flags = [] else: - nvcc_flags = nvcc_flags.split(' ') - nvcc_flags = append_flags(nvcc_flags, ['--expt-extended-lambda', '-Xcompiler']) + nvcc_flags = nvcc_flags.split(" ") + nvcc_flags = append_flags(nvcc_flags, ["--expt-extended-lambda", "-Xcompiler"]) extra_compile_args = { - 'cxx': cxx_flags, - 'nvcc': nvcc_flags, + "cxx": cxx_flags, + "nvcc": nvcc_flags, } else: extra_compile_args = { - 'cxx': cxx_flags, + "cxx": cxx_flags, } ext_modules = [ extension( - module_name + '._C', + module_name + "._C", sources, define_macros=define_macros, extra_compile_args=extra_compile_args, @@ -127,11 +133,14 @@ def get_extensions(): class clean(distutils.command.clean.clean): def run(self): - with open('.gitignore', 'r') as f: + with open(".gitignore", "r") as f: ignores = f.read() start_deleting = False - for wildcard in filter(None, ignores.split('\n')): - if wildcard == '# do not change or delete this comment - `python setup.py clean` deletes everything after this line': + for wildcard in filter(None, ignores.split("\n")): + if ( + wildcard + == "# do not change or delete this comment - `python setup.py clean` deletes everything after this line" + ): start_deleting = True if not start_deleting: continue @@ -155,34 +164,33 @@ def run(self): description="Cryptographically secure pseudorandom number generators for PyTorch", long_description=long_description, long_description_content_type="text/markdown", - license='BSD-3', - + license="BSD-3", # Package info - packages=find_packages(exclude=('test',)), + packages=find_packages(exclude=("test",)), classifiers=[ - 'Intended Audience :: Developers', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: C++', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: C++", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", ], - python_requires='>=3.6', + python_requires=">=3.6", install_requires=requirements, ext_modules=get_extensions(), - test_suite='test', + test_suite="test", cmdclass={ - 'build_ext': BuildExtension, - 'clean': clean, - } + "build_ext": BuildExtension, + "clean": clean, + }, ) diff --git a/test/test_csprng.py b/test/test_csprng.py index cfdb1ef..fd579e2 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -4,24 +4,27 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -import unittest -import torch -from scipy import stats -import numpy as np import math +import os import random import time -import os +import unittest + +import numpy as np +import torch from Crypto.Cipher import AES from Crypto.Util import Counter +from scipy import stats try: import torchcsprng as csprng except ImportError: raise RuntimeError("CSPRNG not available") -IS_SANDCASTLE = os.getenv('SANDCASTLE') == '1' or os.getenv('TW_JOB_USER') == 'sandcastle' -IS_FBCODE = os.getenv('PYTORCH_TEST_FBCODE') == '1' +IS_SANDCASTLE = ( + os.getenv("SANDCASTLE") == "1" or os.getenv("TW_JOB_USER") == "sandcastle" +) +IS_FBCODE = os.getenv("PYTORCH_TEST_FBCODE") == "1" def to_numpy(t, dtype=torch.float): @@ -40,9 +43,9 @@ class TestCSPRNG(unittest.TestCase): all_generators = [ csprng.create_random_device_generator(), - csprng.create_random_device_generator('/dev/urandom'), + csprng.create_random_device_generator("/dev/urandom"), csprng.create_mt19937_generator(), - csprng.create_mt19937_generator(42) + csprng.create_mt19937_generator(42), ] int_dtypes = [torch.uint8, torch.int8, torch.int16, torch.int32, torch.int64] @@ -59,38 +62,52 @@ class TestCSPRNG(unittest.TestCase): size = 1000 - all_devices = ['cpu', 'cuda'] if (torch.cuda.is_available() and csprng.supports_cuda()) else ['cpu'] + all_devices = ( + ["cpu", "cuda"] + if (torch.cuda.is_available() and csprng.supports_cuda()) + else ["cpu"] + ) def test_random_kstest(self): for device in self.all_devices: for gen in self.all_generators: for dtype in self.num_dtypes: if dtype == torch.float: - to_inc = 2**24 + to_inc = 2 ** 24 elif dtype == torch.double: - to_inc = 2**53 + to_inc = 2 ** 53 elif dtype == torch.half: - to_inc = 2**11 + to_inc = 2 ** 11 elif dtype == torch.bfloat16: - to_inc = 2**8 + to_inc = 2 ** 8 else: to_inc = torch.iinfo(dtype).max - t = torch.empty(self.size, dtype=dtype, device=device).random_(generator=gen) - res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_inc)) + t = torch.empty(self.size, dtype=dtype, device=device).random_( + generator=gen + ) + res = stats.kstest( + to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_inc) + ) self.assertTrue(res.statistic < 0.1) no_cuda = not torch.cuda.is_available() or not csprng.supports_cuda() - no_cuda_message = "CUDA is not available or csprng was not compiled with CUDA support" + no_cuda_message = ( + "CUDA is not available or csprng was not compiled with CUDA support" + ) @unittest.skipIf(no_cuda, no_cuda_message) def test_random_cpu_vs_cuda(self): for dtype in self.num_dtypes: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').random_(generator=gen) + cpu_t = torch.empty(self.size, dtype=dtype, device="cpu").random_( + generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').random_(generator=gen) + cuda_t = torch.empty(self.size, dtype=dtype, device="cuda").random_( + generator=gen + ) self.assertTrue((cpu_t == cuda_t.cpu()).all()) def test_random_to_kstest(self): @@ -98,8 +115,12 @@ def test_random_to_kstest(self): for device in self.all_devices: for gen in self.all_generators: for dtype in self.num_dtypes: - t = torch.zeros(self.size, dtype=dtype, device=device).random_(to_, generator=gen) - res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_)) + t = torch.zeros(self.size, dtype=dtype, device=device).random_( + to_, generator=gen + ) + res = stats.kstest( + to_numpy(t.cpu()), stats.randint.cdf, args=(0, to_) + ) self.assertTrue(res.statistic < 0.1) @unittest.skipIf(no_cuda, no_cuda_message) @@ -107,9 +128,13 @@ def test_random_to_cpu_vs_cuda(self): to_ = 42 for dtype in self.num_dtypes: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.zeros(self.size, dtype=dtype, device='cpu').random_(to_, generator=gen) + cpu_t = torch.zeros(self.size, dtype=dtype, device="cpu").random_( + to_, generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.zeros(self.size, dtype=dtype, device='cuda').random_(to_, generator=gen) + cuda_t = torch.zeros(self.size, dtype=dtype, device="cuda").random_( + to_, generator=gen + ) self.assertTrue((cpu_t == cuda_t.cpu()).all()) def test_random_from_to_kstest(self): @@ -119,8 +144,14 @@ def test_random_from_to_kstest(self): for from_ in [0, 24, 42]: for to_ in [42, 99, 123]: if from_ < to_: - t = torch.zeros(self.size, dtype=dtype, device=device).random_(from_, to_, generator=gen) - res = stats.kstest(to_numpy(t.cpu()), stats.randint.cdf, args=(from_, to_)) + t = torch.zeros( + self.size, dtype=dtype, device=device + ).random_(from_, to_, generator=gen) + res = stats.kstest( + to_numpy(t.cpu()), + stats.randint.cdf, + args=(from_, to_), + ) self.assertTrue(res.statistic < 0.2) @unittest.skipIf(no_cuda, no_cuda_message) @@ -130,9 +161,13 @@ def test_random_from_to_cpu_vs_cuda(self): for to_ in [42, 99, 123]: if from_ < to_: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.zeros(self.size, dtype=dtype, device='cpu').random_(from_, to_, generator=gen) + cpu_t = torch.zeros( + self.size, dtype=dtype, device="cpu" + ).random_(from_, to_, generator=gen) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.zeros(self.size, dtype=dtype, device='cuda').random_(from_, to_, generator=gen) + cuda_t = torch.zeros( + self.size, dtype=dtype, device="cuda" + ).random_(from_, to_, generator=gen) self.assertTrue((cpu_t == cuda_t.cpu()).all()) def test_random_bool(self): @@ -144,20 +179,28 @@ def test_random_bool(self): t.random_(generator=gen) self.assertEqual(t.min(), False) self.assertEqual(t.max(), True) - self.assertTrue(0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6) + self.assertTrue( + 0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6 + ) t.fill_(True) t.random_(generator=gen) self.assertEqual(t.min(), False) self.assertEqual(t.max(), True) - self.assertTrue(0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6) + self.assertTrue( + 0.4 < (t.eq(True)).to(torch.int).sum().item() / self.size < 0.6 + ) @unittest.skipIf(no_cuda, no_cuda_message) def test_random_bool_cpu_vs_cuda(self): gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=torch.bool, device='cpu').random_(generator=gen) + cpu_t = torch.empty(self.size, dtype=torch.bool, device="cpu").random_( + generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=torch.bool, device='cuda').random_(generator=gen) + cuda_t = torch.empty(self.size, dtype=torch.bool, device="cuda").random_( + generator=gen + ) self.assertTrue((cpu_t == cuda_t.cpu()).all()) def test_uniform_kstest(self): @@ -167,8 +210,14 @@ def test_uniform_kstest(self): for from_ in [-42, 0, 4.2]: for to_ in [-4.2, 0, 42]: if to_ > from_: - t = torch.empty(self.size, dtype=dtype, device=device).uniform_(from_, to_, generator=gen) - res = stats.kstest(to_numpy(t.cpu(), torch.double), 'uniform', args=(from_, (to_ - from_))) + t = torch.empty( + self.size, dtype=dtype, device=device + ).uniform_(from_, to_, generator=gen) + res = stats.kstest( + to_numpy(t.cpu(), torch.double), + "uniform", + args=(from_, (to_ - from_)), + ) self.assertTrue(res.statistic < 0.1) @unittest.skipIf(no_cuda, no_cuda_message) @@ -178,9 +227,13 @@ def test_uniform_cpu_vs_cuda(self): for to_ in [-4.2, 0, 42]: if to_ > from_: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').uniform_(from_, to_, generator=gen) + cpu_t = torch.empty( + self.size, dtype=dtype, device="cpu" + ).uniform_(from_, to_, generator=gen) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').uniform_(from_, to_, generator=gen) + cuda_t = torch.empty( + self.size, dtype=dtype, device="cuda" + ).uniform_(from_, to_, generator=gen) self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_normal_kstest(self): @@ -189,8 +242,14 @@ def test_normal_kstest(self): for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: - t = torch.empty(self.size, dtype=dtype, device=device).normal_(mean=mean, std=std, generator=gen) - res = stats.kstest(to_numpy(t.cpu(), torch.double), 'norm', args=(mean, std)) + t = torch.empty( + self.size, dtype=dtype, device=device + ).normal_(mean=mean, std=std, generator=gen) + res = stats.kstest( + to_numpy(t.cpu(), torch.double), + "norm", + args=(mean, std), + ) self.assertTrue(res.statistic < 0.1) @unittest.skipIf(no_cuda, no_cuda_message) @@ -199,9 +258,13 @@ def test_normal_cpu_vs_cuda(self): for mean in [-3, 0, 7]: for std in [1, 5, 7]: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').normal_(mean=mean, std=std, generator=gen) + cpu_t = torch.empty(self.size, dtype=dtype, device="cpu").normal_( + mean=mean, std=std, generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').normal_(mean=mean, std=std, generator=gen) + cuda_t = torch.empty(self.size, dtype=dtype, device="cuda").normal_( + mean=mean, std=std, generator=gen + ) self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_log_normal_kstest(self): @@ -210,8 +273,14 @@ def test_log_normal_kstest(self): for dtype in self.fp_dtypes: for mean in [-3, 0, 7]: for std in [1, 5, 7]: - t = torch.empty(self.size, dtype=dtype, device=device).log_normal_(mean=mean, std=std, generator=gen) - res = stats.kstest(to_numpy(t.cpu(), torch.double), 'lognorm', args=(std, 0, math.exp(mean))) + t = torch.empty( + self.size, dtype=dtype, device=device + ).log_normal_(mean=mean, std=std, generator=gen) + res = stats.kstest( + to_numpy(t.cpu(), torch.double), + "lognorm", + args=(std, 0, math.exp(mean)), + ) if dtype in [torch.half, torch.bfloat16]: self.assertTrue(res.statistic < 0.4) else: @@ -223,18 +292,33 @@ def test_log_normal_cpu_vs_cuda(self): for mean in [-3, 0, 7]: for std in [1, 5, 7]: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').log_normal_(mean=mean, std=std, generator=gen) + cpu_t = torch.empty( + self.size, dtype=dtype, device="cpu" + ).log_normal_(mean=mean, std=std, generator=gen) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').log_normal_(mean=mean, std=std, generator=gen) - self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-4, equal_nan=True)) + cuda_t = torch.empty( + self.size, dtype=dtype, device="cuda" + ).log_normal_(mean=mean, std=std, generator=gen) + self.assertTrue( + torch.allclose(cpu_t, cuda_t.cpu(), 1e-4, equal_nan=True) + ) def test_exponential_kstest(self): for device in self.all_devices: for gen in self.all_generators: for dtype in self.fp_dtypes: for lambd in [0.5, 1.0, 5.0]: - t = torch.empty(self.size, dtype=dtype, device=device).exponential_(lambd=lambd, generator=gen) - res = stats.kstest(to_numpy(t.cpu(), torch.double), 'expon', args=(0, 1 / lambd,)) + t = torch.empty( + self.size, dtype=dtype, device=device + ).exponential_(lambd=lambd, generator=gen) + res = stats.kstest( + to_numpy(t.cpu(), torch.double), + "expon", + args=( + 0, + 1 / lambd, + ), + ) self.assertTrue(res.statistic < 0.1) @unittest.skipIf(no_cuda, no_cuda_message) @@ -243,9 +327,13 @@ def test_exponential_cpu_vs_cuda(self): for dtype in self.fp_dtypes: for lambd in [0.5, 1.0, 5.0]: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').exponential_(lambd=lambd, generator=gen) + cpu_t = torch.empty(self.size, dtype=dtype, device="cpu").exponential_( + lambd=lambd, generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').exponential_(lambd=lambd, generator=gen) + cuda_t = torch.empty( + self.size, dtype=dtype, device="cuda" + ).exponential_(lambd=lambd, generator=gen) self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_cauchy_kstest(self): @@ -254,8 +342,14 @@ def test_cauchy_kstest(self): for dtype in self.fp_dtypes: for median in [-10, 0, 50]: for sigma in [0.5, 1.0, 10.0]: - t = torch.empty(self.size, dtype=dtype, device=device).cauchy_(median=median, sigma=sigma, generator=gen) - res = stats.kstest(to_numpy(t.cpu(), torch.double), 'cauchy', args=(median, sigma)) + t = torch.empty( + self.size, dtype=dtype, device=device + ).cauchy_(median=median, sigma=sigma, generator=gen) + res = stats.kstest( + to_numpy(t.cpu(), torch.double), + "cauchy", + args=(median, sigma), + ) if dtype in [torch.half, torch.bfloat16]: self.assertTrue(res.statistic < 0.4) else: @@ -267,9 +361,13 @@ def test_cauchy_cpu_vs_cuda(self): for median in [-10, 0, 50]: for sigma in [0.5, 1.0, 10.0]: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').cauchy_(median=median, sigma=sigma, generator=gen) + cpu_t = torch.empty(self.size, dtype=dtype, device="cpu").cauchy_( + median=median, sigma=sigma, generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').cauchy_(median=median, sigma=sigma, generator=gen) + cuda_t = torch.empty(self.size, dtype=dtype, device="cuda").cauchy_( + median=median, sigma=sigma, generator=gen + ) self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9)) def test_geometric(self): @@ -277,7 +375,9 @@ def test_geometric(self): for gen in self.all_generators: for dtype in self.fp_dtypes: for p in [0.2, 0.5, 0.8]: - t = torch.empty(self.size, dtype=dtype, device=device).geometric_(p=p, generator=gen) + t = torch.empty( + self.size, dtype=dtype, device=device + ).geometric_(p=p, generator=gen) # actual = np.histogram(t.cpu().to(torch.double), np.arange(1, 100))[0] # expected = stats.geom(p).pmf(np.arange(1, 99)) * self.size # res = stats.chisquare(actual, expected) @@ -288,10 +388,16 @@ def test_geometric_cpu_vs_cuda(self): for dtype in self.fp_dtypes: for p in [0.2, 0.5, 0.8]: gen = csprng.create_mt19937_generator(42) - cpu_t = torch.empty(self.size, dtype=dtype, device='cpu').geometric_(p=p, generator=gen) + cpu_t = torch.empty(self.size, dtype=dtype, device="cpu").geometric_( + p=p, generator=gen + ) gen = csprng.create_mt19937_generator(42) - cuda_t = torch.empty(self.size, dtype=dtype, device='cuda').geometric_(p=p, generator=gen) - self.assertTrue(torch.allclose(cpu_t, cuda_t.cpu(), 1e-9, equal_nan=True)) + cuda_t = torch.empty(self.size, dtype=dtype, device="cuda").geometric_( + p=p, generator=gen + ) + self.assertTrue( + torch.allclose(cpu_t, cuda_t.cpu(), 1e-9, equal_nan=True) + ) def test_non_contiguous_vs_contiguous(self): size = 10 @@ -306,7 +412,7 @@ def test_non_contiguous_vs_contiguous(self): y2 = random.randrange(y1 + 1, max(y1 + 2, size)) z2 = random.randrange(z1 + 1, max(z1 + 2, size)) maybe_non_contiguous = t[x1:x2, y1:y2, z1:z2] - assert(maybe_non_contiguous.numel() > 0) + assert maybe_non_contiguous.numel() > 0 if not maybe_non_contiguous.is_contiguous(): seed = random.randrange(1000) @@ -319,22 +425,26 @@ def test_non_contiguous_vs_contiguous(self): gen = csprng.create_mt19937_generator(seed) contiguous.random_(generator=gen) - assert(contiguous.is_contiguous()) + assert contiguous.is_contiguous() self.assertTrue((non_contiguous == contiguous).all()) for x in range(0, size): for y in range(0, size): for z in range(0, size): - if not x1 <= x < x2 and not y1 <= y < y2 and not z1 <= z < z2: + if ( + not x1 <= x < x2 + and not y1 <= y < y2 + and not z1 <= z < z2 + ): self.assertTrue(t[x, y, z] == 0) @unittest.skipIf(IS_SANDCASTLE or IS_FBCODE, "Does not work on Sandcastle") @unittest.skipIf(torch.get_num_threads() < 2, "requires multithreading CPU") def test_cpu_parallel(self): - urandom_gen = csprng.create_random_device_generator('/dev/urandom') + urandom_gen = csprng.create_random_device_generator("/dev/urandom") def measure(size): - t = torch.empty(size, dtype=torch.float32, device='cpu') + t = torch.empty(size, dtype=torch.float32, device="cpu") start = time.time() for i in range(20): t.normal_(generator=urandom_gen) @@ -344,7 +454,7 @@ def measure(size): time_for_1K = measure(1000) time_for_1M = measure(1000000) # Pessimistic check that parallel execution gives >= 1.5 performance boost - self.assertTrue(time_for_1M/time_for_1K < 1000 / 1.5) + self.assertTrue(time_for_1M / time_for_1K < 1000 / 1.5) @unittest.skipIf(IS_SANDCASTLE or IS_FBCODE, "Does not work on Sandcastle") def test_version(self): @@ -358,7 +468,9 @@ def test_randperm(self): for size in range(0, 20): expected = torch.arange(size, dtype=dtype, device=device) - actual = torch.randperm(size, dtype=dtype, device=device, generator=gen) + actual = torch.randperm( + size, dtype=dtype, device=device, generator=gen + ) actual_out = torch.empty(1, dtype=dtype, device=device) torch.randperm(size, out=actual_out, generator=gen) @@ -389,13 +501,15 @@ def pad(data, pad_size): if len(data) % pad_size == 0: return data length = pad_size - (len(data) % pad_size) - return data + bytes([0])*length + return data + bytes([0]) * length def create_aes(m, k): if m == "ecb": return AES.new(k.tobytes(), AES.MODE_ECB) elif m == "ctr": - ctr = Counter.new(AES.block_size * 8, initial_value=0, little_endian=True) + ctr = Counter.new( + AES.block_size * 8, initial_value=0, little_endian=True + ) return AES.new(k.tobytes(), AES.MODE_CTR, counter=ctr) else: return None @@ -410,11 +524,20 @@ def create_aes(m, k): initial_np = to_bytes(initial) initial_size_bytes = initial_size * sizeof(initial_dtype) for encrypted_dtype in self.all_dtypes: - encrypted_size = (initial_size_bytes + block_size_bytes - 1) // block_size_bytes * block_size_bytes // sizeof(encrypted_dtype) + encrypted_size = ( + (initial_size_bytes + block_size_bytes - 1) + // block_size_bytes + * block_size_bytes + // sizeof(encrypted_dtype) + ) encrypted = torch.zeros(encrypted_size, dtype=encrypted_dtype) for decrypted_dtype in self.all_dtypes: - decrypted_size = (initial_size_bytes + sizeof(decrypted_dtype) - 1) // sizeof(decrypted_dtype) - decrypted = torch.zeros(decrypted_size, dtype=decrypted_dtype) + decrypted_size = ( + initial_size_bytes + sizeof(decrypted_dtype) - 1 + ) // sizeof(decrypted_dtype) + decrypted = torch.zeros( + decrypted_size, dtype=decrypted_dtype + ) for mode in ["ecb", "ctr"]: for device in self.all_devices: key = key.to(device) @@ -422,23 +545,47 @@ def create_aes(m, k): encrypted = encrypted.to(device) decrypted = decrypted.to(device) - csprng.encrypt(initial, encrypted, key, "aes128", mode) + csprng.encrypt( + initial, encrypted, key, "aes128", mode + ) encrypted_np = to_bytes(encrypted) aes = create_aes(mode, key_np) - encrypted_expected = np.frombuffer(aes.encrypt(pad(initial_np.tobytes(), block_size_bytes)), dtype=np.int8) - self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) - - csprng.decrypt(encrypted, decrypted, key, "aes128", mode) - decrypted_np = to_bytes(decrypted)[:initial_size_bytes] + encrypted_expected = np.frombuffer( + aes.encrypt( + pad(initial_np.tobytes(), block_size_bytes) + ), + dtype=np.int8, + ) + self.assertTrue( + np.array_equal(encrypted_np, encrypted_expected) + ) + + csprng.decrypt( + encrypted, decrypted, key, "aes128", mode + ) + decrypted_np = to_bytes(decrypted)[ + :initial_size_bytes + ] aes = create_aes(mode, key_np) - decrypted_expected = np.frombuffer(aes.decrypt(pad(encrypted_np.tobytes(), block_size_bytes)), dtype=np.int8)[:initial_size_bytes] - self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) - - self.assertTrue(np.array_equal(initial_np, decrypted_np)) + decrypted_expected = np.frombuffer( + aes.decrypt( + pad( + encrypted_np.tobytes(), block_size_bytes + ) + ), + dtype=np.int8, + )[:initial_size_bytes] + self.assertTrue( + np.array_equal(decrypted_np, decrypted_expected) + ) + + self.assertTrue( + np.array_equal(initial_np, decrypted_np) + ) def test_encrypt_decrypt_inplace(self): key_size_bytes = 16 @@ -455,7 +602,9 @@ def create_aes(m, k): if m == "ecb": return AES.new(k.tobytes(), AES.MODE_ECB) elif m == "ctr": - ctr = Counter.new(AES.block_size * 8, initial_value=0, little_endian=True) + ctr = Counter.new( + AES.block_size * 8, initial_value=0, little_endian=True + ) return AES.new(k.tobytes(), AES.MODE_CTR, counter=ctr) else: return None @@ -478,18 +627,29 @@ def create_aes(m, k): csprng.encrypt(initial, initial, key, "aes128", mode) encrypted_np = to_bytes(initial) aes = create_aes(mode, key_np) - encrypted_expected = np.frombuffer(aes.encrypt(initial_np_copy.tobytes()), dtype=np.int8) - self.assertTrue(np.array_equal(encrypted_np, encrypted_expected)) + encrypted_expected = np.frombuffer( + aes.encrypt(initial_np_copy.tobytes()), dtype=np.int8 + ) + self.assertTrue( + np.array_equal(encrypted_np, encrypted_expected) + ) encrypted_np_copy = np.copy(encrypted_np) csprng.decrypt(initial, initial, key, "aes128", mode) decrypted_np = to_bytes(initial) aes = create_aes(mode, key_np) - decrypted_expected = np.frombuffer(aes.decrypt(encrypted_np_copy.tobytes()), dtype=np.int8) - self.assertTrue(np.array_equal(decrypted_np, decrypted_expected)) + decrypted_expected = np.frombuffer( + aes.decrypt(encrypted_np_copy.tobytes()), dtype=np.int8 + ) + self.assertTrue( + np.array_equal(decrypted_np, decrypted_expected) + ) + + self.assertTrue( + np.array_equal(initial_np_copy, decrypted_np) + ) - self.assertTrue(np.array_equal(initial_np_copy, decrypted_np)) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/torchcsprng/__init__.pyi b/torchcsprng/__init__.pyi index 3ab1142..f387caa 100644 --- a/torchcsprng/__init__.pyi +++ b/torchcsprng/__init__.pyi @@ -7,15 +7,9 @@ from torch import Tensor, Generator def supports_cuda() -> bool: ... - def create_random_device_generator(token: str = "") -> Generator: ... - def create_mt19937_generator(seed: int = 0): ... - def encrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... - def decrypt(input: Tensor, output: Tensor, key: Tensor, cipher, mode): ... - def __version__() -> str: ... - def git_version() -> str: ... From 2665d2b91bc6d3a3c6613b5dc766a8db3b131ae1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 30 Oct 2021 04:35:16 -0700 Subject: [PATCH 460/750] 2021-10-30 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From cee14befb3e6d6e244eb02eaf6d3f870144b386f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 31 Oct 2021 04:32:39 -0700 Subject: [PATCH 461/750] 2021-10-31 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 052b30575730d51e008f4c513c7f3ea8b6dd4dac Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 1 Nov 2021 04:38:05 -0700 Subject: [PATCH 462/750] 2021-11-01 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 3f3cd8080e59e0782531dd31d79ab631f0fd23b6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 2 Nov 2021 04:32:58 -0700 Subject: [PATCH 463/750] 2021-11-02 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 306d7644fee1e644bbdf16fa6b24592a0f953448 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 3 Nov 2021 04:38:30 -0700 Subject: [PATCH 464/750] 2021-11-03 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 39b82de493efef388f5d78f14a53fb9936d165a8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 4 Nov 2021 04:44:07 -0700 Subject: [PATCH 465/750] 2021-11-04 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From ce96ca84b29b33cebab9e6fceb98b16a8b36d007 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 5 Nov 2021 04:37:31 -0700 Subject: [PATCH 466/750] 2021-11-05 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 7629c45ac8418f57ea0d6c0df6ca9912d754da3b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 6 Nov 2021 04:30:50 -0700 Subject: [PATCH 467/750] 2021-11-06 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 3905609d5d9febe395512c6e41661dc4d879e4ad Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 7 Nov 2021 04:30:45 -0800 Subject: [PATCH 468/750] 2021-11-07 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 2e01c393ed234e34d36c6d0b9bda7606c5b0d01b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 8 Nov 2021 04:31:12 -0800 Subject: [PATCH 469/750] 2021-11-08 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 9f70a5ee81e68ecc6a5efc9ae84a0d9697be4250 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 9 Nov 2021 04:30:43 -0800 Subject: [PATCH 470/750] 2021-11-09 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 84714401d9d930da2175ff6cb1db3c4ba507f214 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 10 Nov 2021 04:30:51 -0800 Subject: [PATCH 471/750] 2021-11-10 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 5c7a19a9b0c629be871cf9920d9033d555f8c6ba Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 11 Nov 2021 04:31:57 -0800 Subject: [PATCH 472/750] 2021-11-11 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 5454f66e256b74635fc3ee731603375c50a9e06b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 12 Nov 2021 04:31:05 -0800 Subject: [PATCH 473/750] 2021-11-12 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 28476030921d9b31fd56c3377fb8f59d0cc7d39f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 13 Nov 2021 04:31:04 -0800 Subject: [PATCH 474/750] 2021-11-13 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From a31f6f55f67a7c90470f964d4f1f243076ff8eeb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 14 Nov 2021 04:31:26 -0800 Subject: [PATCH 475/750] 2021-11-14 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 3a887d6a355a8e39142828210c2d2f031875cec0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 15 Nov 2021 04:30:54 -0800 Subject: [PATCH 476/750] 2021-11-15 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 8b98c822f71530da6869545bc8ec16038775d30c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 16 Nov 2021 04:31:07 -0800 Subject: [PATCH 477/750] 2021-11-16 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 9f8f0d90b05dc705d777046576984007582020c7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 17 Nov 2021 04:31:54 -0800 Subject: [PATCH 478/750] 2021-11-17 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From af2627ead2e504cc5fa48a93ec085309d52382af Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 18 Nov 2021 04:32:14 -0800 Subject: [PATCH 479/750] 2021-11-18 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From b0d73ab4824895b909f68be98294317a1131abb4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 19 Nov 2021 04:37:40 -0800 Subject: [PATCH 480/750] 2021-11-19 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 19787cbe97db1e234bb073f69eb1a2accd141d78 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 20 Nov 2021 04:31:04 -0800 Subject: [PATCH 481/750] 2021-11-20 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 5566fc0965b8b36ad3b2566b26a5cfa7ebf554df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 21 Nov 2021 04:33:20 -0800 Subject: [PATCH 482/750] 2021-11-21 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From b8f546df2260a3dd1d071893e9d0632d0315e13a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 22 Nov 2021 04:31:11 -0800 Subject: [PATCH 483/750] 2021-11-22 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 655bce6b537dfc7a06ec6b27c4a58a2ca84637da Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 23 Nov 2021 04:31:07 -0800 Subject: [PATCH 484/750] 2021-11-23 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From e77c47e7bdbaed92f701b54dcf53c9fa53973fcf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 24 Nov 2021 04:33:02 -0800 Subject: [PATCH 485/750] 2021-11-24 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 10a9b6725c5c2cd9ad76b41d0b558649cb3d053d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 25 Nov 2021 04:32:42 -0800 Subject: [PATCH 486/750] 2021-11-25 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 8c932f876ea6d3fa420f9a4ba7f37299d95de45d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 26 Nov 2021 04:30:38 -0800 Subject: [PATCH 487/750] 2021-11-26 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From f6262b1e376f19e3d671fac3b0d46d34b29fbbf2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 27 Nov 2021 04:31:24 -0800 Subject: [PATCH 488/750] 2021-11-27 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 35dee33834d4be4ecb2aeb89dc65937f13c202c0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 28 Nov 2021 04:30:33 -0800 Subject: [PATCH 489/750] 2021-11-28 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From dce5e5117f01ea914cb9cd9700a278b66406176a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 29 Nov 2021 04:31:14 -0800 Subject: [PATCH 490/750] 2021-11-29 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 58087591ca06f585c51304a77ab5e4c82fc76830 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 30 Nov 2021 04:30:51 -0800 Subject: [PATCH 491/750] 2021-11-30 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 65671b757951dde33302f9a0d482586e6f93250f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 1 Dec 2021 04:32:05 -0800 Subject: [PATCH 492/750] 2021-12-01 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 2b07cd65cb4550db1901d77a529d9a3d16d8debf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 2 Dec 2021 04:31:28 -0800 Subject: [PATCH 493/750] 2021-12-02 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 941d30b7b28904fc5df81242c14d9b70fac31db0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 3 Dec 2021 04:30:53 -0800 Subject: [PATCH 494/750] 2021-12-03 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From f122488e2fb26c0b2388923944bb7c4199678ec7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 4 Dec 2021 04:31:17 -0800 Subject: [PATCH 495/750] 2021-12-04 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From dfa77d6eabe639a218ae872f940223feb106de52 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 5 Dec 2021 04:34:49 -0800 Subject: [PATCH 496/750] 2021-12-05 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 198dcca22d93bbd81f7bd0f72602c55e6b261e93 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 6 Dec 2021 04:30:56 -0800 Subject: [PATCH 497/750] 2021-12-06 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 6a5d7d2cdc06ea8c49e799c9adb6a9d96ad3e2a6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 7 Dec 2021 04:30:35 -0800 Subject: [PATCH 498/750] 2021-12-07 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 3c8eef754f9843fb302bbaec8068347f807eb290 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 8 Dec 2021 04:31:34 -0800 Subject: [PATCH 499/750] 2021-12-08 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From f8b35ad2f8949cb193e69bf52d8514cec4901ad8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 9 Dec 2021 04:30:31 -0800 Subject: [PATCH 500/750] 2021-12-09 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 6d785d61a16e6267414e7d69870027112ebc4adc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 10 Dec 2021 04:30:56 -0800 Subject: [PATCH 501/750] 2021-12-10 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 6da445e8c36f96ea5ed526f5956e014c065969af Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 11 Dec 2021 04:30:31 -0800 Subject: [PATCH 502/750] 2021-12-11 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From d27088c82c769411e56015c8481f744174467f58 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 12 Dec 2021 04:30:27 -0800 Subject: [PATCH 503/750] 2021-12-12 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From ccc3ef70565b951b299324e72f86701fb644da2b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 13 Dec 2021 04:30:33 -0800 Subject: [PATCH 504/750] 2021-12-13 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From c75bdaa46f3a0e63fc7dd636f4cbfa5f8803fba2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 14 Dec 2021 04:30:31 -0800 Subject: [PATCH 505/750] 2021-12-14 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 9cd013b1909cb650d267dcb19d6b3e6d84df615d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 15 Dec 2021 04:35:45 -0800 Subject: [PATCH 506/750] 2021-12-15 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 0514e232fea57783007831d7ee0b906de81f59fa Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 16 Dec 2021 04:30:25 -0800 Subject: [PATCH 507/750] 2021-12-16 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From a4f76f03ce6519cfdeb01470068252aa92c62b72 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 17 Dec 2021 04:30:39 -0800 Subject: [PATCH 508/750] 2021-12-17 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 5238e8a5d33bf6e5ee9243075663baf0f6edf99b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 18 Dec 2021 04:32:12 -0800 Subject: [PATCH 509/750] 2021-12-18 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 7c9e054ddc1df413837a0bb95ba2e9f493cf3aeb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 19 Dec 2021 04:30:52 -0800 Subject: [PATCH 510/750] 2021-12-19 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 4f5310c205af5ba79f381331bb6786f61b8c1adb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 20 Dec 2021 04:30:23 -0800 Subject: [PATCH 511/750] 2021-12-20 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From 769d2fb53ea8d80b2c1992695f793c93fc00ec91 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 21 Dec 2021 04:30:29 -0800 Subject: [PATCH 512/750] 2021-12-21 nightly release (5a6d9458c142190d5d713744687434c73c06ad01) From f8994e8731703e0eb8f00dd6b1136ba7ca949666 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 22 Dec 2021 04:31:05 -0800 Subject: [PATCH 513/750] 2021-12-22 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) --- README.md | 2 ++ test/__init__.py | 3 +-- test/test_csprng.py | 3 +-- torchcsprng/__init__.py | 3 +-- torchcsprng/__init__.pyi | 3 +-- torchcsprng/csrc/OffsetCalculator.cuh | 3 +-- torchcsprng/csrc/THCIntegerDivider.cuh | 3 +-- torchcsprng/csrc/aes.inc | 3 +-- torchcsprng/csrc/block_cipher.h | 3 +-- torchcsprng/csrc/cpu/kernels.cpp | 3 +-- torchcsprng/csrc/cpu/kernels.h | 3 +-- torchcsprng/csrc/csprng.cpp | 3 +-- torchcsprng/csrc/cuda/kernels.cu | 3 +-- torchcsprng/csrc/cuda/kernels.cuh | 3 +-- torchcsprng/csrc/kernels_body.inc | 3 +-- torchcsprng/csrc/kernels_commons.h | 3 +-- torchcsprng/csrc/kernels_decls.inc | 3 +-- torchcsprng/csrc/macros.h | 3 +-- 18 files changed, 19 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 3bfe568..128e327 100644 --- a/README.md +++ b/README.md @@ -209,3 +209,5 @@ torchcsprng is BSD 3-clause licensed. See the license file [here](https://github ## [Terms of Use](https://opensource.facebook.com/legal/terms) ## [Privacy Policy](https://opensource.facebook.com/legal/privacy) + +Copyright © 2020 Meta Platforms, Inc diff --git a/test/__init__.py b/test/__init__.py index 10a5577..83766c4 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,5 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. -# All rights reserved. +# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. diff --git a/test/test_csprng.py b/test/test_csprng.py index fd579e2..dfce378 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -1,5 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. -# All rights reserved. +# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/__init__.py b/torchcsprng/__init__.py index f45f8f0..60a98d6 100644 --- a/torchcsprng/__init__.py +++ b/torchcsprng/__init__.py @@ -1,5 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. -# All rights reserved. +# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/__init__.pyi b/torchcsprng/__init__.pyi index f387caa..8a19a39 100644 --- a/torchcsprng/__init__.pyi +++ b/torchcsprng/__init__.pyi @@ -1,5 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. -# All rights reserved. +# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/OffsetCalculator.cuh b/torchcsprng/csrc/OffsetCalculator.cuh index 9358707..671e37d 100644 --- a/torchcsprng/csrc/OffsetCalculator.cuh +++ b/torchcsprng/csrc/OffsetCalculator.cuh @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/THCIntegerDivider.cuh b/torchcsprng/csrc/THCIntegerDivider.cuh index d18e742..bc124b2 100644 --- a/torchcsprng/csrc/THCIntegerDivider.cuh +++ b/torchcsprng/csrc/THCIntegerDivider.cuh @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/aes.inc b/torchcsprng/csrc/aes.inc index 85ff09b..463dd5c 100644 --- a/torchcsprng/csrc/aes.inc +++ b/torchcsprng/csrc/aes.inc @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/block_cipher.h b/torchcsprng/csrc/block_cipher.h index 2966f00..a949d52 100644 --- a/torchcsprng/csrc/block_cipher.h +++ b/torchcsprng/csrc/block_cipher.h @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/cpu/kernels.cpp b/torchcsprng/csrc/cpu/kernels.cpp index 097a093..5f86829 100644 --- a/torchcsprng/csrc/cpu/kernels.cpp +++ b/torchcsprng/csrc/cpu/kernels.cpp @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/cpu/kernels.h b/torchcsprng/csrc/cpu/kernels.h index abae836..f84af4a 100644 --- a/torchcsprng/csrc/cpu/kernels.h +++ b/torchcsprng/csrc/cpu/kernels.h @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/csprng.cpp b/torchcsprng/csrc/csprng.cpp index 04384fe..8494253 100644 --- a/torchcsprng/csrc/csprng.cpp +++ b/torchcsprng/csrc/csprng.cpp @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/cuda/kernels.cu b/torchcsprng/csrc/cuda/kernels.cu index d10b17b..6842ffb 100644 --- a/torchcsprng/csrc/cuda/kernels.cu +++ b/torchcsprng/csrc/cuda/kernels.cu @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/cuda/kernels.cuh b/torchcsprng/csrc/cuda/kernels.cuh index 43fec32..b2a05d4 100644 --- a/torchcsprng/csrc/cuda/kernels.cuh +++ b/torchcsprng/csrc/cuda/kernels.cuh @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/kernels_body.inc b/torchcsprng/csrc/kernels_body.inc index bcf1e26..a2be40d 100644 --- a/torchcsprng/csrc/kernels_body.inc +++ b/torchcsprng/csrc/kernels_body.inc @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/kernels_commons.h b/torchcsprng/csrc/kernels_commons.h index 8f20e3c..f4021a7 100644 --- a/torchcsprng/csrc/kernels_commons.h +++ b/torchcsprng/csrc/kernels_commons.h @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/kernels_decls.inc b/torchcsprng/csrc/kernels_decls.inc index 6fbfadc..d07aa09 100644 --- a/torchcsprng/csrc/kernels_decls.inc +++ b/torchcsprng/csrc/kernels_decls.inc @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. diff --git a/torchcsprng/csrc/macros.h b/torchcsprng/csrc/macros.h index b416df1..d21b25c 100644 --- a/torchcsprng/csrc/macros.h +++ b/torchcsprng/csrc/macros.h @@ -1,6 +1,5 @@ /* - * Copyright (c) Facebook, Inc. and its affiliates. - * All rights reserved. + * Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. From 8e7ac8828fcfe7679224f6e0eedf5aef9b0c719e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 23 Dec 2021 04:30:33 -0800 Subject: [PATCH 514/750] 2021-12-23 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From cb81dd0b8d502c012e74cb6e4cfda5dda106e3ae Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 24 Dec 2021 04:30:31 -0800 Subject: [PATCH 515/750] 2021-12-24 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 07729b80694420ebe4e1cc4a0c16a5aba5634d06 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 25 Dec 2021 04:30:57 -0800 Subject: [PATCH 516/750] 2021-12-25 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 122b78b7826f11f8575e7c89940b9117a735ebb5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 26 Dec 2021 04:30:27 -0800 Subject: [PATCH 517/750] 2021-12-26 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 89a76d4e41be2a3d4d697a6cc355ad39f9a42328 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 27 Dec 2021 04:30:27 -0800 Subject: [PATCH 518/750] 2021-12-27 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 2e3bf96d7558e9f04b760ce4288dc18a6df98036 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 28 Dec 2021 04:30:27 -0800 Subject: [PATCH 519/750] 2021-12-28 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 0eb7a961010b78134f006c8f26ecb999391533ca Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 29 Dec 2021 04:30:29 -0800 Subject: [PATCH 520/750] 2021-12-29 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From a6e354a94dfda18804f9b29b8ce25d41d1669328 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Dec 2021 04:30:26 -0800 Subject: [PATCH 521/750] 2021-12-30 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 79a879950bccb5f2a10106bda4d2279ff1ae6e78 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 31 Dec 2021 04:30:48 -0800 Subject: [PATCH 522/750] 2021-12-31 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From d02bd76a97b77d0d20801d604d25e772a8702f5b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 1 Jan 2022 04:30:29 -0800 Subject: [PATCH 523/750] 2022-01-01 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From dc0e78bbedfe46f93d16aaaf4f0f15d254fca488 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 2 Jan 2022 04:31:06 -0800 Subject: [PATCH 524/750] 2022-01-02 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From ff80c0519661d851fb30f500be288eeb50a96a0c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 3 Jan 2022 04:30:28 -0800 Subject: [PATCH 525/750] 2022-01-03 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 5369138da2d4b64cdfb592fc79bd767b4329bf0c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 4 Jan 2022 04:31:50 -0800 Subject: [PATCH 526/750] 2022-01-04 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 436dc429b6dc4e4965a7b9cdc0a964e77d81f629 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 5 Jan 2022 04:30:36 -0800 Subject: [PATCH 527/750] 2022-01-05 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 71fe083025a9412713cf24c2a6d87e8fdbd1b44d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 6 Jan 2022 04:31:51 -0800 Subject: [PATCH 528/750] 2022-01-06 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 2e447d8f25e27426610f394239fe54194b3008b1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 7 Jan 2022 04:32:12 -0800 Subject: [PATCH 529/750] 2022-01-07 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 5bc724004e4f8d4b9d368529fbc81c1b6fc26b6f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 8 Jan 2022 04:30:48 -0800 Subject: [PATCH 530/750] 2022-01-08 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 84e7c2652292c11e6b95a4d89ae51bf81a7e81a0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 9 Jan 2022 04:30:27 -0800 Subject: [PATCH 531/750] 2022-01-09 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From fb6daac83ae7721625b0dbf57b060e65296d04a6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 10 Jan 2022 04:30:42 -0800 Subject: [PATCH 532/750] 2022-01-10 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 3ab7471531017008e14a3cc27c7e6fb2196361d6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 11 Jan 2022 04:30:27 -0800 Subject: [PATCH 533/750] 2022-01-11 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 4e5d4ecb890a8427a9f144cdaa5c0d4958ee5182 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 12 Jan 2022 04:30:30 -0800 Subject: [PATCH 534/750] 2022-01-12 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From e2a5c669d28194e63efea29438239cc8cfcd8cd3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 13 Jan 2022 04:30:26 -0800 Subject: [PATCH 535/750] 2022-01-13 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From fd8a60e616dd48147ec345b5454866e4ccddfb0d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 14 Jan 2022 04:30:32 -0800 Subject: [PATCH 536/750] 2022-01-14 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From b16329f2556e35559e8350bdf5297c7c698e4d25 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 15 Jan 2022 04:30:31 -0800 Subject: [PATCH 537/750] 2022-01-15 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From cbfc5f8a28a68ae6417bcac4a3ce121fe8e50529 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 16 Jan 2022 04:31:38 -0800 Subject: [PATCH 538/750] 2022-01-16 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From b1c97000778776add5a6b930258458728b651107 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 17 Jan 2022 04:30:31 -0800 Subject: [PATCH 539/750] 2022-01-17 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 7165d9e27d58d2c03d0959683b6fdde8e6826075 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 18 Jan 2022 04:30:26 -0800 Subject: [PATCH 540/750] 2022-01-18 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From b95dd6152ddfbe477f9afac56b4068b1ddfb0c33 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 19 Jan 2022 04:31:36 -0800 Subject: [PATCH 541/750] 2022-01-19 nightly release (760c165eb9d58efef93d122aecc149a2d17efc06) From 06cf18ad23c054fb692b38622037d41e46b055ab Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 25 Jan 2022 04:30:45 -0800 Subject: [PATCH 542/750] 2022-01-25 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9406868..acd6ffa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -291,7 +291,7 @@ jobs: <<: *binary_common machine: image: ubuntu-1604-cuda-10.1:201909-23 - resource_class: gpu.small + resource_class: gpu.nvidia.small.multi environment: image_name: "pytorch/manylinux-cuda101" PYTHON_VERSION: << parameters.python_version >> From 524d0c8324dfffd1f749a2ee7b0e59013c03071b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 26 Jan 2022 04:30:32 -0800 Subject: [PATCH 543/750] 2022-01-26 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 807f13f6d8c5ddcde0bbf64223d36a260e72fb8b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 27 Jan 2022 04:30:37 -0800 Subject: [PATCH 544/750] 2022-01-27 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 8783221a98329e58715a752a403118ad10c8bc14 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 28 Jan 2022 04:31:16 -0800 Subject: [PATCH 545/750] 2022-01-28 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From d4a4e66badd394b25f4ad7f6b587f0deb5468b79 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 29 Jan 2022 04:30:32 -0800 Subject: [PATCH 546/750] 2022-01-29 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 371e086965249da5cb6a6bb69bc1c236c5a81a57 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 30 Jan 2022 04:30:28 -0800 Subject: [PATCH 547/750] 2022-01-30 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 4c4d5e5203713cf17b60490c15baebe3f7f0344c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 31 Jan 2022 04:30:30 -0800 Subject: [PATCH 548/750] 2022-01-31 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 94f43ed1aef2859d74b430af82c5c47db9fffd55 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 1 Feb 2022 04:31:52 -0800 Subject: [PATCH 549/750] 2022-02-01 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From cb1aced9796c339b63b2301af936501cc120e7d0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 2 Feb 2022 04:32:07 -0800 Subject: [PATCH 550/750] 2022-02-02 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From b0cd2aaa3e80bdbd75138bc4f1e46af2c1fbfc4e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 3 Feb 2022 04:31:50 -0800 Subject: [PATCH 551/750] 2022-02-03 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From ab9da217bab8216ea21084da4b0c0826b4986583 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 4 Feb 2022 04:32:04 -0800 Subject: [PATCH 552/750] 2022-02-04 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 33e8c47345eaba44dc6f34644dce8eb7b1596152 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 5 Feb 2022 04:31:39 -0800 Subject: [PATCH 553/750] 2022-02-05 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 7f3e01f225eb52d3dadd76f40d1f76c14b4d11c6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 6 Feb 2022 04:31:55 -0800 Subject: [PATCH 554/750] 2022-02-06 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From b7c0c77f333dc0bb575c83ee9a2635d0d76d1952 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 7 Feb 2022 04:31:32 -0800 Subject: [PATCH 555/750] 2022-02-07 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From cf4b1047425d9b0891816bb4657b63226fc6bc97 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 8 Feb 2022 04:30:36 -0800 Subject: [PATCH 556/750] 2022-02-08 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 58e3f3c66a078f8b4772458185083d1381b09878 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 9 Feb 2022 04:30:32 -0800 Subject: [PATCH 557/750] 2022-02-09 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 2be539b20ddc7f90dbe90b45112d01cf0f285f57 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 10 Feb 2022 04:30:35 -0800 Subject: [PATCH 558/750] 2022-02-10 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From bd23a32a8253aafb88c172c824a96b5348bbe6eb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 11 Feb 2022 04:30:33 -0800 Subject: [PATCH 559/750] 2022-02-11 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From abb8a802b50221177495d9dac13fc04b7ebcf262 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 12 Feb 2022 04:30:37 -0800 Subject: [PATCH 560/750] 2022-02-12 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From f188318bc8d5db82b298a5f43dab28182df073a4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 13 Feb 2022 04:30:35 -0800 Subject: [PATCH 561/750] 2022-02-13 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From bb38eb5f16c795a9512690a8454353cbc7e3de55 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 14 Feb 2022 04:30:36 -0800 Subject: [PATCH 562/750] 2022-02-14 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 0e8336999e7917857ca4994c4f8c474a49f62f32 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 15 Feb 2022 04:31:02 -0800 Subject: [PATCH 563/750] 2022-02-15 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 84cd323acbdd132f19f2ef992f2ababb9fe7b682 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 16 Feb 2022 04:31:46 -0800 Subject: [PATCH 564/750] 2022-02-16 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 1b07f391bbed67382704f2394b2953d01d11944f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 17 Feb 2022 04:30:38 -0800 Subject: [PATCH 565/750] 2022-02-17 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From a3a2047186df279702845b43f0d2b7f6dd64faad Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 18 Feb 2022 04:30:35 -0800 Subject: [PATCH 566/750] 2022-02-18 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 651f8ee12e72d2654a6c7e58e6300730de4c399d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 19 Feb 2022 04:30:31 -0800 Subject: [PATCH 567/750] 2022-02-19 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 2f73f5a0f5ad004ef0f4b9c5d4068599c9f5af8b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 20 Feb 2022 04:30:26 -0800 Subject: [PATCH 568/750] 2022-02-20 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From e3a0c57d344545c7dbe0429d5aa4b447b80fe909 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 21 Feb 2022 04:30:30 -0800 Subject: [PATCH 569/750] 2022-02-21 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From ca55023f7799a36a1934e5971fb342d0cf635d5a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 22 Feb 2022 04:30:42 -0800 Subject: [PATCH 570/750] 2022-02-22 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From e8b51bd88ea2b978091b5fc73ce34a42fc350429 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 23 Feb 2022 04:31:30 -0800 Subject: [PATCH 571/750] 2022-02-23 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From af3012a8f90875da8fbbc1cd04585ba8e62294d4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 24 Feb 2022 04:31:36 -0800 Subject: [PATCH 572/750] 2022-02-24 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From f99c1fda0939490855bef1b475a522a350c1992c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 25 Feb 2022 04:30:30 -0800 Subject: [PATCH 573/750] 2022-02-25 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 31937d81c3970a9bea5150ac744681963f37b93d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 26 Feb 2022 04:30:22 -0800 Subject: [PATCH 574/750] 2022-02-26 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 4d8590bdbc2ab06bce397d7dcd0f2c4fa49e7532 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 27 Feb 2022 04:30:34 -0800 Subject: [PATCH 575/750] 2022-02-27 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From be0f2b3e5b3837c339b8aeee7d0b43bf968f28f8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 28 Feb 2022 04:30:29 -0800 Subject: [PATCH 576/750] 2022-02-28 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 17e99f4b7baf9918bda2ecb9f9af2a86151eca91 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 1 Mar 2022 04:31:51 -0800 Subject: [PATCH 577/750] 2022-03-01 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From f0ebf0d5f72d6dd223a5a1c00ea7c0ccdfa0bba8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 2 Mar 2022 04:30:26 -0800 Subject: [PATCH 578/750] 2022-03-02 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From d77173aa3de9661239726553a4b1dd553010aac5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 3 Mar 2022 04:30:26 -0800 Subject: [PATCH 579/750] 2022-03-03 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 3ed55412a3e56ce423e203656c841518d4271711 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 4 Mar 2022 04:30:29 -0800 Subject: [PATCH 580/750] 2022-03-04 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From fd67e1f8a81882525ff9238d60a276ba80a1266e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 5 Mar 2022 04:30:23 -0800 Subject: [PATCH 581/750] 2022-03-05 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 4e23f0ee4959c352842a8d5b16a7b6c33d572d29 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 6 Mar 2022 04:30:26 -0800 Subject: [PATCH 582/750] 2022-03-06 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From aebe9a7bbcd7162f189d68550a3ebd2188e10579 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 7 Mar 2022 04:30:35 -0800 Subject: [PATCH 583/750] 2022-03-07 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 9e6f5e95954d25221dabe13f4eaed57867256c3d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 8 Mar 2022 04:31:56 -0800 Subject: [PATCH 584/750] 2022-03-08 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 8fc95f2ee6685ab5f789a297e4b0c2cdf481386c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 9 Mar 2022 04:31:58 -0800 Subject: [PATCH 585/750] 2022-03-09 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 4852daa68731c76274149c2e8d8e404cad8583fe Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 10 Mar 2022 04:31:04 -0800 Subject: [PATCH 586/750] 2022-03-10 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 35f7d7fe9ae4f86d1e7bd44a7ac6113dc0fbae6f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 11 Mar 2022 04:32:06 -0800 Subject: [PATCH 587/750] 2022-03-11 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From dee67b61bc52d84d92b0ddc5411095bccd3463cf Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 12 Mar 2022 04:31:27 -0800 Subject: [PATCH 588/750] 2022-03-12 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From a635500b5f6bdb4177b0604f5ff6e0532441bb66 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 13 Mar 2022 04:31:45 -0700 Subject: [PATCH 589/750] 2022-03-13 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 967f171c3644cc572dbe4bcccbbfb7bcf3fe7897 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 14 Mar 2022 04:31:35 -0700 Subject: [PATCH 590/750] 2022-03-14 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From b5fb4be87c899e786df60b766b6e64fd970c7f77 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 15 Mar 2022 04:31:25 -0700 Subject: [PATCH 591/750] 2022-03-15 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From b5b947ab61800169ccd6ba0ad9dc01e00beacde1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 16 Mar 2022 04:30:27 -0700 Subject: [PATCH 592/750] 2022-03-16 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 3e90021af3326abb82ef91bdbb68816ce21251a7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 17 Mar 2022 04:30:43 -0700 Subject: [PATCH 593/750] 2022-03-17 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 2b7c962f70bcbc19a380b72174145075c6075447 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 18 Mar 2022 04:30:29 -0700 Subject: [PATCH 594/750] 2022-03-18 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From a94689b434ab74db655538dab56bdd031dfec4ab Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 19 Mar 2022 04:31:26 -0700 Subject: [PATCH 595/750] 2022-03-19 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 6ba58b1f250ca895f78c2e19b5f3a01cd0999d43 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 20 Mar 2022 04:30:34 -0700 Subject: [PATCH 596/750] 2022-03-20 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From b9bf3340d5927963b705f0114382c891713a2a33 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 21 Mar 2022 04:30:45 -0700 Subject: [PATCH 597/750] 2022-03-21 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From cd9ba01eba3286899e7648d498253588dbc47f0e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 22 Mar 2022 04:30:48 -0700 Subject: [PATCH 598/750] 2022-03-22 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 5dd3c75c5bd528c9bee2306141d21a19ba04400e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 23 Mar 2022 04:33:46 -0700 Subject: [PATCH 599/750] 2022-03-23 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 555424ddaca8ead8c1c4f63c101ea0dbe5380508 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 24 Mar 2022 04:37:55 -0700 Subject: [PATCH 600/750] 2022-03-24 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 320ed33a593d44cb23faf35ba1bccceb50e3bc43 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 25 Mar 2022 04:33:24 -0700 Subject: [PATCH 601/750] 2022-03-25 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 55a3a9dcd577b720390eac6799a3bc2c7b7470eb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 26 Mar 2022 04:33:20 -0700 Subject: [PATCH 602/750] 2022-03-26 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 855b7342ad088b84b8ca565e178c06c98471f45a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 27 Mar 2022 04:33:33 -0700 Subject: [PATCH 603/750] 2022-03-27 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 34713da95789a216cb68798265bcda1e8be41a69 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 28 Mar 2022 04:34:35 -0700 Subject: [PATCH 604/750] 2022-03-28 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 4b2658409f21031382e0b472619f073ce73f2fe7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 29 Mar 2022 04:33:23 -0700 Subject: [PATCH 605/750] 2022-03-29 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From be64e99efebdcf54f70ee137b0761e8d28753be0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 30 Mar 2022 04:33:09 -0700 Subject: [PATCH 606/750] 2022-03-30 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 3adce33b26e5b30ab70a951e023f3b108269bcb1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 31 Mar 2022 04:34:49 -0700 Subject: [PATCH 607/750] 2022-03-31 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 74b00532085e6746a0fa52049c927c7fa8b1abbc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 1 Apr 2022 04:34:37 -0700 Subject: [PATCH 608/750] 2022-04-01 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 5d880f298e5207c715382430dbcb21dd163bdfd2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 2 Apr 2022 04:30:44 -0700 Subject: [PATCH 609/750] 2022-04-02 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 3ca91398bd39513c45b6a133136f76eb27376b7f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 3 Apr 2022 04:30:52 -0700 Subject: [PATCH 610/750] 2022-04-03 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 402191b6e02fb331a8d0f4cd6ee740bb1b95b9dd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 4 Apr 2022 04:30:26 -0700 Subject: [PATCH 611/750] 2022-04-04 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 190ec9d4802dd035afd918dacd56e2d4a6b818f3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 5 Apr 2022 04:32:05 -0700 Subject: [PATCH 612/750] 2022-04-05 nightly release (cd8f2f670355f5a9b345dbe2cb58a52fb2c44d39) From 1a3cc889b80ed3dd84539b76adca545f8d369c2b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 6 Apr 2022 04:31:10 -0700 Subject: [PATCH 613/750] 2022-04-06 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ff1ad67..d9161b6 100644 --- a/setup.py +++ b/setup.py @@ -51,12 +51,9 @@ def write_version_file(): with open("README.md", "r") as fh: long_description = fh.read() -pytorch_dep = "torch" -if os.getenv("PYTORCH_VERSION"): - pytorch_dep += "==" + os.getenv("PYTORCH_VERSION") requirements = [ - pytorch_dep, + "torch", ] From b4f0dfc8e2284f13788c3ace5a220a3f0b448746 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 7 Apr 2022 04:30:30 -0700 Subject: [PATCH 614/750] 2022-04-07 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 3f3a9b00c9249668ab8734f9091d2afaf21d6276 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 8 Apr 2022 04:33:17 -0700 Subject: [PATCH 615/750] 2022-04-08 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From d0985382540762e1667c381fe1c7cd67eb215f7e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 9 Apr 2022 04:30:39 -0700 Subject: [PATCH 616/750] 2022-04-09 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 05a8d1a2cf33e0904677655d4b8f3fb170469673 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 10 Apr 2022 04:30:28 -0700 Subject: [PATCH 617/750] 2022-04-10 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 6de6aac513bb497678f94ec65f757cd48355605c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 11 Apr 2022 04:30:27 -0700 Subject: [PATCH 618/750] 2022-04-11 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 97ef064fd6a54c911b80a6c42f802acf1021e9c6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 12 Apr 2022 04:30:36 -0700 Subject: [PATCH 619/750] 2022-04-12 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 08d61e35c28e2d293cde0acade299ec4b4b961e6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 13 Apr 2022 04:30:30 -0700 Subject: [PATCH 620/750] 2022-04-13 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From f7bdc470821f1f8f61f90a61b24a8bfac8e5cb4a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 14 Apr 2022 04:30:29 -0700 Subject: [PATCH 621/750] 2022-04-14 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 7e673e8b51fc5824e36844218b0ccbe4edd8dfe6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 15 Apr 2022 04:30:30 -0700 Subject: [PATCH 622/750] 2022-04-15 nightly release (95fe8a3488b3bc77b7467966b7aa54b8cd78cf5c) From 447321e266a86a25655a092d79e4a8f8c15d6b38 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 16 Apr 2022 04:30:28 -0700 Subject: [PATCH 623/750] 2022-04-16 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) --- setup.py | 4 ++-- torchcsprng/__init__.pyi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index d9161b6..5143b53 100644 --- a/setup.py +++ b/setup.py @@ -6,12 +6,12 @@ import sys import torch -from setuptools import setup, find_packages +from setuptools import find_packages, setup from torch.utils.cpp_extension import ( BuildExtension, CppExtension, - CUDAExtension, CUDA_HOME, + CUDAExtension, ) version = open("version.txt", "r").read().strip() diff --git a/torchcsprng/__init__.pyi b/torchcsprng/__init__.pyi index 8a19a39..dcc28c2 100644 --- a/torchcsprng/__init__.pyi +++ b/torchcsprng/__init__.pyi @@ -3,7 +3,7 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -from torch import Tensor, Generator +from torch import Generator, Tensor def supports_cuda() -> bool: ... def create_random_device_generator(token: str = "") -> Generator: ... From 62544a4053381ab3a86002eab1aa43b5e0e7fb78 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 17 Apr 2022 04:30:30 -0700 Subject: [PATCH 624/750] 2022-04-17 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From d89edddcafaa1faf91aa7b9836bd26329f77d095 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 18 Apr 2022 04:30:28 -0700 Subject: [PATCH 625/750] 2022-04-18 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 0bc6989c642bc7df6d9e5e7adbee55627699030d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 19 Apr 2022 04:30:31 -0700 Subject: [PATCH 626/750] 2022-04-19 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 5c106977c552cced118a53bef1dabfb40c2ae0f7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 20 Apr 2022 04:30:29 -0700 Subject: [PATCH 627/750] 2022-04-20 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From a65bd208d74a83ed14b7ec0a57c728695f18360d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 21 Apr 2022 04:30:33 -0700 Subject: [PATCH 628/750] 2022-04-21 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 333354744582430a4a380c7383083d6b5cc1db5c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 22 Apr 2022 04:30:30 -0700 Subject: [PATCH 629/750] 2022-04-22 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From e183fa89f7b63b345fb78131e45fa1817dd860e9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 23 Apr 2022 04:30:26 -0700 Subject: [PATCH 630/750] 2022-04-23 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From c654190bcb8b803cd5d8fd844f59847f50dbf903 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 24 Apr 2022 04:30:34 -0700 Subject: [PATCH 631/750] 2022-04-24 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From e50ed6253ca5053338116b1942ddb6f559d3d306 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 25 Apr 2022 04:30:27 -0700 Subject: [PATCH 632/750] 2022-04-25 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 1b0cbbbaa9b36fd8e8c048088f40656fb009a03a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 26 Apr 2022 04:30:31 -0700 Subject: [PATCH 633/750] 2022-04-26 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 2538774c2a7a4b881a883c5d3dc047b58861524b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 27 Apr 2022 04:30:32 -0700 Subject: [PATCH 634/750] 2022-04-27 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From aa0526d45f55d8393ff445db5c4ec1d3b0d2a806 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 28 Apr 2022 04:30:30 -0700 Subject: [PATCH 635/750] 2022-04-28 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 9ffd3be14d203d7ff1be5ced850fd8406f6770ed Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 29 Apr 2022 04:30:33 -0700 Subject: [PATCH 636/750] 2022-04-29 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From f9a4ef7396b73bdacff4a1d0cf8a954f938435b0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 30 Apr 2022 04:30:28 -0700 Subject: [PATCH 637/750] 2022-04-30 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From e2fcef836e31c09010b014e1069e37d7c96299b2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 1 May 2022 04:30:29 -0700 Subject: [PATCH 638/750] 2022-05-01 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 54d2e11a82992631da3ecade8a34ec4d97f187b5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 2 May 2022 04:30:36 -0700 Subject: [PATCH 639/750] 2022-05-02 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 02d0d857cd596950614966279084ff16875650e4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 3 May 2022 04:30:29 -0700 Subject: [PATCH 640/750] 2022-05-03 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 4ba15d74b6168dce9b381defaa7d8e729b0eb179 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 4 May 2022 04:30:36 -0700 Subject: [PATCH 641/750] 2022-05-04 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From bb6089f79f1b4a65630259f213658ed2f8a8230c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 5 May 2022 04:30:30 -0700 Subject: [PATCH 642/750] 2022-05-05 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From ed1b684e7546b177f04c637aa808956bad03ffe7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 6 May 2022 04:30:31 -0700 Subject: [PATCH 643/750] 2022-05-06 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 540588ab67cf394ac493bec8e962ea0dda608057 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 7 May 2022 04:30:32 -0700 Subject: [PATCH 644/750] 2022-05-07 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From a640eeb308d1e5d1bde339a4ec2c65c718c4131a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 8 May 2022 04:30:32 -0700 Subject: [PATCH 645/750] 2022-05-08 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 41230884269e10ed96a521d32dce4f54bd29103e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 9 May 2022 04:31:05 -0700 Subject: [PATCH 646/750] 2022-05-09 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 0cd31e84dc13ccc1c254fb4535d5aaa57c4da13b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 10 May 2022 04:30:29 -0700 Subject: [PATCH 647/750] 2022-05-10 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From ed1e774583637836d3fa48080dd2eb06b74e41c2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 11 May 2022 04:30:31 -0700 Subject: [PATCH 648/750] 2022-05-11 nightly release (c34940e2415c39e67b720d71d7ab678be3bbe18f) From 5fe2c1715dce05340269234b9e1a1b0761eb5628 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 12 May 2022 04:30:27 -0700 Subject: [PATCH 649/750] 2022-05-12 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) --- test/test_csprng.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_csprng.py b/test/test_csprng.py index dfce378..3245ffd 100644 --- a/test/test_csprng.py +++ b/test/test_csprng.py @@ -72,13 +72,13 @@ def test_random_kstest(self): for gen in self.all_generators: for dtype in self.num_dtypes: if dtype == torch.float: - to_inc = 2 ** 24 + to_inc = 2**24 elif dtype == torch.double: - to_inc = 2 ** 53 + to_inc = 2**53 elif dtype == torch.half: - to_inc = 2 ** 11 + to_inc = 2**11 elif dtype == torch.bfloat16: - to_inc = 2 ** 8 + to_inc = 2**8 else: to_inc = torch.iinfo(dtype).max From 66eb9119317a102c0576633d3f36ed20d019f71b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 13 May 2022 04:30:27 -0700 Subject: [PATCH 650/750] 2022-05-13 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From da03e21e3fceae59035edfb29067b624cc9eacbb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 14 May 2022 04:30:30 -0700 Subject: [PATCH 651/750] 2022-05-14 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 00c694ce292cf354ffbaec30fdef3b25632341ed Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 15 May 2022 04:30:31 -0700 Subject: [PATCH 652/750] 2022-05-15 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0295ecb8652cec72de678bc6e430a7bfd16ff856 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 16 May 2022 04:30:35 -0700 Subject: [PATCH 653/750] 2022-05-16 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 7d2bde6767c864e475ca4f5cd9025c98a89f698c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 17 May 2022 04:30:32 -0700 Subject: [PATCH 654/750] 2022-05-17 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From fb1c0b2ee490ba7a1bb16bf0c406eee648fd093e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 18 May 2022 04:30:37 -0700 Subject: [PATCH 655/750] 2022-05-18 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9ac66c4d2492e13d9868b5bccc845cd004cffdc6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 19 May 2022 04:30:30 -0700 Subject: [PATCH 656/750] 2022-05-19 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 4a46de2b82d521587765e90cd7726c943013fb10 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 20 May 2022 04:30:26 -0700 Subject: [PATCH 657/750] 2022-05-20 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From fcd8cc01d18c899ab14d882c23cce9cfb7589f00 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 21 May 2022 04:30:23 -0700 Subject: [PATCH 658/750] 2022-05-21 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 3934ae86fe8c4bbfb616263dd553a62bf17af5d9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 22 May 2022 04:30:32 -0700 Subject: [PATCH 659/750] 2022-05-22 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0ea4fd8971fa5768ad32c7c07e5e22858d59444e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 23 May 2022 04:30:27 -0700 Subject: [PATCH 660/750] 2022-05-23 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c3780ab8a2164c6e1b6d2bf5777d13e4ec901f10 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 24 May 2022 04:30:30 -0700 Subject: [PATCH 661/750] 2022-05-24 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 59d889904bffa81bbc63401a8d158f3b3de57ca9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 25 May 2022 04:30:32 -0700 Subject: [PATCH 662/750] 2022-05-25 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 08394f429128ee7ad9b9182ac3b27fcfc288b491 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 26 May 2022 04:30:32 -0700 Subject: [PATCH 663/750] 2022-05-26 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From f4ecb321a82e1d76943ea0560bfe36c6ef9afe98 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 27 May 2022 04:30:26 -0700 Subject: [PATCH 664/750] 2022-05-27 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 2e162eaf45716c7fea9899d8bc3053c9299d3009 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 28 May 2022 04:30:32 -0700 Subject: [PATCH 665/750] 2022-05-28 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From d0e97c932cc599f071ccfbb51e7216ad603a605c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 29 May 2022 04:30:29 -0700 Subject: [PATCH 666/750] 2022-05-29 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 67aacbcd00f00bf33161479b37a3395323f296dd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 30 May 2022 04:30:22 -0700 Subject: [PATCH 667/750] 2022-05-30 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 70a4f4ce68e2b0f2c5449a0f1fdff668353aa4db Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 31 May 2022 04:30:30 -0700 Subject: [PATCH 668/750] 2022-05-31 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From ed15ed70738f0d7ad4d5b12e0e7325d502ec4a9e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 1 Jun 2022 04:30:37 -0700 Subject: [PATCH 669/750] 2022-06-01 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 7acb0bcedddaf4fc9c01d1fa97d25b1d544c987c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 2 Jun 2022 04:30:34 -0700 Subject: [PATCH 670/750] 2022-06-02 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 17ba5f0d1349718ced8ba3f6f56cd8f342be9960 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 3 Jun 2022 04:30:35 -0700 Subject: [PATCH 671/750] 2022-06-03 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 65924590ea16179c356054f0263802366b14e9b3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 4 Jun 2022 04:30:34 -0700 Subject: [PATCH 672/750] 2022-06-04 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 3aa99896e7305ef0c9156a0691c2b1f8db724982 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 5 Jun 2022 04:30:33 -0700 Subject: [PATCH 673/750] 2022-06-05 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9f6c2c7a8470b38a801003e3b0841cdca49f55fc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 6 Jun 2022 04:30:33 -0700 Subject: [PATCH 674/750] 2022-06-06 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From f6af862227fbbda865288ec4b913c843da585f9f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 7 Jun 2022 04:30:31 -0700 Subject: [PATCH 675/750] 2022-06-07 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 1ff9c73a199b440e017f96de04f92d650dddbedd Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 8 Jun 2022 04:30:44 -0700 Subject: [PATCH 676/750] 2022-06-08 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From e88cb797e4690ca452da498af27a1beacab862a1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 9 Jun 2022 04:30:35 -0700 Subject: [PATCH 677/750] 2022-06-09 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From e79fda575807e350090cea408fe0273527f7ba73 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 10 Jun 2022 04:30:30 -0700 Subject: [PATCH 678/750] 2022-06-10 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 5152c4801b27d5585f5bc033d1e6a6783c09daf2 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 11 Jun 2022 04:30:31 -0700 Subject: [PATCH 679/750] 2022-06-11 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 8e0da6a7e6d1351a9f5621875ce5cbab23a37425 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 12 Jun 2022 04:30:28 -0700 Subject: [PATCH 680/750] 2022-06-12 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 75b38d6ec1ef923eaf7fb5b4b7800813557e77bc Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 13 Jun 2022 04:30:32 -0700 Subject: [PATCH 681/750] 2022-06-13 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 12b27f5b012a1f53edee7fba737b91c2dacc85d3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 14 Jun 2022 04:31:03 -0700 Subject: [PATCH 682/750] 2022-06-14 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0accf7de091399f399bc2a635dcbac5b533929d8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 15 Jun 2022 04:30:34 -0700 Subject: [PATCH 683/750] 2022-06-15 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From d7038b22fb2f39586ede11faecdea9aebf01a145 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 16 Jun 2022 04:30:35 -0700 Subject: [PATCH 684/750] 2022-06-16 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 45cf470eacdd7998fe420ca73a5613af4ade886f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 17 Jun 2022 04:30:34 -0700 Subject: [PATCH 685/750] 2022-06-17 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9732076f7e71def039a5799abdc69860ec92638a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 18 Jun 2022 04:30:37 -0700 Subject: [PATCH 686/750] 2022-06-18 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c1516f4e809a54ac55e6e864e764d3b7d741ac7c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 19 Jun 2022 04:30:33 -0700 Subject: [PATCH 687/750] 2022-06-19 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 34a13d921c2d498cd8d532c923557c6fc87ef3e6 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 20 Jun 2022 04:30:28 -0700 Subject: [PATCH 688/750] 2022-06-20 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From f2fc23052d628bd52c645cf6007fe32caeccf6d7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 21 Jun 2022 04:30:32 -0700 Subject: [PATCH 689/750] 2022-06-21 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 92767065a515c2e2ad402e57fdaf6ff7b8a1bee0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 22 Jun 2022 04:30:35 -0700 Subject: [PATCH 690/750] 2022-06-22 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 39e920467472c7fbd573928da8f6abd7a121bf30 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 23 Jun 2022 04:30:29 -0700 Subject: [PATCH 691/750] 2022-06-23 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0dd39292fa3f0e345d2b480adb656eb555d618b4 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 24 Jun 2022 04:30:34 -0700 Subject: [PATCH 692/750] 2022-06-24 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 03ef7a4533318ece1fd9fdf2f22e153e61651f87 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 25 Jun 2022 04:30:35 -0700 Subject: [PATCH 693/750] 2022-06-25 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9fc0076092e98303388f93de594192172237a221 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 26 Jun 2022 04:31:20 -0700 Subject: [PATCH 694/750] 2022-06-26 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From eb8311a1cbe6ccb2b45be9419e13ec1ea4d63086 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 27 Jun 2022 04:30:38 -0700 Subject: [PATCH 695/750] 2022-06-27 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9259929f71bf1b3b78f3caff6670de9d50a37d13 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 28 Jun 2022 04:30:31 -0700 Subject: [PATCH 696/750] 2022-06-28 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 83434a47b1bde29b89b0df9d6d099c514dc59adb Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 29 Jun 2022 04:30:38 -0700 Subject: [PATCH 697/750] 2022-06-29 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From dec1f7a4d6f237997e1c2b11d4f0d97aa583f9e3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 30 Jun 2022 04:30:35 -0700 Subject: [PATCH 698/750] 2022-06-30 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0f2f1cc44668a4138a2789e144861a8f54d288ac Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 1 Jul 2022 04:30:31 -0700 Subject: [PATCH 699/750] 2022-07-01 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 63e80bc17aa792d442f4d551ece184c42fa64849 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 2 Jul 2022 04:30:31 -0700 Subject: [PATCH 700/750] 2022-07-02 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 7e958d53ce2ea55991c2c92270097a12ae35ac2b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 3 Jul 2022 04:30:40 -0700 Subject: [PATCH 701/750] 2022-07-03 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 3ade6e20227543ee9946ac18838eddf34c57d9b1 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 4 Jul 2022 04:30:32 -0700 Subject: [PATCH 702/750] 2022-07-04 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 5ede51aa560b8fa51d5d25491512ac69ee88a4a9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 5 Jul 2022 04:30:38 -0700 Subject: [PATCH 703/750] 2022-07-05 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 14ca0a5ccef50e1a0d5822afff592e4a0beab368 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 6 Jul 2022 04:30:29 -0700 Subject: [PATCH 704/750] 2022-07-06 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From ce75dad3cf2d854302462e2b6eed6cce9f6055df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 7 Jul 2022 04:30:43 -0700 Subject: [PATCH 705/750] 2022-07-07 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 6fc8c9bae93052a5764f59a80c4a77b29cad858c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 8 Jul 2022 04:30:38 -0700 Subject: [PATCH 706/750] 2022-07-08 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 61345e172e1d3a8d2fa460c64706ee395bba176e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 9 Jul 2022 04:30:31 -0700 Subject: [PATCH 707/750] 2022-07-09 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 2641b3ccbe3e33ef64333ba03bba09aac62b7a4f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 10 Jul 2022 04:30:35 -0700 Subject: [PATCH 708/750] 2022-07-10 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From d0a268077f86b010eb06ac79823b8d9009dd557f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 11 Jul 2022 04:30:35 -0700 Subject: [PATCH 709/750] 2022-07-11 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c45ce80ecf2b2462e751159f79289e9baffd487a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 12 Jul 2022 04:30:32 -0700 Subject: [PATCH 710/750] 2022-07-12 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 7c604bee5e0ad5f0152349757ea9de9ac9ec8118 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 13 Jul 2022 04:30:31 -0700 Subject: [PATCH 711/750] 2022-07-13 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 382f74e07e17a338e3a1fe2f0085c3df6f92919b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 14 Jul 2022 04:31:04 -0700 Subject: [PATCH 712/750] 2022-07-14 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From dd49b07e8d632606c80e66caf992ad6a03d011ec Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 15 Jul 2022 04:30:32 -0700 Subject: [PATCH 713/750] 2022-07-15 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0a8f1f4ba9ba6448818527d73615b3a4844761d0 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 16 Jul 2022 04:30:33 -0700 Subject: [PATCH 714/750] 2022-07-16 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 6b30aa1c0318971f9cb216e653cf239347e07a97 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 17 Jul 2022 04:30:31 -0700 Subject: [PATCH 715/750] 2022-07-17 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From a9b9c07248b08046e2d73834590d73cb8a94f9ea Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 18 Jul 2022 04:31:32 -0700 Subject: [PATCH 716/750] 2022-07-18 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 8e5a2e390c74e7fd2894196570f797157665fa40 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 19 Jul 2022 04:30:34 -0700 Subject: [PATCH 717/750] 2022-07-19 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 0d096b9bf5274cfe0929ca0d25aee42e5e2757df Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 20 Jul 2022 04:31:19 -0700 Subject: [PATCH 718/750] 2022-07-20 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 5e4203d0474fe8fef9e33b0a1a7c6a6094f5ffb8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 21 Jul 2022 04:30:57 -0700 Subject: [PATCH 719/750] 2022-07-21 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c71467b67ba4feb6abc3568e5f75d89e6077cb4c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 22 Jul 2022 04:30:32 -0700 Subject: [PATCH 720/750] 2022-07-22 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 9054db9c6f6cca79ddb65bb7f2e9a60d8930716e Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 23 Jul 2022 04:30:41 -0700 Subject: [PATCH 721/750] 2022-07-23 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From b90a25caf771274cac8371da37e2f00cff4fb681 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 24 Jul 2022 04:30:30 -0700 Subject: [PATCH 722/750] 2022-07-24 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 5056b57a4cef8fbbfa606674136047fc3b8e563c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 25 Jul 2022 04:30:36 -0700 Subject: [PATCH 723/750] 2022-07-25 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c8044d9f59ac59be07904516956918a2546c0d9a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 26 Jul 2022 04:31:07 -0700 Subject: [PATCH 724/750] 2022-07-26 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 17441a5e67d4f382aad5d85c7794f795381ac43d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 27 Jul 2022 04:30:46 -0700 Subject: [PATCH 725/750] 2022-07-27 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 586651482413ff2755b84fbc1741a72c243f19ea Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 28 Jul 2022 04:30:28 -0700 Subject: [PATCH 726/750] 2022-07-28 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c7b7494e3811a16b0bc6ede8a6eabc1a5faf9462 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 29 Jul 2022 04:30:32 -0700 Subject: [PATCH 727/750] 2022-07-29 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 333996db2976f2ff8eb46fa00129909ae46e69ee Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 30 Jul 2022 04:31:32 -0700 Subject: [PATCH 728/750] 2022-07-30 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 3e01085bf25f29b88744495145347b5cd7d9b526 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 31 Jul 2022 04:30:25 -0700 Subject: [PATCH 729/750] 2022-07-31 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 76f5c427b4d0d49471e13428fa90b9ca33337807 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 1 Aug 2022 04:30:36 -0700 Subject: [PATCH 730/750] 2022-08-01 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From bc884929d65c0257eeec3b98d1fdfcb2a24f9f9c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 3 Aug 2022 04:31:00 -0700 Subject: [PATCH 731/750] 2022-08-03 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 33607cc19924b98fa38abd927d90164f54ea8d63 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 4 Aug 2022 04:30:38 -0700 Subject: [PATCH 732/750] 2022-08-04 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 862cc91dfaf62e76eb380372cbfa80fd81f21c4a Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 5 Aug 2022 04:30:34 -0700 Subject: [PATCH 733/750] 2022-08-05 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From e8088278147ba1559e90ce63eae23b78d13baee9 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 6 Aug 2022 04:30:50 -0700 Subject: [PATCH 734/750] 2022-08-06 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 56eee06322bdc0286736e93cecbd95a5b54d025c Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 7 Aug 2022 04:30:42 -0700 Subject: [PATCH 735/750] 2022-08-07 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From daedecb2df914e5161747662c2c738c7fa76dea5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 8 Aug 2022 04:31:24 -0700 Subject: [PATCH 736/750] 2022-08-08 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 7fff8632bbe2ac4f165582c03e83f7957d96bed5 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 9 Aug 2022 04:30:35 -0700 Subject: [PATCH 737/750] 2022-08-09 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c47753e42304bc35d67980e78c15cb1d4c37553f Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 10 Aug 2022 04:30:43 -0700 Subject: [PATCH 738/750] 2022-08-10 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 5060a7ee4a7dc7aa076c6e65f70c4ecc99ea9013 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 11 Aug 2022 04:30:33 -0700 Subject: [PATCH 739/750] 2022-08-11 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 98cb43375e507d7841bd576a5e7c5dca2288d4b7 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 12 Aug 2022 04:30:42 -0700 Subject: [PATCH 740/750] 2022-08-12 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c15f612800f7961c9d9d38d3ab1c96fd5bac6092 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 13 Aug 2022 04:33:11 -0700 Subject: [PATCH 741/750] 2022-08-13 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From c3772029c74b318bb385a441fafe18c10a981a2b Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 14 Aug 2022 04:30:38 -0700 Subject: [PATCH 742/750] 2022-08-14 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 23b5ed56fcbc2a6d53be68814a68cd5a1b033ece Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 15 Aug 2022 04:30:43 -0700 Subject: [PATCH 743/750] 2022-08-15 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 63466f5d0b003d0c37cc2bb31cc773af785b4339 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Tue, 16 Aug 2022 04:30:37 -0700 Subject: [PATCH 744/750] 2022-08-16 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From ab6a121e5cccabe35ab98b6777c6b57b3105a8c8 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Wed, 17 Aug 2022 04:30:40 -0700 Subject: [PATCH 745/750] 2022-08-17 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 6d6e8e15629ec2515e04e79800fec8935ab18194 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Thu, 18 Aug 2022 04:30:35 -0700 Subject: [PATCH 746/750] 2022-08-18 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From b5e0995d84062b469faa0be96d754f22884fbf7d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Fri, 19 Aug 2022 04:30:37 -0700 Subject: [PATCH 747/750] 2022-08-19 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From 3a9eac408ccb58455b4e6f87246630dc4fb1439d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sat, 20 Aug 2022 04:30:35 -0700 Subject: [PATCH 748/750] 2022-08-20 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From abc729608942e2e87a84dd3adc3ff45f91c4817d Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Sun, 21 Aug 2022 04:30:34 -0700 Subject: [PATCH 749/750] 2022-08-21 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27) From ae7c8fbf70c6e4956f17e0125cdcca2c15331ec3 Mon Sep 17 00:00:00 2001 From: chronos_secgrp_pytorch_oss_ci_oncall Date: Mon, 22 Aug 2022 04:30:56 -0700 Subject: [PATCH 750/750] 2022-08-22 nightly release (262e3f17199e8bf757067b190bddae7d0e199b27)