Skip to content

Commit

Permalink
[android] turn on USE_VULKAN for android builds by default (#51291)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #51291

Turning on USE_VULKAN for android builds
Remove standalone android vulkan build

Testing all ci jobs (for master): #51292

Test Plan: Imported from OSS

Reviewed By: AshkanAliabadi

Differential Revision: D26141891

Pulled By: IvanKobzarev

fbshipit-source-id: e8e1a4ab612c0786ce09217ab9370fd75a71eb00
  • Loading branch information
IvanKobzarev authored and facebook-github-bot committed Jan 29, 2021
1 parent ebd2a82 commit dbfaf96
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
1 change: 0 additions & 1 deletion .circleci/cimodel/data/simple/android_definitions.py
Expand Up @@ -79,7 +79,6 @@ def gen_tree(self):
AndroidJob(["x86_64"], "pytorch_linux_build"),
AndroidJob(["arm", "v7a"], "pytorch_linux_build"),
AndroidJob(["arm", "v8a"], "pytorch_linux_build"),
AndroidJob(["vulkan", "x86_32"], "pytorch_linux_build", is_master_only=False),
AndroidGradleJob(
"pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-build-x86_32",
"pytorch_android_gradle_build-x86_32",
Expand Down
6 changes: 0 additions & 6 deletions .circleci/config.yml
Expand Up @@ -7103,12 +7103,6 @@ workflows:
name: pytorch_linux_xenial_py3_clang5_android_ndk_r19c_arm_v8a_build
requires:
- docker-pytorch-linux-xenial-py3-clang5-android-ndk-r19c
- pytorch_linux_build:
build_environment: "pytorch-linux-xenial-py3-clang5-android-ndk-r19c-vulkan-x86_32-build"
docker_image: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-py3-clang5-android-ndk-r19c"
name: pytorch_linux_xenial_py3_clang5_android_ndk_r19c_vulkan_x86_32_build
requires:
- docker-pytorch-linux-xenial-py3-clang5-android-ndk-r19c
- pytorch_android_gradle_build-x86_32:
filters:
branches:
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Expand Up @@ -219,7 +219,13 @@ option(USE_TENSORRT "Using Nvidia TensorRT library" OFF)
cmake_dependent_option(
USE_VALGRIND "Use Valgrind. Only available on Linux." ON
"LINUX" OFF)
option(USE_VULKAN "Use Vulkan GPU backend" OFF)

if(NOT DEFINED USE_VULKAN)
cmake_dependent_option(
USE_VULKAN "Use Vulkan GPU backend" ON
"ANDROID" OFF)
endif()

option(USE_VULKAN_FP16_INFERENCE "Vulkan - Use fp16 inference even on fp32 tensors" OFF)
option(USE_VULKAN_RELAXED_PRECISION "Vulkan - Use relaxed precision math in the kernels (mediump)" OFF)
option(USE_VULKAN_SHADERC_RUNTIME "Vulkan - Use runtime shader compilation (needs libshaderc)" OFF)
Expand Down
8 changes: 2 additions & 6 deletions android/pytorch_android/CMakeLists.txt
Expand Up @@ -17,17 +17,13 @@ endif()
if(NOT TRACE_ENABLED)
message(STATUS "TRACE_ENABLED OFF")
endif()

set(USE_VULKAN OFF)
if(DEFINED ENV{USE_VULKAN})
if($ENV{USE_VULKAN} STREQUAL "1")
message(STATUS "USE_VULKAN ON")
set(USE_VULKAN ON)
endif()
endif()

set(pytorch_android_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp)

if(ANDROID_ABI)
set(USE_VULKAN ON)
set(libtorch_include_DIR ${pytorch_android_DIR}/libtorch_include/${ANDROID_ABI})
set(BUILD_SUBDIR ${ANDROID_ABI})
elseif(BUILD_LIBTORCH_WITH_JNI)
Expand Down

0 comments on commit dbfaf96

Please sign in to comment.