Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIT] greedy by size memory planning strategy #64349

Closed
wants to merge 21 commits into from

Conversation

makslevental
Copy link
Contributor

@makslevental makslevental commented Sep 1, 2021

Stack from ghstack:

Greedy by size (a heuristic that allocates largest tensors first) based on this paper. It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: D30769096

Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot added oncall: jit Add this issue/PR to JIT oncall triage queue cla signed labels Sep 1, 2021
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Sep 1, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit fd9cd4a (more details on the Dr. CI page):


  • 5/5 failures introduced in this PR

🕵️ 4 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_test (1/4)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

Nov 03 21:08:08 FAIL [0.005s]: test_forward_mod...D_corrcoef_cpu_float64 (__main__.TestGradientsCPU)
Nov 03 21:08:08     result = test(self, **param_kwargs)
Nov 03 21:08:08   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 737, in test_wrapper
Nov 03 21:08:08     return test(*args, **kwargs)
Nov 03 21:08:08   File "test_ops.py", line 729, in test_forward_mode_AD
Nov 03 21:08:08     self._forward_grad_helper(device, dtype, op, op.get_op())
Nov 03 21:08:08   File "test_ops.py", line 723, in _forward_grad_helper
Nov 03 21:08:08     check_undefined_grad=False, check_batched_grad=False)
Nov 03 21:08:08 AssertionError: NotImplementedError not raised : Running forward AD for an OP that has does not support it did not raise any error. If your op supports forward AD, you should set supports_forward_ad=True
Nov 03 21:08:08 
Nov 03 21:08:08 ======================================================================
Nov 03 21:08:08 FAIL [0.005s]: test_forward_mode_AD_corrcoef_cpu_float64 (__main__.TestGradientsCPU)
Nov 03 21:08:08 ----------------------------------------------------------------------
Nov 03 21:08:08 Traceback (most recent call last):
Nov 03 21:08:08   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 371, in instantiated_test
Nov 03 21:08:08     result = test(self, **param_kwargs)
Nov 03 21:08:08   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 737, in test_wrapper
Nov 03 21:08:08     return test(*args, **kwargs)
Nov 03 21:08:08   File "test_ops.py", line 729, in test_forward_mode_AD
Nov 03 21:08:08     self._forward_grad_helper(device, dtype, op, op.get_op())
Nov 03 21:08:08   File "test_ops.py", line 723, in _forward_grad_helper
Nov 03 21:08:08     check_undefined_grad=False, check_batched_grad=False)

See GitHub Actions build win-vs2019-cuda11.3-py3 / build (2/4)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

2021-11-03T19:35:22.9436975Z C:\actions-runner\...81): error C3861: 'greedyBy': identifier not found
2021-11-03T19:35:21.0949999Z FAILED: caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/passes/memory_planning/greedy_by_size.cpp.obj 
2021-11-03T19:35:21.3652132Z C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\bin\sccache-cl.exe   /TP -DADD_BREAKPAD_SIGNAL_HANDLER -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMAGMA_V2 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_cpu_EXPORTS -IC:\actions-runner\_work\pytorch\pytorch\build\aten\src -IC:\actions-runner\_work\pytorch\pytorch\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build -IC:\actions-runner\_work\pytorch\pytorch -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\benchmark\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\cudnn_frontend\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party\breakpad\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc -IC:\actions-runner\_work\pytorch\pytorch\third_party\miniz-2.0.8 -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\src -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\distributed -IC:\actions-runner\_work\pytorch\pytorch\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\aten\..\third_party\catch\single_include -IC:\actions-runner\_work\pytorch\pytorch\aten\src\ATen\.. -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\c10\.. -IC:\actions-runner\_work\pytorch\pytorch\third_party\pthreadpool\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\cpuinfo\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\third_party\asmjit\src -IC:\actions-runner\_work\pytorch\pytorch\third_party\FP16\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fmt\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\src\..\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googlemock\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googletest\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\protobuf\src -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\mkl\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\XNNPACK\include -IC:\actions-runner\_work\pytorch\pytorch\third_party -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\pybind11\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\magma\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -O2 -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DCAFFE2_BUILD_MAIN_LIB -DONNX_BUILD_MAIN_LIB -std:c++14 /showIncludes /Focaffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp.obj /Fdcaffe2\
2021-11-03T19:35:21.7583688Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(37): error C2061: syntax error: identifier 'pair'
2021-11-03T19:35:21.9577058Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(41): error C2065: 'Cmp': undeclared identifier
2021-11-03T19:35:22.1722623Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(41): error C2146: syntax error: missing ')' before identifier 'cmp'
2021-11-03T19:35:22.3695123Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(44): error C2143: syntax error: missing ';' before '{'
2021-11-03T19:35:22.5596992Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(44): error C2447: '{': missing function header (old-style formal list?)
2021-11-03T19:35:22.7561476Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(63): error C3861: 'greedyBy': identifier not found
2021-11-03T19:35:22.9059710Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(69): error C3861: 'greedyBy': identifier not found
2021-11-03T19:35:22.9434841Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(75): error C3861: 'greedyBy': identifier not found
2021-11-03T19:35:22.9436975Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(81): error C3861: 'greedyBy': identifier not found
2021-11-03T19:35:22.9895204Z Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
2021-11-03T19:35:22.9896165Z Copyright (C) Microsoft Corporation.  All rights reserved.
2021-11-03T19:35:23.1180958Z 
2021-11-03T19:35:25.0364493Z [3738/4776] C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\bin\sccache-cl.exe   /TP -DADD_BREAKPAD_SIGNAL_HANDLER -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMAGMA_V2 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_cpu_EXPORTS -IC:\actions-runner\_work\pytorch\pytorch\build\aten\src -IC:\actions-runner\_work\pytorch\pytorch\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build -IC:\actions-runner\_work\pytorch\pytorch -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\benchmark\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\cudnn_frontend\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party\breakpad\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc -IC:\actions-runner\_work\pytorch\pytorch\third_party\miniz-2.0.8 -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\src -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\distributed -IC:\actions-runner\_work\pytorch\pytorch\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\aten\..\third_party\catch\single_include -IC:\actions-runner\_work\pytorch\pytorch\aten\src\ATen\.. -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\c10\.. -IC:\actions-runner\_work\pytorch\pytorch\third_party\pthreadpool\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\cpuinfo\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\third_party\asmjit\src -IC:\actions-runner\_work\pytorch\pytorch\third_party\FP16\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fmt\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\src\..\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googlemock\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googletest\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\protobuf\src -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\mkl\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\XNNPACK\include -IC:\actions-runner\_work\pytorch\pytorch\third_party -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\pybind11\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\magma\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -O2 -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DCAFFE2_BUILD_MAIN_LIB -DONNX_BUILD_MAIN_LIB -std:c++14 /showIncludes /Focaffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\lower_grad_of.cpp.obj /Fdcaffe2\CMake
2021-11-03T19:35:25.1938256Z Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
2021-11-03T19:35:25.3939373Z Copyright (C) Microsoft Corporation.  All rights reserved.
2021-11-03T19:35:25.5940477Z 
2021-11-03T19:35:26.5586464Z [3739/4776] C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\bin\sccache-cl.exe   /TP -DADD_BREAKPAD_SIGNAL_HANDLER -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMAGMA_V2 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_cpu_EXPORTS -IC:\actions-runner\_work\pytorch\pytorch\build\aten\src -IC:\actions-runner\_work\pytorch\pytorch\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build -IC:\actions-runner\_work\pytorch\pytorch -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\benchmark\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\cudnn_frontend\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party\breakpad\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc -IC:\actions-runner\_work\pytorch\pytorch\third_party\miniz-2.0.8 -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\src -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\distributed -IC:\actions-runner\_work\pytorch\pytorch\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\aten\..\third_party\catch\single_include -IC:\actions-runner\_work\pytorch\pytorch\aten\src\ATen\.. -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\c10\.. -IC:\actions-runner\_work\pytorch\pytorch\third_party\pthreadpool\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\cpuinfo\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\third_party\asmjit\src -IC:\actions-runner\_work\pytorch\pytorch\third_party\FP16\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fmt\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\src\..\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googlemock\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googletest\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\protobuf\src -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\mkl\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\XNNPACK\include -IC:\actions-runner\_work\pytorch\pytorch\third_party -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\pybind11\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\magma\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DCUDA_HAS_FP16=1 -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -O2 -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DCAFFE2_BUILD_MAIN_LIB -DONNX_BUILD_MAIN_LIB -std:c++14 /showIncludes /Focaffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\liveness.cpp.obj /Fdcaffe2\CMakeFiles
2021-11-03T19:35:26.7561265Z Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
2021-11-03T19:35:26.9094123Z Copyright (C) Microsoft Corporation.  All rights reserved.

See GitHub Actions build win-vs2019-cpu-py3 / build (3/4)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

2021-11-03T19:42:30.2733263Z C:\actions-runner\...81): error C3861: 'greedyBy': identifier not found
2021-11-03T19:42:30.2694234Z cl -DADD_BREAKPAD_SIGNAL_HANDLER -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_cpu_EXPORTS -IC:\actions-runner\_work\pytorch\pytorch\build\aten\src -IC:\actions-runner\_work\pytorch\pytorch\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build -IC:\actions-runner\_work\pytorch\pytorch -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\benchmark\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party\breakpad\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc -IC:\actions-runner\_work\pytorch\pytorch\third_party\miniz-2.0.8 -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\src -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\distributed -IC:\actions-runner\_work\pytorch\pytorch\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\aten\..\third_party\catch\single_include -IC:\actions-runner\_work\pytorch\pytorch\aten\src\ATen\.. -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\c10\.. -IC:\actions-runner\_work\pytorch\pytorch\third_party\pthreadpool\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\cpuinfo\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\third_party\asmjit\src -IC:\actions-runner\_work\pytorch\pytorch\third_party\FP16\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fmt\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\src\..\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googlemock\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googletest\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\protobuf\src -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\mkl\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\XNNPACK\include -IC:\actions-runner\_work\pytorch\pytorch\third_party -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\pybind11\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -O2 -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DCAFFE2_BUILD_MAIN_LIB -DONNX_BUILD_MAIN_LIB -std:c++14
2021-11-03T19:42:30.2716829Z 
2021-11-03T19:42:30.2717975Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(37): error C2061: syntax error: identifier 'pair'
2021-11-03T19:42:30.2719949Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(41): error C2065: 'Cmp': undeclared identifier
2021-11-03T19:42:30.2721820Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(41): error C2146: syntax error: missing ')' before identifier 'cmp'
2021-11-03T19:42:30.2723675Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(44): error C2143: syntax error: missing ';' before '{'
2021-11-03T19:42:30.2725540Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(44): error C2447: '{': missing function header (old-style formal list?)
2021-11-03T19:42:30.2727446Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(63): error C3861: 'greedyBy': identifier not found
2021-11-03T19:42:30.2729334Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(69): error C3861: 'greedyBy': identifier not found
2021-11-03T19:42:30.2731360Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(75): error C3861: 'greedyBy': identifier not found
2021-11-03T19:42:30.2733263Z C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\memory_planning\greedy_by_size.cpp(81): error C3861: 'greedyBy': identifier not found
2021-11-03T19:42:30.8445034Z [3706/4390] C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\bin\sccache-cl.exe   /TP @caffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\lower_grad_of.cpp.obj.rsp /showIncludes /Focaffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\lower_grad_of.cpp.obj /Fdcaffe2\CMakeFiles\torch_cpu.dir\ /FS -c C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\lower_grad_of.cpp
2021-11-03T19:42:30.8554076Z Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
2021-11-03T19:42:30.8555645Z Copyright (C) Microsoft Corporation.  All rights reserved.
2021-11-03T19:42:30.8558060Z 
2021-11-03T19:42:30.8584730Z cl -DADD_BREAKPAD_SIGNAL_HANDLER -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTH_BLAS_MKL -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_OPENMP_NOFORCE_MANIFEST -Dtorch_cpu_EXPORTS -IC:\actions-runner\_work\pytorch\pytorch\build\aten\src -IC:\actions-runner\_work\pytorch\pytorch\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build -IC:\actions-runner\_work\pytorch\pytorch -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\benchmark\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\onnx -IC:\actions-runner\_work\pytorch\pytorch\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\foxi -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\api\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party -IC:\actions-runner\_work\pytorch\pytorch\caffe2\..\third_party\breakpad\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\..\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc -IC:\actions-runner\_work\pytorch\pytorch\third_party\miniz-2.0.8 -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\kineto\libkineto\src -IC:\actions-runner\_work\pytorch\pytorch\torch\csrc\distributed -IC:\actions-runner\_work\pytorch\pytorch\aten\src\TH -IC:\actions-runner\_work\pytorch\pytorch\aten\..\third_party\catch\single_include -IC:\actions-runner\_work\pytorch\pytorch\aten\src\ATen\.. -IC:\actions-runner\_work\pytorch\pytorch\build\caffe2\aten\src\ATen -IC:\actions-runner\_work\pytorch\pytorch\c10\.. -IC:\actions-runner\_work\pytorch\pytorch\third_party\pthreadpool\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\cpuinfo\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm -IC:\actions-runner\_work\pytorch\pytorch\third_party\fbgemm\third_party\asmjit\src -IC:\actions-runner\_work\pytorch\pytorch\third_party\FP16\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\fmt\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\src\..\include -IC:\actions-runner\_work\pytorch\pytorch\build\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\gloo -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googlemock\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\googletest\googletest\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\protobuf\src -IC:\actions-runner\_work\pytorch\pytorch\build\win_tmp\mkl\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\XNNPACK\include -IC:\actions-runner\_work\pytorch\pytorch\third_party -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\eigen -IC:\Jenkins\Miniconda3\include -IC:\Jenkins\Miniconda3\lib\site-packages\numpy\core\include -IC:\actions-runner\_work\pytorch\pytorch\cmake\..\third_party\pybind11\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\mkl-dnn\include -IC:\actions-runner\_work\pytorch\pytorch\third_party\ideep\include -IC:\actions-runner\_work\pytorch\pytorch\caffe2 /DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -DUSE_PTHREADPOOL -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION /MD /O2 /Ob2 /DNDEBUG /w /bigobj -DNDEBUG -DCAFFE2_USE_GLOO -DUSE_GCC_GET_CPUID -DUSE_AVX -DUSE_AVX2 -DTH_HAVE_THREAD /EHsc /DNOMINMAX /wd4267 /wd4251 /wd4522 /wd4838 /wd4305 /wd4244 /wd4190 /wd4101 /wd4996 /wd4275 /bigobj -O2 -openmp:experimental -IC:/actions-runner/_work/pytorch/pytorch/build/win_tmp/mkl/include -DCAFFE2_BUILD_MAIN_LIB -DONNX_BUILD_MAIN_LIB -std:c++14
2021-11-03T19:42:30.8609528Z 
2021-11-03T19:42:31.1268018Z [3707/4390] C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\bin\sccache-cl.exe   /TP @caffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\liveness.cpp.obj.rsp /showIncludes /Focaffe2\CMakeFiles\torch_cpu.dir\__\torch\csrc\jit\passes\liveness.cpp.obj /Fdcaffe2\CMakeFiles\torch_cpu.dir\ /FS -c C:\actions-runner\_work\pytorch\pytorch\torch\csrc\jit\passes\liveness.cpp
2021-11-03T19:42:31.1271062Z Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
2021-11-03T19:42:31.1272086Z Copyright (C) Microsoft Corporation.  All rights reserved.
2021-11-03T19:42:31.1272702Z 

See GitHub Actions build Lint / quick-checks (4/4)

Step: "Ensure correct trailing newlines" (full log | diagnosis details | 🔁 rerun)

2021-11-03T19:05:38.0049268Z python: can't open..._launches.py': [Errno 2] No such file or directory
2021-11-03T19:05:37.9731783Z ##[group]Run set -eux
2021-11-03T19:05:37.9732437Z �[36;1mset -eux�[0m
2021-11-03T19:05:37.9733298Z �[36;1mpython torch/testing/_check_kernel_launches.py |& tee "${GITHUB_WORKSPACE}"/cuda_kernel_launch_checks.txt�[0m
2021-11-03T19:05:37.9770903Z shell: /bin/bash -e {0}
2021-11-03T19:05:37.9771359Z env:
2021-11-03T19:05:37.9771983Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.0/x64
2021-11-03T19:05:37.9772840Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.0/x64/lib
2021-11-03T19:05:37.9773473Z ##[endgroup]
2021-11-03T19:05:37.9846564Z + python torch/testing/_check_kernel_launches.py
2021-11-03T19:05:37.9850661Z + tee /home/runner/work/pytorch/pytorch/cuda_kernel_launch_checks.txt
2021-11-03T19:05:38.0049268Z python: can't open file '/home/runner/work/pytorch/pytorch/torch/testing/_check_kernel_launches.py': [Errno 2] No such file or directory
2021-11-03T19:05:38.0123654Z ##[group]Run (! git --no-pager grep -I -no $'#include <cub/' --  ./aten  ':(exclude)aten/src/ATen/cuda/cub*.cuh' || (echo "The above files have direct cub include; please include ATen/cuda/cub.cuh instead and wrap your cub calls in at::native namespace if necessary"; false))
2021-11-03T19:05:38.0125959Z �[36;1m(! git --no-pager grep -I -no $'#include <cub/' --  ./aten  ':(exclude)aten/src/ATen/cuda/cub*.cuh' || (echo "The above files have direct cub include; please include ATen/cuda/cub.cuh instead and wrap your cub calls in at::native namespace if necessary"; false))�[0m
2021-11-03T19:05:38.0165305Z shell: /bin/bash -e {0}
2021-11-03T19:05:38.0165749Z env:
2021-11-03T19:05:38.0166371Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.0/x64
2021-11-03T19:05:38.0167229Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.0/x64/lib
2021-11-03T19:05:38.0167852Z ##[endgroup]
2021-11-03T19:05:38.0527806Z ##[group]Run (! git --no-pager grep -I -no $'cudaStreamSynchronize' --  ./aten ./c10 ':(exclude)aten/src/ATen/test' ':(exclude)c10/cuda/CUDAFunctions.h' || (echo "The above files call raw cuda APIs directly; please use at::cuda wrappers instead"; false))
2021-11-03T19:05:38.0530284Z �[36;1m(! git --no-pager grep -I -no $'cudaStreamSynchronize' --  ./aten ./c10 ':(exclude)aten/src/ATen/test' ':(exclude)c10/cuda/CUDAFunctions.h' || (echo "The above files call raw cuda APIs directly; please use at::cuda wrappers instead"; false))�[0m
2021-11-03T19:05:38.0568541Z shell: /bin/bash -e {0}

1 failure not recognized by patterns:

Job Step Action
GitHub Actions Lint / clang-format Run clang-format 🔁 rerun

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

Maksim Levental and others added 8 commits September 1, 2021 04:00
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

[ghstack-poisoned]
@makslevental
Copy link
Contributor Author

@makslevental has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Maksim Levental added 3 commits September 6, 2021 20:41
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Maksim Levental added 3 commits September 12, 2021 17:32
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
This was referenced Sep 20, 2021
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
Copy link
Contributor

@Krovatkin Krovatkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few qs. I seem to be struggling to fully understand this PR.

makeAllocation(ulvr, size, ordered_allocations, findOffsetWithSmallestGap);
}

auto cmp = liveRangeStartCmp();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to double check, cmp returns a boolean and not -1, 0, 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krovatkin that's correct

[&cmp](auto m1, auto m2) { return cmp(m1.ulvr, m2.ulvr); });
return ordered_allocations;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we seem to be missing greedyBySizeWithSmallestGap or is it somehow covered the other two?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krovatkin hmm not sure what version you were looking at but it's in this commit

image

[&cmp](auto& p1, auto& p2) {
auto len1 = p1.first.lvr.end - p1.first.lvr.begin;
auto len2 = p2.first.lvr.end - p2.first.lvr.begin;
return len1 == len2 ? (p1.second == p2.second ? cmp(p1.first, p2.first)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to assign .second , .first into temps with descriptive names, otherwise it's a bit hard to reason about what those are. Looks like .second is size?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmp(p1.first, p2.first) would this also be in an non-increasing order or it doesn't matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krovatkin *.first are the "unique" live ranges. we're sorting here by length and then breaking ties by size and start. it's convoluted i admit but it happens and it's very frustrating dealing with non-deterministic orderings when debugging.

std::sort(
sorted_length_then_size_live_ranges.begin(),
sorted_length_then_size_live_ranges.end(),
[&cmp](auto& p1, auto& p2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe we could encapsulate this into its own comparator.
a) you won't have to pass &cmp
b) a reader won't have to read the same code twice if they don't realize the sorting order is the same.

}

// don't simplify this to gap = a - b because you'll get buffer overflow...
if (alloc.reg.offset >= prev_offset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when would this case happen you seem to be inserting in the order of increasing offsets in makeAllocation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krovatkin good catch - it's true this doesn't make sense in this function (findFirstOffset) but it has since been refactored and makes more sense in context

size_t prev_offset = 0;

for (const auto& alloc : ordered_allocations) {
if (!overlapLiveRange(alloc.ulvr, unalloced_ulvr)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused here. It looks like we are skipping live ranges that don't overlap with the unallocated live range?
I was thinking we should be specifically looking for the ranges that do not overlap otherwise we can't reuse that storage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krovatkin this is looking for live ranges that overlap in time and then finding the smallest gap between these "live" live ranges. this should really be done using something like an interval tree (and an overlap lookup). I'm looking into this but one issue is interval trees don't deal well with duplicated endpoints. In the single-threaded case that's not an issue but in the concurrency case it might pop up.

Greedy by size (a heuristic that allocates largest tensors first) based on [this paper]( https://arxiv.org/pdf/2001.03288.pdf). It's factored the way it is for the purposes of making subsequent strategies simpler to implement.

make greedy deterministic

Differential Revision: [D30769096](https://our.internmc.facebook.com/intern/diff/D30769096)

[ghstack-poisoned]
@pytorch-probot
Copy link

pytorch-probot bot commented Nov 3, 2021

CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/pytorch/pytorch/blob/fd9cd4a8a73e3c9109ce25bb423318960e2967eb/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/xla ✅ triggered
linux-vulkan-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-dynamic ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3.6-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers ✅ triggered
linux-xenial-py3.6-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx ✅ triggered
linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
docker-builds ciflow/all 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow 🚫 skipped
linux-xenial-py3-clang5-mobile-code-analysis ciflow/all, ciflow/linux, ciflow/mobile 🚫 skipped
parallelnative-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped

You can add a comment to the PR and tag @pytorchbot with the following commands:
# ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun

# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow

For more information, please take a look at the CI Flow Wiki.

@makslevental
Copy link
Contributor Author

@makslevental has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

Hi @makslevental!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@github-actions
Copy link

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the Stale label May 21, 2022
@github-actions github-actions bot closed this Jun 20, 2022
@facebook-github-bot facebook-github-bot deleted the gh/makslevental/30/head branch July 21, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed oncall: jit Add this issue/PR to JIT oncall triage queue open source Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants