-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'paddle/develop' into softplus_activatio…
…n_fuse_pass
- Loading branch information
Showing
624 changed files
with
39,510 additions
and
8,135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ build_* | |
cmake-build-* | ||
paddle/fluid/operators/distributed/send_recv.proto | ||
model_test | ||
|
||
Testing | ||
tools/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Note(chenxin33): dirent.h is only exist in Linux, so get it from github when build in windows. | ||
# use dirent tag v1.23.2 on 09/05//2018 https://github.com/tronkko/dirent.git | ||
|
||
INCLUDE (ExternalProject) | ||
|
||
SET(DIRENT_PREFIX_DIR ${THIRD_PARTY_PATH}/dirent) | ||
SET(DIRENT_SOURCE_DIR ${THIRD_PARTY_PATH}/dirent/src/extern_dirent) | ||
SET(DIRENT_INCLUDE_DIR ${DIRENT_SOURCE_DIR}/include) | ||
|
||
include_directories(${DIRENT_INCLUDE_DIR}) | ||
|
||
set(DIRENT_REPOSITORY ${GIT_URL}/tronkko/dirent) | ||
set(DIRENT_TAG 1.23.2) | ||
|
||
ExternalProject_Add( | ||
extern_dirent | ||
${EXTERNAL_PROJECT_LOG_ARGS} | ||
${SHALLOW_CLONE} | ||
GIT_REPOSITORY ${DIRENT_REPOSITORY} | ||
GIT_TAG ${DIRENT_TAG} | ||
PREFIX ${DIRENT_PREFIX_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
TEST_COMMAND "" | ||
) | ||
|
||
add_library(dirent INTERFACE) | ||
|
||
add_dependencies(dirent extern_dirent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
add_subdirectory(scripts) | ||
add_subdirectory(testing) | ||
set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests CACHE INTERNAL "python tests directory") | ||
add_subdirectory(pten) | ||
add_subdirectory(fluid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
cc_library(afs_wrapper SRCS afs_warpper.cc DEPS fs ps_framework_proto) | ||
|
||
#set_property(GLOBAL PROPERTY COMMON_DEPS afs_warpper) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "paddle/fluid/distributed/common/afs_warpper.h" | ||
#include "paddle/fluid/framework/io/fs.h" | ||
|
||
namespace paddle { | ||
namespace distributed { | ||
// AfsClient impl | ||
int AfsClient::initialize(const FsClientParameter& fs_client_param) { | ||
// temporarily implemented with hdfs-client | ||
return initialize(fs_client_param.hadoop_bin(), fs_client_param.uri(), | ||
fs_client_param.user(), fs_client_param.passwd(), | ||
fs_client_param.buffer_size()); | ||
} | ||
int AfsClient::initialize(const std::string& hadoop_bin, const std::string& uri, | ||
const std::string& user, const std::string& passwd, | ||
int buffer_size_param) { | ||
return initialize(hadoop_bin, uri, paddle::string::format_string( | ||
"%s,%s", user.c_str(), passwd.c_str()), | ||
buffer_size_param); | ||
} | ||
int AfsClient::initialize(const std::string& hadoop_bin, const std::string& uri, | ||
const std::string& ugi, int buffer_size_param) { | ||
// temporarily implemented with hdfs-client | ||
size_t buffer_size = 1L << 25; // 32MB | ||
if (buffer_size_param > static_cast<int>(buffer_size)) { | ||
buffer_size = buffer_size_param; | ||
} | ||
paddle::framework::hdfs_set_buffer_size(buffer_size); | ||
paddle::framework::hdfs_set_command(paddle::string::format_string( | ||
"2>>./hdfs_err.log %s fs -Dfs.default.name=%s -Dhadoop.job.ugi=%s " | ||
"-Ddfs.client.block.write.retries=15 -Ddfs.rpc.timeout=300000", | ||
hadoop_bin.c_str(), uri.c_str(), ugi.c_str())); | ||
return 0; | ||
} | ||
|
||
// open file in 'w' or 'r' | ||
std::shared_ptr<FsReadChannel> AfsClient::open_r(const FsChannelConfig& config, | ||
uint32_t buffer_size, | ||
int* err_no) { | ||
std::shared_ptr<FsReadChannel> channel = | ||
std::make_shared<FsReadChannel>(buffer_size); | ||
std::shared_ptr<FILE> fp = | ||
paddle::framework::fs_open_read(config.path, err_no, config.deconverter); | ||
channel->open(fp, config); | ||
return channel; | ||
} | ||
std::shared_ptr<FsWriteChannel> AfsClient::open_w(const FsChannelConfig& config, | ||
uint32_t buffer_size, | ||
int* err_no) { | ||
std::shared_ptr<FsWriteChannel> channel = | ||
std::make_shared<FsWriteChannel>(buffer_size); | ||
std::shared_ptr<FILE> fp = | ||
paddle::framework::fs_open_write(config.path, err_no, config.converter); | ||
channel->open(fp, config); | ||
return channel; | ||
} | ||
|
||
// remove file in path, path maybe a reg, such as 'part-000-*' | ||
void AfsClient::remove(const std::string& path) { | ||
return paddle::framework::fs_remove(path); | ||
} | ||
void AfsClient::remove_dir(const std::string& dir) { | ||
return paddle::framework::fs_remove(dir); | ||
} | ||
|
||
// list files in path, path maybe a dir with reg | ||
std::vector<std::string> AfsClient::list(const std::string& path) { | ||
return paddle::framework::fs_list(path); | ||
} | ||
|
||
// exist or not | ||
bool AfsClient::exist(const std::string& dir) { | ||
return paddle::framework::fs_exists(dir); | ||
} | ||
} // namespace distributed | ||
} // namespace paddle |
Oops, something went wrong.
3e300fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉