mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[CUDNN] Remove defunct cuDNN V8 API build flag (#120006)
The flag basically does nothing following #95722 Let's see if the quantization tests break CC @malfet @atalmanagement Pull Request resolved: https://github.com/pytorch/pytorch/pull/120006 Approved by: https://github.com/malfet
This commit is contained in:
@ -71,7 +71,6 @@ function(caffe2_print_configuration_summary)
|
|||||||
message(STATUS " Split CUDA : ${BUILD_SPLIT_CUDA}")
|
message(STATUS " Split CUDA : ${BUILD_SPLIT_CUDA}")
|
||||||
message(STATUS " CUDA static link : ${CAFFE2_STATIC_LINK_CUDA}")
|
message(STATUS " CUDA static link : ${CAFFE2_STATIC_LINK_CUDA}")
|
||||||
message(STATUS " USE_CUDNN : ${USE_CUDNN}")
|
message(STATUS " USE_CUDNN : ${USE_CUDNN}")
|
||||||
message(STATUS " USE_EXPERIMENTAL_CUDNN_V8_API: ${USE_EXPERIMENTAL_CUDNN_V8_API}")
|
|
||||||
message(STATUS " USE_CUSPARSELT : ${USE_CUSPARSELT}")
|
message(STATUS " USE_CUSPARSELT : ${USE_CUSPARSELT}")
|
||||||
message(STATUS " CUDA version : ${CUDA_VERSION}")
|
message(STATUS " CUDA version : ${CUDA_VERSION}")
|
||||||
message(STATUS " USE_FLASH_ATTENTION : ${USE_FLASH_ATTENTION}")
|
message(STATUS " USE_FLASH_ATTENTION : ${USE_FLASH_ATTENTION}")
|
||||||
|
|||||||
1
defs.bzl
1
defs.bzl
@ -33,7 +33,6 @@ default_compiler_flags = [
|
|||||||
"-DTH_INDEX_BASE=0",
|
"-DTH_INDEX_BASE=0",
|
||||||
"-DMAGMA_V2",
|
"-DMAGMA_V2",
|
||||||
"-DNO_CUDNN_DESTROY_HANDLE",
|
"-DNO_CUDNN_DESTROY_HANDLE",
|
||||||
"-DUSE_EXPERIMENTAL_CUDNN_V8_API", # enable cudnn v8 api
|
|
||||||
"-DUSE_FBGEMM",
|
"-DUSE_FBGEMM",
|
||||||
"-DUSE_PYTORCH_QNNPACK",
|
"-DUSE_PYTORCH_QNNPACK",
|
||||||
# The dynamically loaded NVRTC trick doesn't work in fbcode,
|
# The dynamically loaded NVRTC trick doesn't work in fbcode,
|
||||||
|
|||||||
@ -21,6 +21,7 @@ from hypothesis import strategies as st
|
|||||||
import torch.testing._internal.hypothesis_utils as hu
|
import torch.testing._internal.hypothesis_utils as hu
|
||||||
hu.assert_deadline_disabled()
|
hu.assert_deadline_disabled()
|
||||||
|
|
||||||
|
from torch.testing._internal.common_cuda import SM80OrLater
|
||||||
from torch.testing._internal.common_utils import TestCase
|
from torch.testing._internal.common_utils import TestCase
|
||||||
from torch.testing._internal.common_utils import IS_PPC, TEST_WITH_UBSAN, IS_MACOS, BUILD_WITH_CAFFE2, IS_SANDCASTLE
|
from torch.testing._internal.common_utils import IS_PPC, TEST_WITH_UBSAN, IS_MACOS, BUILD_WITH_CAFFE2, IS_SANDCASTLE
|
||||||
from torch.testing._internal.common_quantization import skipIfNoFBGEMM, skipIfNoQNNPACK, skipIfNoONEDNN
|
from torch.testing._internal.common_quantization import skipIfNoFBGEMM, skipIfNoQNNPACK, skipIfNoONEDNN
|
||||||
@ -31,10 +32,12 @@ from torch.testing._internal.common_quantized import (
|
|||||||
qengine_is_onednn,
|
qengine_is_onednn,
|
||||||
)
|
)
|
||||||
from torch.ao.quantization import PerChannelMinMaxObserver
|
from torch.ao.quantization import PerChannelMinMaxObserver
|
||||||
from torch.testing._internal.common_cuda import TEST_CUDNN, TEST_CUDA
|
from torch.testing._internal.common_cuda import TEST_CUDNN, TEST_CUDNN_VERSION, TEST_CUDA
|
||||||
from torch.testing._internal.optests import opcheck
|
from torch.testing._internal.optests import opcheck
|
||||||
import torch.backends.xnnpack
|
import torch.backends.xnnpack
|
||||||
|
|
||||||
|
from torch.utils.cpp_extension import ROCM_HOME
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
np_dtype = {
|
np_dtype = {
|
||||||
@ -43,6 +46,8 @@ np_dtype = {
|
|||||||
torch.qint32 : np.int32
|
torch.qint32 : np.int32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_ROCM = TEST_CUDA and torch.version.hip is not None and ROCM_HOME is not None
|
||||||
|
|
||||||
class PointwisePostOp(NamedTuple):
|
class PointwisePostOp(NamedTuple):
|
||||||
binary_attr : str = "none"
|
binary_attr : str = "none"
|
||||||
alpha : float = 1.0
|
alpha : float = 1.0
|
||||||
@ -905,9 +910,8 @@ class TestQuantizedOps(TestCase):
|
|||||||
"""Tests the correctness of the cudnn add and add_relu op
|
"""Tests the correctness of the cudnn add and add_relu op
|
||||||
(Similar to test_qadd_relu_different_qparams, will probably merge in the future)"""
|
(Similar to test_qadd_relu_different_qparams, will probably merge in the future)"""
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the test_qadd_relu_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qadd_relu_cudnn(self):
|
def test_qadd_relu_cudnn(self):
|
||||||
dtype = torch.qint8
|
dtype = torch.qint8
|
||||||
add_relu = torch.ops.quantized.add_relu
|
add_relu = torch.ops.quantized.add_relu
|
||||||
@ -940,9 +944,8 @@ class TestQuantizedOps(TestCase):
|
|||||||
|
|
||||||
"""Tests the correctness of the cudnn add and add_relu op for nhwc format"""
|
"""Tests the correctness of the cudnn add and add_relu op for nhwc format"""
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the test_qadd_relu_cudnn_nhwc op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qadd_relu_cudnn_nhwc(self):
|
def test_qadd_relu_cudnn_nhwc(self):
|
||||||
dtype = torch.qint8
|
dtype = torch.qint8
|
||||||
add_relu = torch.ops.quantized.add_relu
|
add_relu = torch.ops.quantized.add_relu
|
||||||
@ -1379,7 +1382,7 @@ class TestQuantizedOps(TestCase):
|
|||||||
self.assertEqual(a_ref, a_hat.dequantize(),
|
self.assertEqual(a_ref, a_hat.dequantize(),
|
||||||
msg="ops.quantized.max_pool1d results are off")
|
msg="ops.quantized.max_pool1d results are off")
|
||||||
|
|
||||||
# TODO: merge this test with test_max_pool2d when USE_EXPERIMENTAL_CUDNN_V8_API flag is enabled in CI
|
# TODO: merge this test with test_max_pool2d
|
||||||
"""Tests 2D cudnn max pool operation on quantized tensors."""
|
"""Tests 2D cudnn max pool operation on quantized tensors."""
|
||||||
@given(X=hu.tensor(shapes=hu.array_shapes(min_dims=3, max_dims=4,
|
@given(X=hu.tensor(shapes=hu.array_shapes(min_dims=3, max_dims=4,
|
||||||
min_side=1, max_side=10),
|
min_side=1, max_side=10),
|
||||||
@ -1394,9 +1397,8 @@ class TestQuantizedOps(TestCase):
|
|||||||
padding=st.integers(0, 2),
|
padding=st.integers(0, 2),
|
||||||
ceil_mode=st.booleans())
|
ceil_mode=st.booleans())
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qconv2d_cudnn op is bulid "
|
@unittest.skipIf(TEST_CUDNN_VERSION <= 90100, "cuDNN maxpool2d mishandles -128 before v90100")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_max_pool2d_cudnn(self, X, kernel, stride, dilation, padding, ceil_mode):
|
def test_max_pool2d_cudnn(self, X, kernel, stride, dilation, padding, ceil_mode):
|
||||||
X, (scale, zero_point, torch_type) = X
|
X, (scale, zero_point, torch_type) = X
|
||||||
assume(kernel // 2 >= padding) # Kernel cannot be overhanging!
|
assume(kernel // 2 >= padding) # Kernel cannot be overhanging!
|
||||||
@ -4050,9 +4052,8 @@ class TestQuantizedLinear(TestCase):
|
|||||||
use_channelwise=st.sampled_from([False])) # channelwise currently not supported for qlinear cudnn
|
use_channelwise=st.sampled_from([False])) # channelwise currently not supported for qlinear cudnn
|
||||||
@skipIfNoFBGEMM
|
@skipIfNoFBGEMM
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qlinear_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
# TODO: check with yang regarding CUDNN flags
|
# TODO: check with yang regarding CUDNN flags
|
||||||
def test_qlinear_cudnn(self, batch_size, input_channels, output_channels, use_bias,
|
def test_qlinear_cudnn(self, batch_size, input_channels, output_channels, use_bias,
|
||||||
use_relu, use_multi_dim_input, use_channelwise):
|
use_relu, use_multi_dim_input, use_channelwise):
|
||||||
@ -5427,9 +5428,8 @@ class TestQuantizedConv(TestCase):
|
|||||||
use_channelwise=st.sampled_from([False]))
|
use_channelwise=st.sampled_from([False]))
|
||||||
@skipIfNoFBGEMM
|
@skipIfNoFBGEMM
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qconv2d_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qconv2d_cudnn(
|
def test_qconv2d_cudnn(
|
||||||
self,
|
self,
|
||||||
batch_size,
|
batch_size,
|
||||||
@ -5510,9 +5510,8 @@ class TestQuantizedConv(TestCase):
|
|||||||
use_channelwise=st.sampled_from([False]))
|
use_channelwise=st.sampled_from([False]))
|
||||||
@skipIfNoFBGEMM
|
@skipIfNoFBGEMM
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qconv2d_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qconv2d_relu_cudnn(
|
def test_qconv2d_relu_cudnn(
|
||||||
self,
|
self,
|
||||||
batch_size,
|
batch_size,
|
||||||
@ -6245,9 +6244,8 @@ class TestQuantizedConv(TestCase):
|
|||||||
use_channelwise=st.sampled_from([False]))
|
use_channelwise=st.sampled_from([False]))
|
||||||
@skipIfNoFBGEMM
|
@skipIfNoFBGEMM
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qconv1d_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qconv1d_cudnn(
|
def test_qconv1d_cudnn(
|
||||||
self,
|
self,
|
||||||
batch_size,
|
batch_size,
|
||||||
@ -6319,9 +6317,8 @@ class TestQuantizedConv(TestCase):
|
|||||||
use_channelwise=st.sampled_from([False]))
|
use_channelwise=st.sampled_from([False]))
|
||||||
@skipIfNoFBGEMM
|
@skipIfNoFBGEMM
|
||||||
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
@unittest.skipIf(not TEST_CUDNN, "cudnn is not enabled.")
|
||||||
@unittest.skip("Local only - currently the qconv1d_cudnn op is bulid "
|
@unittest.skipIf(not SM80OrLater, "requires sm80 or later.")
|
||||||
"with USE_EXPERIMENTAL_CUDNN_V8_API, we can enable the test "
|
@unittest.skipIf(TEST_ROCM, "not supported on rocm.")
|
||||||
"after it is built by default")
|
|
||||||
def test_qconv1d_relu_cudnn(
|
def test_qconv1d_relu_cudnn(
|
||||||
self,
|
self,
|
||||||
batch_size,
|
batch_size,
|
||||||
|
|||||||
Reference in New Issue
Block a user