Skip to content

Commit

Permalink
Optimize LayerNorm Forward (#6842)
Browse files Browse the repository at this point in the history
* layer_norm forward

* test case

* rm useless

* int count to T count

* fix

* fix T mask to int mask, refine code

* refine

* refine

* test case

* format

* fix

Co-authored-by: oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
  • Loading branch information
guo-ran and oneflow-ci-bot committed Nov 26, 2021
1 parent 6770798 commit bb62290
Show file tree
Hide file tree
Showing 5 changed files with 1,022 additions and 347 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ option(WITH_COCOAPI "Option to build with COCO API" ON)
option(BUILD_GIT_VERSION "" ON)
option(BUILD_PROFILER "" OFF)
option(OF_SOFTMAX_USE_FAST_MATH "" ON)
option(OF_LAYER_NORM_USE_FAST_MATH "" ON)
option(TREAT_WARNINGS_AS_ERRORS "" ON)
# Reference:
# https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949
Expand Down Expand Up @@ -125,6 +126,9 @@ endif()
if (OF_SOFTMAX_USE_FAST_MATH)
add_definitions(-DOF_SOFTMAX_USE_FAST_MATH)
endif()
if (OF_LAYER_NORM_USE_FAST_MATH)
add_definitions(-DOF_LAYER_NORM_USE_FAST_MATH)
endif()
if (OF_FORCE_COLORED_DIAGNOSTICS)
add_compile_options(
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>>
Expand Down
Loading

0 comments on commit bb62290

Please sign in to comment.