Skip to content

Commit

Permalink
fix trt de/serialization and refine the data type selection (#38057)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlsh80826 authored Dec 13, 2021
1 parent 9598b19 commit 92ad682
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ void DeformableConvPlugin::serializeFromDevice(
PADDLE_ENFORCE_GPU_SUCCESS(
cudaMemcpy(static_cast<char*>(*hostBuffer), deviceWeights.values,
deviceWeights.count * num_bytes, cudaMemcpyDeviceToHost));
hostBuffer += deviceWeights.count * num_bytes;
*hostBuffer =
reinterpret_cast<char*>(*hostBuffer) + deviceWeights.count * num_bytes;
}

nvinfer1::Weights DeformableConvPlugin::deserializeToDevice(
const void** hostBuffer, size_t count) {
int num_bytes = (data_type_ == nvinfer1::DataType::kFLOAT ? 4 : 2);
nvinfer1::Weights w =
copyToDevice(static_cast<const char*>(*hostBuffer), count);
hostBuffer += count * num_bytes;
*hostBuffer = reinterpret_cast<const char*>(*hostBuffer) + count * num_bytes;
return w;
}

Expand Down Expand Up @@ -189,8 +190,7 @@ bool DeformableConvPlugin::supportsFormat(
nvinfer1::DataType type, nvinfer1::TensorFormat format) const TRT_NOEXCEPT {
if (with_fp16_) {
#ifdef TRT_PLUGIN_FP16_AVALIABLE
return (type == nvinfer1::DataType::kFLOAT ||
type == nvinfer1::DataType::kHALF) &&
return (type == nvinfer1::DataType::kHALF) &&
(format == nvinfer1::TensorFormat::kLINEAR);
#else
return (type == nvinfer1::DataType::kFLOAT) &&
Expand Down Expand Up @@ -615,7 +615,7 @@ const char* DeformableConvPlugin::getPluginNamespace() const TRT_NOEXCEPT {
nvinfer1::DataType DeformableConvPlugin::getOutputDataType(
int index, const nvinfer1::DataType* input_type,
int nb_inputs) const TRT_NOEXCEPT {
return data_type_;
return input_type[0];
}

bool DeformableConvPlugin::isOutputBroadcastAcrossBatch(
Expand Down

1 comment on commit 92ad682

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 92ad682 Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #1 Commit ID: 92ad682 contains failed CI.

🔹 Failed: PR-CI-Py3

Unknown Failed
2021-12-13 10:57:09 + CI_SKIP_CPP_TEST=
2021-12-13 10:57:09 + '[' ON == ON ']'
2021-12-13 10:57:09 + python3.7 /workspace/Paddle/tools/get_pr_ut.py
2021-12-13 10:57:13 Traceback (most recent call last):
2021-12-13 10:57:13 File "/workspace/Paddle/tools/get_pr_ut.py", line 402, in
2021-12-13 10:57:13 pr_checker.init()
2021-12-13 10:57:13 File "/workspace/Paddle/tools/get_pr_ut.py", line 69, in init
2021-12-13 10:57:13 if last_commit.message.find('test=allcase') != -1:
2021-12-13 10:57:13 AttributeError: 'NoneType' object has no attribute 'message'
2021-12-13 10:57:13 + EXCODE=1
2021-12-13 10:57:13 + echo 'EXCODE: 1'
2021-12-13 10:57:13 EXCODE: 1
2021-12-13 10:57:13 + echo 'ipipe_log_param_EXCODE: 1'
2021-12-13 10:57:13 ipipe_log_param_EXCODE: 1
2021-12-13 10:57:13 + [[ 1 -eq 0 ]]
2021-12-13 10:57:13 + set +x
2021-12-13 10:57:13 + exit 1
2021-12-13 10:57:13 {build code state=1}
2021-12-13 10:57:23 kill agent BUILD_CODE_FAIL

🔹 Failed: PR-CI-Coverage

Unknown Failed
2021-12-13 11:23:15 + export CI_SKIP_CPP_TEST=
2021-12-13 11:23:15 + CI_SKIP_CPP_TEST=
2021-12-13 11:23:15 + '[' ON == ON ']'
2021-12-13 11:23:15 + python3.7 /paddle/tools/get_pr_ut.py
2021-12-13 11:23:18 Traceback (most recent call last):
2021-12-13 11:23:18 File "/paddle/tools/get_pr_ut.py", line 402, in
2021-12-13 11:23:18 pr_checker.init()
2021-12-13 11:23:18 File "/paddle/tools/get_pr_ut.py", line 69, in init
2021-12-13 11:23:18 if last_commit.message.find('test=allcase') != -1:
2021-12-13 11:23:18 AttributeError: 'NoneType' object has no attribute 'message'
2021-12-13 11:23:18 + EXCODE=1
2021-12-13 11:23:18 + echo 1
2021-12-13 11:23:18 1
2021-12-13 11:23:18 + echo 'ipipe_log_param_EXCODE: 1'
2021-12-13 11:23:18 ipipe_log_param_EXCODE: 1
2021-12-13 11:23:18 + '[' 1 -ne 0 ']'
2021-12-13 11:23:18 + '[' 1 -ne 9 ']'
2021-12-13 11:23:18 + exit 1
2021-12-13 11:23:18 {build code state=1}

🔹 Failed: PR-CI-Kunlun

http_proxy_failed
2021-12-13 12:05:43 You are in 'detached HEAD' state. You can look around, make experimental
2021-12-13 12:05:43 changes and commit them, and you can discard any commits you make in this
2021-12-13 12:05:43 state without impacting any branches by performing another checkout.
2021-12-13 12:05:43 If you want to create a new branch to retain commits you create, you may
2021-12-13 12:05:43 do so (now or later) by using -b with the checkout command again. Example:
2021-12-13 12:05:43 git checkout -b
2021-12-13 12:05:43 HEAD is now at 9dcc26c... Prepare for Crypto++ 8.2 release Make ConstBytePtr return non-NULL pointer
2021-12-13 12:05:43 [ 5%] Performing patch step for 'extern_cryptopp'
2021-12-13 12:05:43 [ 5%] No update step for 'extern_cryptopp'
2021-12-13 12:05:43 Cloning into '/paddle/build/third_party/cryptopp/src/extern_cryptopp/cmake'...
2021-12-13 12:05:46 fatal: unable to access 'https://github.com/noloader/cryptopp-cmake/': Failed to connect to 172.19.57.45 port 3128: Connection timed out
2021-12-13 12:05:47 CMakeFiles/extern_cryptopp.dir/build.make:100: recipe for target 'third_party/cryptopp/src/extern_cryptopp-stamp/extern_cryptopp-patch' failed
2021-12-13 12:05:47 make[2]: *** [third_party/cryptopp/src/extern_cryptopp-stamp/extern_cryptopp-patch] Error 128
2021-12-13 12:05:47 CMakeFiles/Makefile2:5275: recipe for target 'CMakeFiles/extern_cryptopp.dir/all' failed
2021-12-13 12:05:47 make[1]: *** [CMakeFiles/extern_cryptopp.dir/all] Error 2
2021-12-13 12:05:47 make[1]: *** Waiting for unfinished jobs....
2021-12-13 12:09:56 Note: checking out '9f75c5aa851cd877fb0d93ccc31b8567a6706546'.
2021-12-13 12:09:57 You are in 'detached HEAD' state. You can look around, make experimental
2021-12-13 12:09:57 changes and commit them, and you can discard any commits you make in this
2021-12-13 12:09:57 state without impacting any branches by performing another checkout.
2021-12-13 12:09:57 If you want to create a new branch to retain commits you create, you may

Please sign in to comment.