Skip to content

Commit

Permalink
Disable AVX512 CPU dispatch by default (#80253) (#80356)
Browse files Browse the repository at this point in the history
As it can be slower, see #80252
Update trunk test matrix to test AVX512 config in `nogpu_AVX512` flavor.
Kill `nogpu_noAVX` as AVX support were replaced with AVX512 when #61903 were landed
Pull Request resolved: #80253
Approved by: https://github.com/ngimel

(cherry picked from commit 1481353)
  • Loading branch information
malfet committed Jun 27, 2022
1 parent bcfb424 commit 67ece03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trunk.yml
Expand Up @@ -63,7 +63,7 @@ jobs:
{ config: "default", shard: 1, num_shards: 2, runner: "linux.4xlarge.nvidia.gpu" },
{ config: "default", shard: 2, num_shards: 2, runner: "linux.4xlarge.nvidia.gpu" },
{ config: "slow", shard: 1, num_shards: 1, runner: "linux.4xlarge.nvidia.gpu" },
{ config: "nogpu_NO_AVX", shard: 1, num_shards: 1, runner: "linux.2xlarge" },
{ config: "nogpu_AVX512", shard: 1, num_shards: 1, runner: "linux.2xlarge" },
{ config: "nogpu_NO_AVX2", shard: 1, num_shards: 1, runner: "linux.2xlarge" },
{ config: "jit_legacy", shard: 1, num_shards: 1, runner: "linux.4xlarge.nvidia.gpu" },
{ config: "distributed", shard: 1, num_shards: 2, runner: "linux.8xlarge.nvidia.gpu" },
Expand Down
6 changes: 2 additions & 4 deletions .jenkins/pytorch/test.sh
Expand Up @@ -152,11 +152,9 @@ if [[ "$BUILD_ENVIRONMENT" == *asan* ]]; then
(cd test && ! get_exit_code python -c "import torch; torch._C._crash_if_aten_asan(3)")
fi

if [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX-* || $TEST_CONFIG == 'nogpu_NO_AVX' ]]; then
if [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX2-* || $TEST_CONFIG == 'nogpu_NO_AVX2' ]]; then
export ATEN_CPU_CAPABILITY=default
elif [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX2-* || $TEST_CONFIG == 'nogpu_NO_AVX2' ]]; then
export ATEN_CPU_CAPABILITY=default
elif [[ "${BUILD_ENVIRONMENT}" == *-NO_AVX512-* || $TEST_CONFIG == 'nogpu_NO_AVX512' ]]; then
elif [[ "${BUILD_ENVIRONMENT}" == *-AVX512-* || $TEST_CONFIG == 'nogpu_AVX512' ]]; then
export ATEN_CPU_CAPABILITY=avx2
fi

Expand Down
4 changes: 3 additions & 1 deletion aten/src/ATen/native/DispatchStub.cpp
Expand Up @@ -39,7 +39,9 @@ static CPUCapability compute_cpu_capability() {

#if !defined(__powerpc__) && !defined(__s390x__)
if (cpuinfo_initialize()) {
#ifdef HAVE_AVX512_CPU_DEFINITION
// AVX512 can be slower then AVX2, so lets keep it as opt-in
// see https://github.com/pytorch/pytorch/issues/80252
#if defined(HAVE_AVX512_CPU_DEFINITION) && false
// GCC supports some AVX512 intrinsics such as _mm512_set_epi16 only in
// versions 9 & beyond. So, we want to ensure that only releases built with
// supported compilers on supported hardware return CPU Capability AVX512,
Expand Down

0 comments on commit 67ece03

Please sign in to comment.