Skip to content

Replace float16 with at::Half in caffe2#11676

Closed
li-roy wants to merge 5 commits intopytorch:masterfrom
li-roy:caffehalf
Closed

Replace float16 with at::Half in caffe2#11676
li-roy wants to merge 5 commits intopytorch:masterfrom
li-roy:caffehalf

Conversation

@li-roy
Copy link
Contributor

@li-roy li-roy commented Sep 13, 2018

  • Finishes unifying Half type in pytorch and caffe2
  • As a side effect, aten_op works for fp16 now

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@li-roy li-roy changed the title [test] Replace float16 with at::Half in caffe2 Replace float16 with at::Half in caffe2 Sep 14, 2018
// Make __f16 a fundamental type.
namespace std {
template<>
struct is_fundamental<at::Half> : std::integral_constant<bool, true> {

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Sep 14, 2018

Please get a caffe2 person to review.

// Make __f16 a fundamental type.
namespace std {
template<>
struct is_fundamental<at::Half> : std::integral_constant<bool, true> {

This comment was marked as off-topic.

"Short on this platform is not 16 bit.");
namespace caffe2 {
typedef struct CAFFE2_API CAFFE2_ALIGNED(2) __f16 { uint16_t x; } float16;
typedef at::Half float16;

This comment was marked as off-topic.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@Yangqing Yangqing left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This looks great, own general comment about unification.

"Short on this platform is not 16 bit.");
namespace caffe2 {
typedef struct CAFFE2_API CAFFE2_ALIGNED(2) __f16 { uint16_t x; } float16;
using float16 = at::Half;

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

li-roy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@li-roy
Copy link
Contributor Author

li-roy commented Sep 18, 2018

Closing in favor of #11785.

@li-roy li-roy closed this Sep 18, 2018
li-roy pushed a commit to li-roy/pytorch that referenced this pull request Sep 20, 2018
Summary:
- Finishes unifying Half type in pytorch and caffe2
- As a side effect, aten_op works for fp16 now
Pull Request resolved: pytorch#11676

Differential Revision: D9829019

fbshipit-source-id: e5f800024478c2e68ef29f4c06b4f0002f81a3f7
facebook-github-bot pushed a commit that referenced this pull request Sep 21, 2018
Summary:
- Finishes unifying Half type in pytorch and caffe2
- As a side effect, aten_op works for fp16 now
Pull Request resolved: #11676

Reviewed By: weiyangfb

Differential Revision: D9829019

Pulled By: li-roy

fbshipit-source-id: b8c9663873c10fe64c90ef180dc81af2e866674e
zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 21, 2018
Summary:
- Finishes unifying Half type in pytorch and caffe2
- As a side effect, aten_op works for fp16 now
Pull Request resolved: pytorch/pytorch#11676

Reviewed By: weiyangfb

Differential Revision: D9829019

Pulled By: li-roy

fbshipit-source-id: b8c9663873c10fe64c90ef180dc81af2e866674e
iotamudelta pushed a commit to ROCm/pytorch that referenced this pull request Sep 21, 2018
Summary:
- Finishes unifying Half type in pytorch and caffe2
- As a side effect, aten_op works for fp16 now
Pull Request resolved: pytorch#11676

Reviewed By: weiyangfb

Differential Revision: D9829019

Pulled By: li-roy

fbshipit-source-id: b8c9663873c10fe64c90ef180dc81af2e866674e
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants