rondogency commented on a change in pull request #17762: Custom Operator Random
Number Generator Support
URL: https://github.com/apache/incubator-mxnet/pull/17762#discussion_r399441495
##########
File path: src/c_api/c_api.cc
##########
@@ -248,11 +251,24 @@ void CustomFComputeDispatcher(const std::string op_name,
// get actual cudaStream_t out of mxnet gpu stream and pass to lib_api.h
void *cuda_stream = nullptr;
#if MXNET_USE_CUDA
- if (inputs[0].ctx().dev_mask() == Context::kGPU) {
+ if (inputs.size() > 0 && inputs[0].ctx().dev_mask() == Context::kGPU) {
cuda_stream = static_cast<void*>(gpu_stream->stream_);
}
#endif
+ // get mxnet initialized and seeded RNG states and pass to lib_api.h
+ void *rng_cpu_states = nullptr, *rng_gpu_states = nullptr;
+ if (!is_subgraph_op) {
Review comment:
subgraph op is using DefaultSubgraphOpResourceRequest, so if no operator in
the subgraph resource request pass has parallel random, resource request will
error out
but I think I should check initialized resource types instead of check
subgraph op, I will make the change
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services