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

Setup for newer operator routines which have large and small float types #236

Merged
merged 29 commits into from
Apr 27, 2017

Conversation

cjolivier01
Copy link
Member

BatchNorm (and I presume others) have accumulators, for instance, which may require a larger type to hold summations or other progressive operations

@cjolivier01
Copy link
Member Author

Some Torch algorithms tend to have both types

mshadow/base.h Outdated
case mshadow::kFloat32: \
{ \
typedef float DType; \
typedef double DLargeType; \
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed.

Copy link
Member

Choose a reason for hiding this comment

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

float is enough here

Copy link
Member Author

@cjolivier01 cjolivier01 Apr 26, 2017

Choose a reason for hiding this comment

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

in Torch, they use double for summations across a tensor of floats in order to avoid overflows

mshadow/base.h Outdated
case mshadow::kFloat16: \
{ \
typedef mshadow::half::half_t DType; \
typedef float DLargeType; \
Copy link
Member

Choose a reason for hiding this comment

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

This is sometimes usefull but may break backward compatibility.

Copy link
Member Author

@cjolivier01 cjolivier01 Apr 26, 2017

Choose a reason for hiding this comment

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

Not sure what you mean -- this isn't use anywhere else so far, although I expect further non-mshadow ports to use it. What backward compatibility might be broken?

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