Skip to content

Commit 88207c9

Browse files
author
cryoco
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into multihead-fuse-pass-support-matmul
2 parents ad667ea + 123949e commit 88207c9

File tree

146 files changed

+3321
-1324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3321
-1324
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if(WITH_MUSL)
6161
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=pessimizing-move -Wno-error=deprecated-copy")
6262
endif()
6363

64+
6465
if(WIN32)
6566
option(MSVC_STATIC_CRT "use static C Runtime library by default" ON)
6667

@@ -124,7 +125,7 @@ if(WIN32)
124125
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838")
125126

126127
foreach(flag_var CMAKE_SHARED_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_LINKER_FLAGS)
127-
string(APPEND ${flag_var} "/ignore:4049 /ignore:4217 /ignore:4006 /ignore:4221")
128+
set(${flag_var} "${${flag_var}} /ignore:4049 /ignore:4217 /ignore:4006 /ignore:4221")
128129
endforeach(flag_var)
129130

130131
if (WITH_WIN_DUMP_DBG)

cmake/external/warpctc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SET(WARPCTC_PREFIX_DIR ${THIRD_PARTY_PATH}/warpctc)
1818
SET(WARPCTC_SOURCE_DIR ${THIRD_PARTY_PATH}/warpctc/src/extern_warpctc)
1919
SET(WARPCTC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/warpctc)
2020
set(WARPCTC_REPOSITORY ${GIT_URL}/baidu-research/warp-ctc.git)
21-
set(WARPCTC_TAG 95a461eddeabd51099ef059dcfada1117eb1bfb8)
21+
set(WARPCTC_TAG cd828e5b6c3b953b82af73f7f44cddc393a20efa)
2222

2323
SET(WARPCTC_INCLUDE_DIR "${WARPCTC_INSTALL_DIR}/include"
2424
CACHE PATH "Warp-ctc Directory" FORCE)

cmake/generic.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,8 @@ function(nv_library TARGET_NAME)
492492
message(FATAL "Please specify source file or library in nv_library.")
493493
endif()
494494
endif(nv_library_SRCS)
495-
if (WIN32 AND ${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0)
496-
if(${MSVC_VERSION} LESS_EQUAL 1900)
497-
set_target_properties(${TARGET_NAME} PROPERTIES VS_USER_PROPS ${WIN_PROPS})
498-
endif()
495+
if((CUDA_VERSION GREATER 9.2) AND (CUDA_VERSION LESS 11.0) AND (MSVC_VERSION LESS 1910))
496+
set_target_properties(${TARGET_NAME} PROPERTIES VS_USER_PROPS ${WIN_PROPS})
499497
endif()
500498
endif()
501499
endfunction(nv_library)
@@ -512,7 +510,7 @@ function(nv_binary TARGET_NAME)
512510
add_dependencies(${TARGET_NAME} ${nv_binary_DEPS})
513511
common_link(${TARGET_NAME})
514512
endif()
515-
if (WIN32 AND ${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0)
513+
if((CUDA_VERSION GREATER 9.2) AND (CUDA_VERSION LESS 11.0) AND (MSVC_VERSION LESS 1910))
516514
set_target_properties(${TARGET_NAME} PROPERTIES VS_USER_PROPS ${WIN_PROPS})
517515
endif()
518516
endif()
@@ -539,7 +537,7 @@ function(nv_test TARGET_NAME)
539537
set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cpu_deterministic=true)
540538
set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true)
541539
set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
542-
if (WIN32 AND ${CMAKE_CUDA_COMPILER_VERSION} LESS 11.0)
540+
if((CUDA_VERSION GREATER 9.2) AND (CUDA_VERSION LESS 11.0) AND (MSVC_VERSION LESS 1910))
543541
set_target_properties(${TARGET_NAME} PROPERTIES VS_USER_PROPS ${WIN_PROPS})
544542
endif()
545543
endif()

cmake/init.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ if(NOT WIN32)
1818
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
1919
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
2020
else()
21+
# It has not been used now, it can specify CUDA compile flag manualy,
22+
# its use is to remvoe /Zi to reduce GPU static library size. But it's dangerous
23+
# because CUDA will update by nvidia, then error will occur.
24+
# Now, it's used in CUDA:[10.0, 10.2]
2125
set(WIN_PROPS ${CMAKE_SOURCE_DIR}/cmake/paddle_win.props)
2226
endif()
2327

cmake/paddle_win.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Warning>InheritFromHost</Warning>
1616

1717
<BaseCommandLineTemplate>-ccbin "%(VCBinDir)" -x cu [GenerateRelocatableDeviceCode] [Include] [RequiredIncludes] [InterleaveSourceInPTX] [GPUDebugInfo] [GenerateLineInfo] [Keep] [KeepDir] [MaxRegCount] [PtxAsOptionV] [TargetMachinePlatform] [NvccCompilation] [CudaRuntime] [AdditionalOptions]</BaseCommandLineTemplate>
18-
<BuildCommandLineTemplate>--use-local-env --cl-version $(CudaClVersion)</BuildCommandLineTemplate>
18+
<BuildCommandLineTemplate>--use-local-env $(CudaClVersion)</BuildCommandLineTemplate>
1919
<BuildDynamicCommandLineTemplate>[CodeGeneration]</BuildDynamicCommandLineTemplate>
2020
<CleanCommandLineTemplate>-clean</CleanCommandLineTemplate>
2121
<!-- <HostCommandLineTemplate>-Xcompiler &quot;/EHsc [Warning] /nologo [Optimization] $(CudaForceSynchronousPdbWrites) /Zi [RuntimeChecks] [Runtime] [TypeInfo]&quot;</HostCommandLineTemplate> -->

go/README_cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ output_data := value.Interface().([][]float32)
5050

5151
运行
5252
```bash
53+
go mod init github.com/paddlepaddle
5354
export LD_LIBRARY_PATH=`pwd`/paddle_c/paddle/lib:$LD_LIBRARY_PATH
5455
go run ./demo/mobilenet.go
5556
```

go/demo/mobilenet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
package main
1515

16-
import "../paddle"
16+
import "github.com/paddlepaddle/paddle"
1717
import "strings"
1818
import "io/ioutil"
1919
import "strconv"

go/paddle/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package paddle
1616

1717
// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include
18-
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c
18+
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_inference_c
1919
// #include <stdbool.h>
2020
// #include <paddle_c_api.h>
2121
import "C"

go/paddle/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package paddle
1616

1717
// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include
18-
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c
18+
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_inference_c
1919
// #include <stdbool.h>
2020
// #include <stdlib.h>
2121
// #include <paddle_c_api.h>

go/paddle/predictor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package paddle
1616

1717
// #cgo CFLAGS: -I${SRCDIR}/../paddle_c/paddle/include
18-
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_fluid_c
18+
// #cgo LDFLAGS: -L${SRCDIR}/../paddle_c/paddle/lib -lpaddle_inference_c
1919
// #include <stdbool.h>
2020
// #include "paddle_c_api.h"
2121
import "C"
@@ -88,7 +88,7 @@ func (predictor *Predictor) GetInputNames() []string {
8888
}
8989

9090
func (predictor *Predictor) GetOutputNames() []string {
91-
names := make([]string, predictor.GetInputNum())
91+
names := make([]string, predictor.GetOutputNum())
9292
for i := 0; i < len(names); i++ {
9393
names[i] = predictor.GetOutputName(i)
9494
}

0 commit comments

Comments
 (0)