Skip to content

Verbs hang fix - #12361

Merged
jhseu merged 3 commits into
tensorflow:masterfrom
yanivbl6:verbs_hang_fix_for_master
Aug 24, 2017
Merged

jhseu merged 3 commits into
tensorflow:masterfrom
yanivbl6:verbs_hang_fix_for_master

Conversation

@yanivbl6

@yanivbl6 yanivbl6 commented Aug 17, 2017 •

Copy link
Copy Markdown

Replaces the sync wrappers for device to device operations in verbs_util, with a call to the async function with a callback function. Resolves Issue #11725

As mentioned in the issue:
I think the problem rises because the Sync deviceToDevice operation blocks the thread, preventing the earlier Async Device to Device operation from finishing- which, for some reason, blocks the later operation.

I've tested this fix in origin/r1.3 since origin/master is currently broken.

2nd commit only removes the unused functions from verbs_utils. It is not required for validity.

@junshi15 , @shamoya , @byronyi , can you please go over this?

yanivbl6 added 2 commits August 17, 2017 13:15
…ce operations, with a call to the async function with a callback function.

This is done in order to fix a bug that occurs while using verbs, and causes the program to hang.
@tensorflow-jenkins

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@mention-bot

Copy link
Copy Markdown

@yanivbl6, thanks for your PR! By analyzing the history of the files in this pull request, we identified @caisq, @llhe and @ringw to be potential reviewers.

@junshi15

Copy link
Copy Markdown
Contributor

Thanks for the fix. Is there any reason you did not get rid of CopyCPUTensorToGPUSync in verbs_util.h?

@yanivbl6

Copy link
Copy Markdown
Author

CopyCPUTensorToGPUSync is still being used by RdmaRemoteRendezvous here
I am still studying it, so I avoided changing this call. But if my understanding of the bug was correct it is definitely a risk.

@byronyi

byronyi commented Aug 17, 2017

Copy link
Copy Markdown
Contributor

Nice work!

I think I am using the same sync wrappers (yes all of us are lazy) in my GDR patch. I might as well take a closer look on this before someone raises another issue :)

@junshi15

Copy link
Copy Markdown
Contributor

@yanivbl6 CopyCPUTensorToGPUSync can be an issue if not fixed. Can we fix the one in RdmaRemoteRendezvous as well? thanks.

@yanivbl6

Copy link
Copy Markdown
Author

Sure, I am on it.

@junshi15

Copy link
Copy Markdown
Contributor

I only have access to two boxes with fairly old OS (RHEL6.5) and CUDA 7.5, which limited me to TF1.1. I modify the patch to fit TF1.1, but got the following error during benchmark test.
error message: Cannot parse tensor from proto
Not sure if this is due to my adaptation or it is a problem with this patch.
@shamoya , @bkovalev can you test this patch on TF1.2 or 1.3, if you have access to newer OS/CUDA. Thanks.

@shamoya

shamoya commented Aug 20, 2017

Copy link
Copy Markdown
Contributor

Very good work @yanivbl6 , patch looks good.
Plz just update when u finish checking this patch on TF1.2 and TF1.3.

@yanivbl6

Copy link
Copy Markdown
Author

I ran successful tf_cnn_benchmarks with r1.3 ( 4 hosts (worker + ps), 8X4 GPUs, Imagenet data, Resnet-50 model).

@shamoya

shamoya commented Aug 22, 2017 •

Copy link
Copy Markdown
Contributor

Hi @poxvoculi @junshi15,

Can we merge this ?
And when it's merged to master, can we cherry-pick it to r1.3 (since master verbs code is broken) ?

// "val" is on a GPU. No longer uses GPUUtil to fill the proto, use
// aync instead
GPUUtil::SetProtoFromGPU(
in, src_dev, send_args.device_context, &proto, is_dead,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Someday you should return an error status instead of check failing, especially if there's a chance this is a transient error. (Applies to the CHECK a couple lines below.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed. The error handling can be improved. Maybe we should send error status back to the caller (like here) and let the caller decide what to do, either re-try or abort.

However, for this patch, let's not address it as returning the error status to the caller/requester may require an extra signal path.

This patch looks good to me otherwise.

@junshi15

Copy link
Copy Markdown
Contributor

@poxvoculi What's the policy for patching a branch? Given the fix for verbs on master will take time, it will be useful to patch TF 1.3 (and maybe 1.2).

@poxvoculi

Copy link
Copy Markdown
Contributor

I don't know about branch patching. @jhseu might know.

@jhseu

jhseu commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

Jenkins, test this please

@jhseu

jhseu commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

We're not making anymore changes to v1.3. This will appear in TF 1.4, though.

@jhseu
jhseu merged commit e650dcf into tensorflow:master Aug 24, 2017
@shamoya

shamoya commented Aug 24, 2017

Copy link
Copy Markdown
Contributor

Thanks @jhseu
The problem is that the verbs code is broken in master for now due to this issue.
We are working on a fix for, which may require some time.
For now, people who want to work with the RDMA Verbs need to patch r1.3 manually with this commit.
It's not so crazy, but less comfortabale.
I thought v1.3.0 is already out, so cherry-picking this to r1.3 doesn't mean a lot.
or are you updating the v1.3 binary version with r1.3 from time to time ?

@yanivbl6
yanivbl6 deleted the verbs_hang_fix_for_master branch August 27, 2017 12:35
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.

9 participants