Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[RFC][DTypes] pooling and LeakyReLU #2280

Closed
wants to merge 4 commits into from
Closed

Conversation

vchuravy
Copy link
Contributor

@tqchen Is this the right approach? I seem to be missing something since I am getting

/home/wallnuss/src/mxnet/mshadow/mshadow/././half.h:248:31: error: invalid cast from type ‘mshadow::expr::CroppingExp<mshadow::expr::MakeTensorExp<mshadow::expr::UnPoolingExp<mshadow::red::maximum, mshadow::expr::MakeTensorExp<mshadow::expr::PaddingExp<mshadow::Tensor<mshadow::cpu, 4, mshadow::half::half_t>, mshadow::half::half_t, 4>, mshadow::Tensor<mshadow::cpu, 4, mshadow::half::half_t>, 4, mshadow::half::half_t>, mshadow::half::half_t, 4>, mshadow::expr::MakeTensorExp<mshadow::expr::PaddingExp<mshadow::Tensor<mshadow::cpu, 4, mshadow::half::half_t>, mshadow::half::half_t, 4>, mshadow::Tensor<mshadow::cpu, 4, mshadow::half::half_t>, 4, mshadow::half::half_t>, 4, mshadow::half::half_t>, mshadow::half::half_t, 4>’ to type ‘float’
 MSHADOW_HALF_OPERATOR(half_t, *)

for (unsigned i = 0; i < in_type->size(); ++i) {
CHECK(in_type->at(i) == mshadow::default_type_flag ||
in_type->at(i) == -1) << "Unsupported data type " << in_type->at(i);
int dtype = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

The default infertype forces float32 because most ops don't support other types. If your op does, override this in that op

@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 1, 2016

@piiswrong @tqchen 0ed4195 has a workaround for the problem I described in dmlc/mshadow#125

@vchuravy vchuravy force-pushed the vc/fp16 branch 2 times, most recently from e1ecdda to b4f903d Compare June 1, 2016 15:07
@vchuravy vchuravy changed the title [RFC] Allow pooling to work with more DTypes Allow pooling to work with more DTypes Jun 1, 2016
@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 1, 2016

@piiswrong Could you take another look at this?

@vchuravy vchuravy force-pushed the vc/fp16 branch 2 times, most recently from 7119766 to 24b9325 Compare June 2, 2016 04:25
CHECK_EQ(in_type->size(), 1);
int dtype = in_type->at(0);

if (dtype == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not double? Also consider use mshadow::kDouble instead of number

@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 3, 2016

@piiswrong Thank you for the comments, I rebased and addressed them.

@piiswrong
Copy link
Contributor

please fix the compile error

@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 4, 2016

done.

@vchuravy vchuravy changed the title Allow pooling to work with more DTypes [RFC][DTypes] pooling and LeakyReLU Jun 9, 2016
@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 9, 2016

LeakyReLU has the same operator dispatch problem that Pooling has

@vchuravy vchuravy force-pushed the vc/fp16 branch 3 times, most recently from 0f0d5d2 to 1e76151 Compare June 9, 2016 10:14
@vchuravy
Copy link
Contributor Author

vchuravy commented Jun 9, 2016

Travis run through earlier except for a lint problem that I consecutively fixed (https://travis-ci.org/dmlc/mxnet/builds/136388742) and had a seqfault on travis on the second run (https://travis-ci.org/dmlc/mxnet/builds/136410568).

I have seen that seqfault before, but it is always transient

@vchuravy vchuravy closed this Jun 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants