Skip to content
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

Feature Request: GPUOptions for Go binding #22926

Open
mattn opened this issue Oct 12, 2018 · 34 comments
Open

Feature Request: GPUOptions for Go binding #22926

mattn opened this issue Oct 12, 2018 · 34 comments

Comments

@mattn
Copy link
Contributor

@mattn mattn commented Oct 12, 2018

Current implementation of Go binding can not specify options.

GPUOptions struct is in internal package. And go generate doesn't work for protobuf directory. So we can't specify GPUOptions for NewSession.

@tensorflowbutler
Copy link
Member

@tensorflowbutler tensorflowbutler commented Oct 12, 2018

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce
Mobile device

@frreiss
Copy link
Contributor

@frreiss frreiss commented Dec 3, 2018

This problem appears to be broader than just specifying GPUOptions for TensorFlow sessions. There is no native Go API for passing any options when creating a session. The user must create the binary representation of a ConfigProto protocol buffer outside of the TensorFlow Go API.

See, for example, the test case TestSessionConfig in session_test.go:

func TestSessionConfig(t *testing.T) {
	// Exercise SessionOptions.
	// Arguably, a better API would be for SessionOptions.Config to be the
	// type generated by the protocol buffer compiler. But for now, the
	// tensorflow package continues to be independent of protocol buffers
	// and this test exercises the option since the implementation has a
	// nuanced conversion to C types.
	//
	// Till then, the []byte form of Config here was generated using a toy
	// tensorflow Python program:
	/*
	 import tensorflow
	 c = tensorflow.ConfigProto()
	 c.intra_op_parallelism_threads = 1
	 print c.SerializeToString()
	*/
	graph := NewGraph()
	c, err := Const(graph, "Const", int32(14))
	if err != nil {
		t.Fatal(err)
	}
	opts := SessionOptions{Config: []byte("(\x01")}
[...]

Would the TensorFlow maintainers accept a non-Google contribution that added the ability to specify session options using pure Go code? This functionality would require generating instances of the ConfigProto protocol buffer defined in config.proto. I can see two ways to generate these protocol buffers: Either add a build target to generate Go bindings for the files in tensorflow/core/protobuf; or add Go wrappers for the generated C++ code in tensorflow/core/protobuf/config.pb.h

@ymodak
Copy link
Contributor

@ymodak ymodak commented Dec 3, 2018

@asimshankar Can you please take a look? Thanks!

@alextp
Copy link
Contributor

@alextp alextp commented Mar 4, 2019

@frreiss we'll definitely accept a Go-only API to configure tensorflow.

@frreiss
Copy link
Contributor

@frreiss frreiss commented Mar 13, 2019

I am looking into this.

@frreiss
Copy link
Contributor

@frreiss frreiss commented Mar 13, 2019

Created PR #26682 with a Go API to create ConfigOptions protocol buffer messages. I made the changes as narrow in scope as I could.

@mattn
Copy link
Contributor Author

@mattn mattn commented Mar 30, 2019

Closed by #26682

@frreiss Thank you

@mattn mattn closed this Mar 30, 2019
@mattn
Copy link
Contributor Author

@mattn mattn commented Apr 5, 2019

@mattn mattn reopened this Apr 5, 2019
@imrahul361
Copy link

@imrahul361 imrahul361 commented Sep 28, 2020

is this issue open? Can i work on it? @mattn

@mattn
Copy link
Contributor Author

@mattn mattn commented Sep 30, 2020

Yes please.

@imrahul361
Copy link

@imrahul361 imrahul361 commented Oct 1, 2020

May I know how to reproduce the issue?

@mattn
Copy link
Contributor Author

@mattn mattn commented Oct 1, 2020

Sorry, I don't know why the changes was reverted.

#26682 (comment)

@imrahul361
Copy link

@imrahul361 imrahul361 commented Oct 1, 2020

ok no problem I will try some other issues

@AdeshKhandait
Copy link

@AdeshKhandait AdeshKhandait commented Oct 25, 2020

Hi,Adesh I am beginner i don't where start Can anybody help me?????

@Aditya-Komaravolu
Copy link

@Aditya-Komaravolu Aditya-Komaravolu commented Dec 19, 2020

Hello!
I am newbie to open source contribution and really interested to contribute!! . But I have very very less knowledge about it . Can anyone help me please?

@himanshu007-creator
Copy link

@himanshu007-creator himanshu007-creator commented Jan 1, 2021

can someone guide me what to do? i will be really thankful 👍

@Suraj-Upadhyay
Copy link
Contributor

@Suraj-Upadhyay Suraj-Upadhyay commented Jan 12, 2021

Kindly close this issue. It's confusing for first time contributors who come here for solving their first Issue.

@mattn
Copy link
Contributor Author

@mattn mattn commented Jan 12, 2021

I don't mind to close this but no one explain why #26682 was reverted.

@abadi003
Copy link

@abadi003 abadi003 commented Jan 13, 2021

is this still open?

@sajenjeshan1222
Copy link

@sajenjeshan1222 sajenjeshan1222 commented Feb 22, 2021

is it still open ?

@Gomesz785
Copy link

@Gomesz785 Gomesz785 commented Jul 20, 2021

@mattn is this issue closed?
if not
is it open for beginners to help?
if not then why does it have the good first issue??

@stellarshank
Copy link

@stellarshank stellarshank commented Jul 22, 2021

Assign me

@plopd
Copy link

@plopd plopd commented Jul 26, 2021

relax people! if u are here to solve these tasks, u are a beginner anyway.
just do it, regardless if someone already started working on the PR or not.
u will learn a bunch of stuff!!
don't focus too much on whether someone already started working on it. in that way, u will never start..

@i-am-epic
Copy link

@i-am-epic i-am-epic commented Aug 11, 2021

can any one guide me to this issue

@redabadreddine1236546
Copy link

@redabadreddine1236546 redabadreddine1236546 commented Aug 17, 2021

Hello Gays

@Smitty7177
Copy link

@Smitty7177 Smitty7177 commented Aug 21, 2021

Ok ill start on the issue.

@RedaAitBabaaziz
Copy link

@RedaAitBabaaziz RedaAitBabaaziz commented Aug 30, 2021

name =input("enter your name : ")
password = input("enter your password : ")
password_length = len(password)
if password_length <= 8:
print("Short paas troop word!")
elif 8 <password_length <= 12:
print("Medium paas word! ")
else:
print("Perfect paas word! ")
print(password_length)

@Gomesz785
Copy link

@Gomesz785 Gomesz785 commented Sep 6, 2021

@RedaAitBabaaziz ?

@engineerrbae
Copy link

@engineerrbae engineerrbae commented Sep 13, 2021

@plopd Thanks. I really look forward to lots of learning. So how to get started?

@Gomesz785
Copy link

@Gomesz785 Gomesz785 commented Sep 16, 2021

Note from the past to fellow coders and beginners:
Ahem.

So this pops up in the good first issue page and a lot of "good first issue finder" websites. You might've came from a link, or other way.

So here is the deal:

I am a TensorFlow Developer - god level: Try it out, if you can understand what these names mean and can spot them in in the "TensorFlow".

I am a TensorFlow Developer: Try to solve it/ or learn the issue.

I am a huge developer of [X language used in TensorFlow]: First learn the issue(more like, learn how the issue relates to the "TensorFlow".

I am a developer of [X language used in TensorFlow]: try it out; learn the issue.

I am a learner in TensorFlow: you can start by learning the code of TensorFlow, then the issue, then the solutions + comments( <- do this before solving it!)

I am a learner of [X language used in TensorFlow]: you can explore but try this issue when you become a I am a learner in TensorFlow or I am a developer of [X language used in TensorFlow]...

I am a learner of programming: first be a I am a learner of [X language used in TensorFlow] or a I am a developer of [X language used in TensorFlow]....

I am a explorer of GitHub/TensorFlow/[X language used in TensorFlow]: you can start by learning the code of TensorFlow, then the issue, then the solutions + comments( <- do this before solving it!)

After choosing what to do from the above; do these:

Understand what is going on here; what's the comments, what's the feature, what are the questions here, how all these PRs and versions align to the issue, Can you make a timeline of the improvements.

So you are fixing the issue: First understand what is "GPUOptions for Go binding" then look the PRs already in progress, then chat with everyone(feel free to chat in other places like Reddit, Stack overflow.

Thanks for the hearts!

@adsampaigncc
Copy link

@adsampaigncc adsampaigncc commented Sep 18, 2021

@Jurek54321
Copy link

@Jurek54321 Jurek54321 commented Oct 3, 2021

Hello-World

@Gomesz785
Copy link

@Gomesz785 Gomesz785 commented Oct 4, 2021

This comment section is just 1 mile away from getting the normal-land spam, isn't there some body to moderate this and take a look at the PRs and like disable commenting if a PR does good?

Examples of not-spam but worthless comments:

Hello Gays

has a lot reactions ⬆️ 🙄

#22926

Hello-World

name =input("enter your name : ")
password = input("enter your password : ")
password_length = len(password)
if password_length <= 8:
print("Short paas troop word!")
elif 8 <password_length <= 12:
print("Medium paas word! ")
else:
print("Perfect paas word! ")
print(password_length)

52193

I am sorry if I got a comment wrong but sure this needs attention from someone (even not for my request/specific-thing but just...)

@nuriAngraini
Copy link

@nuriAngraini nuriAngraini commented Oct 8, 2021

52193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet