Skip to content

Commit

Permalink
Merge pull request #26 from JiabinYang/fix_context_bug
Browse files Browse the repository at this point in the history
add topyobject for place
  • Loading branch information
JiabinYang authored Nov 19, 2021
2 parents 8886d36 + aa67cca commit 65518d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions paddle/fluid/pybind/eager_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ PyObject* eager_tensor_properties_get_shape(EagerTensorObject* self,

PyObject* eager_tensor_properties_get_place(EagerTensorObject* self,
void* closure) {
auto place = self->eagertensor.place();
auto obj = ::pybind11::cast(place);
obj.inc_ref();
return obj.ptr();
return ToPyObject(self->eagertensor.place());
}

PyObject* eager_tensor_properties_get_place_str(EagerTensorObject* self,
Expand Down
6 changes: 6 additions & 0 deletions paddle/fluid/pybind/eager_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -329,5 +329,11 @@ PyObject* ToPyObject(const std::vector<egr::EagerTensor>& value) {
return result;
}

PyObject* ToPyObject(const platform::Place& value) {
auto obj = ::pybind11::cast(value);
obj.inc_ref();
return obj.ptr();
}

} // namespace pybind
} // namespace paddle
1 change: 1 addition & 0 deletions paddle/fluid/pybind/eager_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PyObject* ToPyObject(const std::vector<int64_t>& value);
PyObject* ToPyObject(const std::vector<float>& value);
PyObject* ToPyObject(const std::vector<double>& value);
PyObject* ToPyObject(const std::vector<egr::EagerTensor>& value);
PyObject* ToPyObject(const platform::Place& value);

} // namespace pybind
} // namespace paddle

1 comment on commit 65518d5

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 65518d5 Nov 19, 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: #26 Commit ID: 65518d5 contains failed CI.

🔹 Failed: PR-CI-APPROVAL

approve_failed
2021-11-19 15:19:34 PADDLE_ENFORCE_EQ(meta.IsInitialized(), false, + "Bwd_in_meta should only be init once.");
2021-11-19 15:19:34 PADDLE_ENFORCE_LE(slot_rank, (bwd_in_meta_.size() - 1), + "Slot Rank should less equal than bwd_in_meta_ size.");
2021-11-19 15:19:34 PADDLE_ENFORCE_EQ(meta.IsInitialized(), false, + "Bwd_in_meta should only be init once.");
2021-11-19 15:19:34 PADDLE_ENFORCE_LE(slot_rank, (bwd_out_meta_.size() - 1), + "Slot Rank should less equal than bwd_out_meta_ size.");
2021-11-19 15:19:34 PADDLE_ENFORCE_EQ(meta.IsInitialized(), false, + "Bwd_out_meta should only be init once.");
2021-11-19 15:19:34 PADDLE_ENFORCE_LE((slot_rank + 1), bwd_out_meta_.size(), + "Slot Rank should less equal than bwd_out_meta_ size.");
2021-11-19 15:19:34 PADDLE_ENFORCE_EQ(meta.IsInitialized(), false, + "Bwd_out_meta should only be init once.");
2021-11-19 15:19:34 PADDLE_ENFORCE_NOT_NULL( + EagerUtils::unsafe_autograd_meta(tensor), + "Full reserved Tensor should not have null autograd meta");
2021-11-19 15:19:34 PADDLE_ENFORCE_NOT_NULL(out.get(), + "Eager Tensor %s is null and cannot be copied.", + out->name());
2021-11-19 15:19:34 PADDLE_ENFORCE_NOT_NULL( + out.get(), "Eager Tensor %s is null and cannot be copied.", out->name());
2021-11-19 15:19:34 There are 7 approved errors.
2021-11-19 15:19:34 ****************
2021-11-19 15:19:34 + EXCODE=6
2021-11-19 15:19:34 + echo 'EXCODE: 6'
2021-11-19 15:19:34 EXCODE: 6
2021-11-19 15:19:34 + echo 'ipipe_log_param_EXCODE: 6'
2021-11-19 15:19:34 ipipe_log_param_EXCODE: 6
2021-11-19 15:19:34 + exit 6

🔹 Failed: PR-CI-Build

Unknown Failed
2021-11-19 15:19:01 make: *** [all] Error 2
2021-11-19 15:19:01 + build_error=2
2021-11-19 15:19:01 + collect_ccache_hits
2021-11-19 15:19:01 ++ ccache -s
2021-11-19 15:19:01 ++ grep 'cache hit rate'
2021-11-19 15:19:01 ++ awk '{print $4}'
2021-11-19 15:19:01 + rate=98.29
2021-11-19 15:19:01 + echo 'ccache hit rate: 98.29%'
2021-11-19 15:19:01 ccache hit rate: 98.29%
2021-11-19 15:19:01 + echo 'ipipe_log_param_Ccache_Hit_Rate: 98.29%'
2021-11-19 15:19:01 + '[' 2 '!=' 0 ']'
2021-11-19 15:19:01 + exit 7
2021-11-19 15:19:01 + EXCODE=7
2021-11-19 15:19:01 + '[' 7 -eq 0 ']'
2021-11-19 15:19:01 + set +x
2021-11-19 15:19:01 Sorry, build failed.
2021-11-19 15:19:01 + exit 7
2021-11-19 15:19:01 {build code state=7}
2021-11-19 15:19:11 kill agent BUILD_CODE_FAIL

🔹 Failed: PR-CI-Windows-Inference

build_failed
2021-11-19 15:21:13 [219/1981] Building CXX object paddle\fluid\framework\CMakeFiles\op_info.dir\op_info.cc.obj
2021-11-19 15:21:13 [220/1981] Building CXX object paddle\fluid\platform\CMakeFiles\lodtensor_printer_test.dir\lodtensor_printer_test.cc.obj
2021-11-19 15:21:13 [221/1981] Building CXX object paddle\fluid\platform\CMakeFiles\profiler_test.dir\profiler_test.cc.obj
2021-11-19 15:21:14 [222/1981] Building CXX object paddle\fluid\platform\CMakeFiles\float16_test.dir\float16_test.cc.obj
2021-11-19 15:21:14 [223/1981] Building CXX object paddle\fluid\platform\CMakeFiles\bfloat16_test.dir\bfloat16_test.cc.obj
2021-11-19 15:21:14 [224/1981] Building CXX object paddle\fluid\platform\CMakeFiles\complex_test.dir\complex_test.cc.obj
2021-11-19 15:21:14 [225/1981] Building CUDA object paddle\fluid\framework\CMakeFiles\lod_tensor_gpu_test.dir\lod_tensor_test.cu.obj
2021-11-19 15:21:14 lod_tensor_test.cu
2021-11-19 15:21:14 ninja: build stopped: subcommand failed.
2021-11-19 15:21:14 7
2021-11-19 15:21:14 Build Paddle failed, will exit
2021-11-19 15:21:15 EXCODE: 7

🔹 Failed: PR-CI-Coverage

Unknown Failed
2021-11-19 15:24:06 make: *** [all] Error 2
2021-11-19 15:24:06 + build_error=2
2021-11-19 15:24:06 + collect_ccache_hits
2021-11-19 15:24:06 ++ ccache -s
2021-11-19 15:24:06 ++ grep 'cache hit rate'
2021-11-19 15:24:06 ++ awk '{print $4}'
2021-11-19 15:24:06 + rate=99.41
2021-11-19 15:24:06 + echo 'ccache hit rate: 99.41%'
2021-11-19 15:24:06 ccache hit rate: 99.41%
2021-11-19 15:24:06 + echo 'ipipe_log_param_Ccache_Hit_Rate: 99.41%'
2021-11-19 15:24:06 + '[' 2 '!=' 0 ']'
2021-11-19 15:24:06 + exit 7
2021-11-19 15:24:06 + EXCODE=7
2021-11-19 15:24:06 + '[' 7 -eq 0 ']'
2021-11-19 15:24:06 + set +x
2021-11-19 15:24:06 Sorry, build failed.
2021-11-19 15:24:06 + exit 7
2021-11-19 15:24:06 {build code state=7}
2021-11-19 15:24:16 kill agent BUILD_CODE_FAIL

🔹 Failed: PR-CI-Py3

Unknown Failed
2021-11-19 15:30:31 + rate=97.88
2021-11-19 15:30:31 + echo 'ccache hit rate: 97.88%'
2021-11-19 15:30:31 ccache hit rate: 97.88%
2021-11-19 15:30:31 + echo 'ipipe_log_param_Ccache_Hit_Rate: 97.88%'
2021-11-19 15:30:31 + '[' 2 '!=' 0 ']'
2021-11-19 15:30:31 + exit 7
2021-11-19 15:30:31 + EXCODE=7
2021-11-19 15:30:31 + '[' 7 -eq 0 ']'
2021-11-19 15:30:31 + [[ 7 -eq 0 ]]
2021-11-19 15:30:31 + [[ 7 -eq 4 ]]
2021-11-19 15:30:31 + [[ 7 -eq 5 ]]
2021-11-19 15:30:31 + [[ 7 -eq 6 ]]
2021-11-19 15:30:31 + [[ 7 -eq 7 ]]
2021-11-19 15:30:31 + echo 'Sorry, build failed.'
2021-11-19 15:30:31 Sorry, build failed.
2021-11-19 15:30:31 + set -x
2021-11-19 15:30:31 + exit 7
2021-11-19 15:30:31 {build code state=7}
2021-11-19 15:30:41 kill agent BUILD_CODE_FAIL

🔹 Failed: PR-CI-Kunlun

Unknown Failed
2021-11-19 15:57:10 [ 31%] Linking CXX static library libfrobenius_norm_op.a
2021-11-19 15:57:10 [ 31%] Built target frobenius_norm_op
2021-11-19 15:57:19 [ 31%] Linking CXX static library libreduce_prod_op.a
2021-11-19 15:57:19 [ 31%] Built target reduce_prod_op
2021-11-19 15:57:36 [ 31%] Linking CXX static library libreduce_sum_op.a
2021-11-19 15:57:36 [ 31%] Built target reduce_sum_op
2021-11-19 15:57:36 Makefile:140: recipe for target 'all' failed
2021-11-19 15:57:36 make: *** [all] Error 2
2021-11-19 15:57:36 + build_error=2
2021-11-19 15:57:36 + collect_ccache_hits
2021-11-19 15:57:36 ++ ccache -s
2021-11-19 15:57:36 ++ grep 'cache hit rate'
2021-11-19 15:57:36 ++ awk '{print $4}'
2021-11-19 15:57:36 ccache hit rate: 0.00%
2021-11-19 15:57:36 + rate=0.00
2021-11-19 15:57:36 + echo 'ccache hit rate: 0.00%'
2021-11-19 15:57:36 + echo 'ipipe_log_param_Ccache_Hit_Rate: 0.00%'
2021-11-19 15:57:36 + '[' 2 '!=' 0 ']'
2021-11-19 15:57:36 + exit 7

🔹 Failed: PR-CI-Windows-OPENBLAS

build_failed
2021-11-19 16:04:19        "C:\home\workspace\Paddle\build\ALL_BUILD.vcxproj" (default target) (1) ->
2021-11-19 16:04:19 "C:\home\workspace\Paddle\build\paddle\fluid\inference\tests\api\test_analyzer_paddletensor_tensor.vcxproj" (default target) (557) ->
2021-11-19 16:04:19 LINK : fatal error LNK1104: cannot open file 'python37.lib' [C:\home\workspace\Paddle\build\paddle\fluid\inference\tests\api\test_analyzer_paddletensor_tensor.vcxproj]
2021-11-19 16:04:19 "C:\home\workspace\Paddle\build\ALL_BUILD.vcxproj" (default target) (1) ->
2021-11-19 16:04:19 "C:\home\workspace\Paddle\build\paddle\fluid\inference\tests\api\lite_resnet50_test.vcxproj" (default target) (459) ->
2021-11-19 16:04:19 LINK : fatal error LNK1104: cannot open file 'python37.lib' [C:\home\workspace\Paddle\build\paddle\fluid\inference\tests\api\lite_resnet50_test.vcxproj]
2021-11-19 16:04:19 749 Warning(s)
2021-11-19 16:04:19 74 Error(s)
2021-11-19 16:04:19 Time Elapsed 00:32:02.45
2021-11-19 16:04:19 7
2021-11-19 16:04:19 Build Paddle failed, will exit
2021-11-19 16:04:19 EXCODE: 7

🔹 Failed: PR-CI-OP-benchmark

build_failed
2021-11-19 16:06:27 ccache hit rate: 48.98%
2021-11-19 16:06:27 + echo 'ipipe_log_param_Ccache_Hit_Rate: 48.98%'
2021-11-19 16:06:27 + '[' 2 '!=' 0 ']'
2021-11-19 16:06:27 + exit 7
2021-11-19 16:06:27 + '[' 7 -ne 0 ']'
2021-11-19 16:06:27 + LOG '[FATAL] compile fail.'
2021-11-19 16:06:27 + echo '[tools/test_ci_op_benchmark.sh:175] [FATAL] compile fail.'
2021-11-19 16:06:27 [tools/test_ci_op_benchmark.sh:175] [FATAL] compile fail.
2021-11-19 16:06:27 + exit 7
2021-11-19 16:06:27 + EXCODE=7
2021-11-19 16:06:27 + echo 'EXCODE: 7'
2021-11-19 16:06:27 EXCODE: 7
2021-11-19 16:06:27 + echo 'ipipe_log_param_EXCODE: 7'
2021-11-19 16:06:27 ipipe_log_param_EXCODE: 7
2021-11-19 16:06:27 + '[' 7 -eq 0 ']'
2021-11-19 16:06:27 + set +x
2021-11-19 16:06:27 Sorry, build failed.
2021-11-19 16:06:27 + exit 7
2021-11-19 16:06:27 {build code state=7}

Please sign in to comment.