Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

stream_gpu-inl.h:65: Default GPU stream was used when MSHADOW_FORCE_STREAM was on #75

Open
raymondtay opened this issue Nov 22, 2015 · 6 comments
Assignees

Comments

@raymondtay
Copy link

Hi,
is there an idea why i'm getting this error when i attempt to run the binary from _basic_streams.cu_

stream_gpu-inl.h:65: Default GPU stream was used when MSHADOW_FORCE_STREAM was on

any tips and advice is appreciated.

@raymondtay
Copy link
Author

Something i noticed is that when i made this modification to _tensor_cpu-inl.h_ because the value of stream_ is actually null and the basic_streams.cu could work (of course, i commented out the the function Copy(cpu_res, res) in basic_streams.cu)

NewTensor(const Shape<dim> &shape, DType initv, bool pad, Stream<Device> *stream_) {
   Tensor<Device, dim, DType> obj(shape);
   Stream<Device> * _stream = NewStream<Device>(); // this is the line added.
   obj.stream_ = _stream;
   // obj.stream_ = stream_; 
   // everything as per in the code

After some testing, it appears that the root problem is GCC's rule on default arguments that's causing the problem i.e. in the function declaration in _tensor.h_

568 template<typename Device, typename DType, int dim>
569 inline Tensor<Device, dim, DType> NewTensor(const Shape<dim> &shape,
570                                             DType initv,
571                                             bool pad = MSHADOW_ALLOC_PAD,
572                                             Stream<Device> *stream = NULL);

I'll test some more and see what else i can find.

@tqchen
Copy link
Member

tqchen commented Nov 23, 2015

@antinucleon can you update the example?

@raymondtay
Copy link
Author

So, got the example to work properly but there's a few signature changes which i highlight them below but i'm not sure what's your design rationale so i leave it to you?

// file: tensor_cpu-inl.h
NewTensor(const Shape<dim> &shape, DType initv, Stream<Device> *stream_, bool pad) {

// file: tensor.h
template<typename Device, typename DType, int dim>
inline Tensor<Device, dim, DType> NewTensor(const Shape<dim> &shape,
                                            DType initv,
                                            Stream<Device> *stream = NULL,
                                            bool pad = MSHADOW_ALLOC_PAD);

another problem is the API Copy<cpu,gpu>(...) which needs to be updated because the stream_ which is by default NULL keeps getting passed and as far as from the _basic_streams.cu_ i could see several approaches i.e. create a new gpu stream or get somebody else's gpu stream

template<int dim, typename DType>
inline void Copy(Tensor<cpu, dim, DType> dst,
                 const Tensor<gpu, dim, DType> &src,
                 Stream<gpu> *stream = NULL);

@akturtle
Copy link

u can just change the fallowing code in basic_stream.cu:

`  Tensor<gpu, 2, float> ts1 = NewTensor<gpu, float>(Shape2(2, 5), 0.0f,MSHADOW_ALLOC_PAD , sm1);
  Tensor<gpu, 2, float> ts2 = NewTensor<gpu, float>(Shape2(2, 5), 0.0f,MSHADOW_ALLOC_PAD , sm2);`

@apeforest
Copy link
Contributor

Got the same error just running the test in mshadow/test. What is the recommendation solution?

@szha
Copy link
Member

szha commented Aug 4, 2019

This code base has been donated to the Apache MXNet project per #373, and repo is deprecated. Future development and issue tracking should continue in Apache MXNet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants