Skip to content

Add option to run TensorFlow job on the preferred device (via Scope) #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 4, 2020

Conversation

zaleslaw
Copy link
Contributor

Related to the issue #77

@zaleslaw
Copy link
Contributor Author

zaleslaw commented Nov 29, 2020 via email

@karllessard
Copy link
Collaborator

Ah, did you marked it as a draft when you've created your PR? My GitHub iPad app did not tell me this, maybe a missing feature in the app. But yes, I think with only these small changes, your PR will be ready to be merged, thanks!

@zaleslaw
Copy link
Contributor Author

zaleslaw commented Nov 29, 2020 via email

@zaleslaw
Copy link
Contributor Author

@karllessard I've updated the PR and fixed all your proposals, please have a look

// Add Device String
writer->Append("opBuilder.setDevice(scope.makeDeviceString());");
writer->EndLine();

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @zaleslaw , I have another change to propose you that I just thought of. I think if we merge together scope.applyControlDependencies and this new step for adding the device string to the opBuilder would make the whole process of building an op simpler, especially with non-generated ones.

So what about that:

  1. We rename scope.applyControlDependencies(opBuilder) to scope.apply(opBuilder)
  2. In Scope.apply, we apply both control dependencies, the device string (and eventually more data if needed)

By doing so, we also won't need scope.makeDeviceString() anymore. Let me know what you think

@zaleslaw
Copy link
Contributor Author

zaleslaw commented Nov 30, 2020 via email

@zaleslaw
Copy link
Contributor Author

zaleslaw commented Dec 3, 2020

@karllessard I've updated a PR according your refactoring idea, but I have some troubles with quick build
"Failed to execute goal on project tensorflow-core-api: Could not resolve dependencies for project org.tensorflow:tensorflow-core-api:jar:0.3.0-SNAPSHOT: Could not find artifact org.tensorflow:tensorflow-core-api:jar:linux-x86_64:0.3.0-SNAPSHOT in ossrh-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project tensorflow-core-api: Could not resolve dependencies for project org.tensorflow:tensorflow-core-api:jar:0.3.0-SNAPSHOT: Could not find artifact org.tensorflow:tensorflow-core-api:jar:linux-x86_64:0.3.0-SNAPSHOT in ossrh-snapshots (https://oss.sonatype.org/content/repositories/snapshots)"

Could you pleas help with this issue?
Previous commit was succesful, after that I've added one method and it was failed

@karllessard
Copy link
Collaborator

@zaleslaw since your PR changes the generated files, we shouldn't use quick build anyway, I'll force a full build and see how it goes (independently to this, I suspect the missing artifact is due again to our trouble building all native artifacts on GitHub actions...)

@karllessard karllessard merged commit 8371529 into tensorflow:master Dec 4, 2020
@karllessard
Copy link
Collaborator

Full build passed (well partially, GPU-MKL timed out again on Linux and it's unrelated), thanks @zaleslaw !

@zaleslaw
Copy link
Contributor Author

zaleslaw commented Dec 4, 2020

Happy to hear!

@aday00
Copy link

aday00 commented Dec 6, 2020

Thanks @zaleslaw and @karllessard!!

rnett pushed a commit to rnett/tensorflow-java that referenced this pull request Dec 28, 2020
…ensorflow#159)

* Draft for DeviceSpec integration

* Added generation for Ops

* Removed something from generated Ops

* Finalized the PR

* Refactored Scope.apply method

* Handle case of separate usage of control dependencies in Init method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants