Skip to content

Add mkldnn fallbacks for Resnet50 training ops#8541

Closed
wuhuikx wants to merge 13 commits intopytorch:masterfrom
wuhuikx:resnet50
Closed

Add mkldnn fallbacks for Resnet50 training ops#8541
wuhuikx wants to merge 13 commits intopytorch:masterfrom
wuhuikx:resnet50

Conversation

@wuhuikx
Copy link
Contributor

@wuhuikx wuhuikx commented Jun 15, 2018

  1. Add fallback gradient ops
  2. In fallback ops, set the output Tensor as CPUTensor instead of IDEEPTensor if ndim = 0. Because IDEEPTensor doesn't support 0 dim.

@onnxbot onnxbot added the caffe2 label Jun 15, 2018
@wuhuikx
Copy link
Contributor Author

wuhuikx commented Jun 15, 2018

@yinghai , could you pls help to review code?

@yinghai
Copy link
Contributor

yinghai commented Jun 29, 2018

Rebase?

@wuhuikx
Copy link
Contributor Author

wuhuikx commented Jul 2, 2018

Yes, have rebased.

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.

@yinghai has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

if (src.ndim() == 0) {
VLOG(1) << "Copy output: index " << i << " skipped.";
Blob* dst = OperatorBase::OutputBlob(i);
dst->Reset(new Tensor<CPUContext>());

This comment was marked as off-topic.

This comment was marked as off-topic.

@jgong5
Copy link
Collaborator

jgong5 commented Jul 13, 2018

@wesolwsk

@jgong5
Copy link
Collaborator

jgong5 commented Jul 27, 2018

@yinghai Any comments on the updates? OK to merge?

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.

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

@yinghai
Copy link
Contributor

yinghai commented Jul 31, 2018

@jgong5 Could you rebase? There seems to be merge conflict.

@wuhuikx
Copy link
Contributor Author

wuhuikx commented Aug 1, 2018

@yinghai I have rebased it yesterday and there is not conflict now.
However the rebased code cannot build successfully. The failure seems nothing to do with me.

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.

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

@yinghai
Copy link
Contributor

yinghai commented Aug 1, 2018

@wuhuikx Could you double check??

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.

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

Copy link
Contributor

@yinghai yinghai left a comment

Choose a reason for hiding this comment

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

You need to do

git checkout master
git fetch upstream
git merge upstream/master

to really sync up the code.

if (src.ndim() == 0) {
VLOG(1) << "Copy output: index " << i << " skipped.";
Blob* dst = OperatorBase::OutputBlob(i);
dst->Reset(new Tensor<CPUContext>());

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.

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

Copy link
Contributor

@yinghai yinghai left a comment

Choose a reason for hiding this comment

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

LG

if (src.ndim() == 0) {
VLOG(1) << "Copy output: index " << i << " skipped.";
Blob* dst = OperatorBase::OutputBlob(i);
dst->Reset(new Tensor<CPU>());

This comment was marked as off-topic.

@wuhuikx
Copy link
Contributor Author

wuhuikx commented Aug 2, 2018

@yinghai Have revised and pass all checks. Pls help review.

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.

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

VLOG(1) << "Copy output: index " << i << " skipped.";
Blob* dst = OperatorBase::OutputBlob(i);
dst->Reset(new Tensor(CPU));
auto dtensor = dst->template GetMutable<TensorCPU>();

This comment was marked as off-topic.

@wuhuikx
Copy link
Contributor Author

wuhuikx commented Aug 3, 2018

@yinghai Revised Done. Sorry for inconvenient.

@wesolwsk
Copy link
Contributor

wesolwsk commented Aug 3, 2018

What is the process for check-in? Import to phabricator and accept from there?

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.

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

"output type who needs copying.");
const auto& src = local_output_blobs_[i]->template Get<TensorCPU>();

auto src_dims = src.dims();

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.

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

@wuhuikx wuhuikx changed the title [IDEEP] Add IDEEP fallbacks for Resnet50 training ops Add mkldnn fallbacks for Resnet50 training ops Aug 7, 2018
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
1. Add fallback gradient ops
2. In fallback ops, set the output Tensor as CPUTensor instead of IDEEPTensor if ndim = 0. Because IDEEPTensor doesn't support 0 dim.
Pull Request resolved: pytorch#8541

Reviewed By: yinghai

Differential Revision: D9115233

Pulled By: wesolwsk

fbshipit-source-id: 163e6a76f02bd781c95d1060ccbacf2cab90055e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants