Skip to content

Commit

Permalink
Merge branch 'main' into guangyey/shuffle_down
Browse files Browse the repository at this point in the history
  • Loading branch information
xytintel authored Jul 30, 2024
2 parents 3169c9c + 8a821bf commit e5ee04f
Show file tree
Hide file tree
Showing 59 changed files with 3,515 additions and 365 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ tacotron2,fail_to_run,fail_to_run,fail_to_run,fail_to_run,fail_to_run
timm_efficientdet,model_fail_to_load,model_fail_to_load,model_fail_to_load,model_fail_to_load,model_fail_to_load
timm_efficientnet,pass,pass,pass,pass,pass
timm_nfnet,pass,pass,pass,pass,pass
timm_regnet,pass,pass,pass,pass,pass
timm_regnet,pass,fail_accuracy,pass,pass,pass
timm_resnest,pass,pass,pass,pass,pass
timm_vision_transformer,pass,pass,pass,pass,pass
timm_vision_transformer_large,pass_due_to_skip,pass_due_to_skip,pass_due_to_skip,pass_due_to_skip,pass_due_to_skip
Expand Down
59 changes: 49 additions & 10 deletions .github/workflows/nightly_ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: Nightly-OnDemand Tests

on:
schedule:
# GMT+8 21:00 every day
- cron: '0 13 * * *'
# GMT+8 21:00 every workday
- cron: '0 13 * * 0-4'
# GMT+8 0:00 Saturday
- cron: '0 16 * * 5'
workflow_dispatch:
inputs:
pytorch:
Expand Down Expand Up @@ -78,7 +80,7 @@ jobs:
runs-on: pvc_e2e
# Don't run on forked repos
if: github.repository_owner == 'intel'
timeout-minutes: 900
timeout-minutes: 3600
env:
pytorch: ${{ github.event_name == 'schedule' && 'main' || inputs.pytorch }}
keep_torch_xpu_ops: ${{ github.event_name == 'schedule' && 'false' || inputs.keep_torch_xpu_ops }}
Expand Down Expand Up @@ -174,8 +176,10 @@ jobs:
echo "$GITHUB_ENV"
rm -rf ../pytorch/inductor_log
rm -rf /tmp/torchinductor_*
# Nihglty launch
- name: Nightly Huggingface FP32/BF16/FP16 Inference & Training Accuracy Test
if: github.event_name == 'schedule'
if: github.event_name == 'schedule' && github.event.schedule == '0 13 * * 0-4'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: huggingface
Expand All @@ -185,7 +189,7 @@ jobs:
scenario: accuracy
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Nightly Torchbench BF16 Training Accuracy Test
if: github.event_name == 'schedule'
if: github.event_name == 'schedule' && github.event.schedule == '0 13 * * 0-4'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: torchbench
Expand All @@ -195,7 +199,7 @@ jobs:
env_prepare: true
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Nightly Timm_models FP16 Training Accuracy Test
if: github.event_name == 'schedule'
if: github.event_name == 'schedule' && github.event.schedule == '0 13 * * 0-4'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: timm_models
Expand All @@ -204,6 +208,38 @@ jobs:
scenario: accuracy
env_prepare: true
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
# Weekly launch
- name: Weekly Huggingface Full Test
if: github.event_name == 'schedule' && github.event.schedule == '0 16 * * 5'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: huggingface
env_prepare: true
dt: float32,bfloat16,float16,amp_bf16,amp_fp16
mode: inference,training
scenario: accuracy,performance
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Weekly Torchbench Full Test
if: github.event_name == 'schedule' && github.event.schedule == '0 16 * * 5'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: torchbench
env_prepare: true
dt: float32,bfloat16,float16,amp_bf16,amp_fp16
mode: inference,training
scenario: accuracy,performance
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Weekly Timm_models Full Test
if: github.event_name == 'schedule' && github.event.schedule == '0 16 * * 5'
uses: ./.github/actions/inductor-xpu-e2e-test
with:
suite: timm_models
env_prepare: true
dt: float32,bfloat16,float16,amp_bf16,amp_fp16
mode: inference,training
scenario: accuracy,performance
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
# On-demand launch
- name: OnDemand Test (${{ inputs.suite }} ${{ inputs.dt }} ${{ inputs.mode }} ${{ inputs.scenario }})
if: github.event_name != 'schedule'
uses: ./.github/actions/inductor-xpu-e2e-test
Expand All @@ -216,7 +252,7 @@ jobs:
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Summarize archieve files
id: summary
if: always()
if: ${{ ! cancelled() }}
run: |
rm -rf ${{ github.workspace }}/upload_files
cp -r ${{ github.workspace }}/../pytorch/inductor_log ${{ github.workspace }}/upload_files
Expand All @@ -237,14 +273,14 @@ jobs:
exit 1
fi
- name: Upload Inductor XPU E2E Data
if: always()
if: ${{ ! cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Inductor-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }}
path: ${{ github.workspace }}/upload_files

Tests-Failure-And-Report:
if: always()
if: ${{ ! cancelled() }}
runs-on: pvc_e2e
permissions:
issues: write
Expand Down Expand Up @@ -288,6 +324,9 @@ jobs:
test_type="On-demand"
test_issue_id=426
cc_comment="CC @${GITHUB_TRIGGERING_ACTOR}"
elif [ "${{ github.event.schedule }}" == "0 16 * * 5" ];then
test_type="Weekly"
test_issue_id=432
else
test_type="Nightly"
test_issue_id=432
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
env_prepare: true
hf_token: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
- name: Summarize archieve files
if: always()
if: ${{ ! cancelled() }}
run: |
rm -rf ${{ github.workspace }}/upload_files
cp -r ${{ github.workspace }}/../pytorch/inductor_log ${{ github.workspace }}/upload_files
Expand All @@ -137,7 +137,7 @@ jobs:
exit 1
fi
- name: Upload Inductor XPU E2E Data
if: always()
if: ${{ ! cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Inductor-XPU-E2E-Data-${{ github.event.pull_request.number || github.sha }}
Expand Down
6 changes: 3 additions & 3 deletions cmake/BuildFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -fno-approx-func)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -Wno-absolute-value)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -no-ftz)
# Equivalent to build option -fpreview-breaking-changes for SYCL compiler.
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -D__INTEL_PREVIEW_BREAKING_CHANGES)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -D_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI})
endif()
# TODO: Align with PyTorch and switch to ABI=0 eventually, after
# resolving incompatible implementation in SYCL runtime.
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -D_GLIBCXX_USE_CXX11_ABI=1)
set(SYCL_FLAGS ${SYCL_FLAGS} ${SYCL_KERNEL_OPTIONS})

set(TORCH_XPU_OPS_FLAGS ${SYCL_HOST_FLAGS})
Expand Down
5 changes: 2 additions & 3 deletions cmake/Modules/FindSYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ macro(SYCL_LINK_DEVICE_OBJECTS output_file sycl_target)
OUTPUT ${output_file}
DEPENDS ${object_files}
COMMAND ${SYCL_EXECUTABLE}
-fsycl
${SYCL_device_link_flags}
-fsycl-link ${object_files}
-Xs "\"${SYCL_OFFLINE_COMPILER_FLAGS}\""
Expand Down Expand Up @@ -471,7 +470,7 @@ macro(SYCL_ADD_LIBRARY sycl_target)
target_link_libraries(
${sycl_target}
${SYCL_LINK_LIBRARIES_KEYWORD}
${SYCL_LIBRARIES})
${SYCL_LIBRARY})

set_target_properties(${sycl_target}
PROPERTIES
Expand Down Expand Up @@ -530,7 +529,7 @@ macro(SYCL_ADD_EXECUTABLE sycl_target)
target_link_libraries(
${sycl_target}
${SYCL_LINK_LIBRARIES_KEYWORD}
${SYCL_LIBRARIES})
${SYCL_LIBRARY})

set_target_properties(${sycl_target}
PROPERTIES
Expand Down
73 changes: 18 additions & 55 deletions cmake/Modules/FindSYCLToolkit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ This will define the following variables:
#]=======================================================================]

set(SYCLTOOLKIT_FOUND False)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${TORCH_ROOT}/cmake/Modules/FindSYCLToolkit.cmake)

set(SYCL_ROOT "")
if(DEFINED ENV{SYCL_ROOT})
set(SYCL_ROOT $ENV{SYCL_ROOT})
elseif(DEFINED ENV{CMPLR_ROOT})
set(SYCL_ROOT $ENV{CMPLR_ROOT})
if(NOT SYCL_FOUND)
set(SYCLTOOLKIT_FOUND FALSE)
return()
endif()

if(SYCLTOOLKIT_FOUND)
return()
endif()
set(SYCLTOOLKIT_FOUND TRUE)

include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)

if(WIN32)
set(SYCL_EXECUTABLE_NAME icx)
else()
Expand Down Expand Up @@ -71,43 +75,6 @@ if(nocmplr)
set(SYCL_NOT_FOUND_MESSAGE "${SYCL_REASON_FAILURE}")
endif()

find_file(
SYCL_INCLUDE_DIR
NAMES include
HINTS ${SYCL_ROOT}
NO_DEFAULT_PATH
)

find_file(
SYCL_INCLUDE_SYCL_DIR
NAMES sycl
HINTS ${SYCL_ROOT}/include
NO_DEFAULT_PATH
)

list(APPEND SYCL_INCLUDE_DIR ${SYCL_INCLUDE_SYCL_DIR})

find_file(
SYCL_LIBRARY_DIR
NAMES lib lib64
HINTS ${SYCL_ROOT}
NO_DEFAULT_PATH
)

find_library(
SYCL_LIBRARY
NAMES sycl
HINTS ${SYCL_LIBRARY_DIR}
NO_DEFAULT_PATH
)

if((NOT SYCL_INCLUDE_DIR) OR (NOT SYCL_LIBRARY_DIR) OR (NOT SYCL_LIBRARY))
set(SYCLTOOLKIT_FOUND False)
set(SYCL_REASON_FAILURE "SYCL sdk is incomplete!!")
set(SYCL_NOT_FOUND_MESSAGE "${SYCL_REASON_FAILURE}")
return()
endif()

# Function to write a test case to verify SYCL features.

function(SYCL_CMPLR_TEST_WRITE src)
Expand Down Expand Up @@ -202,6 +169,13 @@ set(SYCL_FLAGS "")
set(SYCL_LINK_FLAGS "")
list(APPEND SYCL_FLAGS "-fsycl")
list(APPEND SYCL_LINK_FLAGS "-fsycl")
if(LINUX)
string(REGEX MATCH "libsycl-preview.so" is_abi_neutral ${SYCL_LIBRARY})
if(is_abi_neutral)
list(APPEND SYCL_FLAGS "-fpreview-breaking-changes")
list(APPEND SYCL_LINK_FLAGS "-fpreview-breaking-changes")
endif()
endif()

set(SYCL_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SYCL_FLAGS}")

Expand Down Expand Up @@ -249,14 +223,3 @@ endif()

message(DEBUG "The SYCL compiler is ${SYCL_COMPILER}")
message(DEBUG "The SYCL Flags are ${SYCL_FLAGS}")

# Avoid module variables conflict due to calling find_package recursively
# e.g. find_package -> add_subdirectory(entering in a sub-project) -> find_package
# find_package_handle_standard_args(
# SYCLToolkit
# FOUND_VAR SYCLTOOLKIT_FOUND
# REQUIRED_VARS SYCL_INCLUDE_DIR SYCL_LIBRARY_DIR SYCL_LIBRARY SYCL_FLAGS
# VERSION_VAR SYCL_LANGUAGE_VERSION
# REASON_FAILURE_MESSAGE "${SYCL_REASON_FAILURE}")
set(SYCLTOOLKIT_FOUND True)

18 changes: 0 additions & 18 deletions cmake/SYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@ if(NOT SYCL_VERSION)
return()
endif()

find_library(SYCL_LIBRARIES sycl HINTS ${SYCL_LIBRARY_DIR})
# On Windows, currently there's no sycl.lib. Only sycl7.lib with version suffix,
# where the current version of the SYCL runtime is 7.
# Until oneAPI adds support to sycl.lib without the version suffix,
# sycl_runtime_version needs to be hardcoded and uplifted when SYCL runtime version uplifts.
# TODO: remove this when sycl.lib is supported on Windows
if(WIN32)
set(sycl_runtime_version 7)
find_library(
SYCL_LIBRARIES
NAMES "sycl${sycl_runtime_version}"
HINTS ${SYCL_LIBRARY_DIR}
)
if(SYCL_LIBRARIES STREQUAL "SYCL_LIBRARIES-NOTFOUND")
message(FATAL_ERROR "Cannot find a SYCL library on Windows")
endif()
endif()

set(SYCL_COMPILER_VERSION)
file(READ ${SYCL_VERSION} version_contents)
string(REGEX MATCHALL "__SYCL_COMPILER_VERSION +[0-9]+" VERSION_LINE "${version_contents}")
Expand Down
2 changes: 1 addition & 1 deletion src/ATen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ATen XPU sources

file(GLOB xpu_cpp "xpu/*.cpp", "native/xpu/*.cpp", "native/sparse/*.cpp")
file(GLOB xpu_cpp "xpu/*.cpp" "native/xpu/*.cpp" "native/sparse/*.cpp")
file(GLOB xpu_sycl "native/xpu/sycl/*.cpp")

list(APPEND ATen_XPU_CPP_SRCS ${xpu_cpp})
Expand Down
Loading

0 comments on commit e5ee04f

Please sign in to comment.