Skip to content

Parallel quasi-newton optimizers for tensorflow-gpu #26100

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

Closed
timudk opened this issue Feb 25, 2019 · 10 comments · Fixed by #92780
Closed

Parallel quasi-newton optimizers for tensorflow-gpu #26100

timudk opened this issue Feb 25, 2019 · 10 comments · Fixed by #92780
Assignees
Labels
comp:gpu GPU related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author type:feature Feature requests

Comments

@timudk
Copy link

timudk commented Feb 25, 2019

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information

  • TensorFlow version (you are using): 1.12.0
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state.
Is there any interest in implementing quasi-Newton methods for tensorflow-gpu? There has been some work on a parallel L-BFGS-B method (https://www.sciencedirect.com/science/article/pii/S0097849314000119) for GPus.

Will this change the current api? How?
New implementation.

Who will benefit with this feature?
I have had some recent success with using the BFGS optimizer for feedforward neural network. This approach, however, is limited to small networks and to tensorflow-cpu.

Any Other info.

@ymodak ymodak added type:feature Feature requests comp:gpu GPU related issues labels Feb 26, 2019
@ymodak ymodak added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 26, 2019
@timudk
Copy link
Author

timudk commented Mar 8, 2019

Any updates?

@JiaweiZhuang
Copy link

JiaweiZhuang commented Apr 16, 2019

Found this from a tweet. Second-order methods are very efficient for small & smooth problems. An example is Picking an Optimizer for Style Transfer that shows BFGS performs better than SGD-like methods (related: tensorflow/tfjs#127). Currently this is done through a SciPy wrapper without GPU support (keras-team/keras#5085)

Useful references:

@junpenglao
Copy link

You can have a look at the implementation of BFGS and LBFGS in Tensorflow_probability, which do not wrap Scipy: https://github.com/tensorflow/probability/tree/master/tensorflow_probability/python/optimizer

@junpenglao
Copy link

It might be better to raise this feature request to Tensorflow_probability.

@timudk
Copy link
Author

timudk commented Jun 26, 2019

I finally got TFP's BFGS optimizer working for a supervised problem. Would adding an example to https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples be desirable?

@azaks3 azaks3 assigned sanjoy and unassigned azaks2 Dec 9, 2019
@sanjoy
Copy link
Contributor

sanjoy commented Dec 9, 2019

I finally got TFP's BFGS optimizer working for a supervised problem. Would adding an example to https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples be desirable?

@jvdillon WDYT?

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Dec 10, 2019
@danieltsai0
Copy link

I finally got TFP's BFGS optimizer working for a supervised problem. Would adding an example to https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples be desirable?

Can you share a code-snippet?

@rmothukuru
Copy link
Contributor

rmothukuru commented Jun 18, 2021

@timudk,
As per this comment this Feature seems to be implemented. Please find this working example in the Tensorflow Documentation.Thanks!

@rmothukuru rmothukuru self-assigned this Jun 18, 2021
@rmothukuru rmothukuru added the stat:awaiting response Status - Awaiting response from author label Jun 18, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jun 25, 2021
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

--
2dbc6e9d74e2b235303830a1247dcbecf5fde0a3 by Johannes Reifferscheid <[email protected]>:

Fix HloParser.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 2dbc6e9d74e2b235303830a1247dcbecf5fde0a3
PiperOrigin-RevId: 755257520
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 0f99b6f6a2e8fab85a90c7a451e94713034a90e5
PiperOrigin-RevId: 755258248
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 0f99b6f6a2e8fab85a90c7a451e94713034a90e5
PiperOrigin-RevId: 755258248
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

--
2dbc6e9d74e2b235303830a1247dcbecf5fde0a3 by Johannes Reifferscheid <[email protected]>:

Fix HloParser.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 2dbc6e9d74e2b235303830a1247dcbecf5fde0a3
PiperOrigin-RevId: 755257520
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

--
2dbc6e9d74e2b235303830a1247dcbecf5fde0a3 by Johannes Reifferscheid <[email protected]>:

Fix HloParser.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 2dbc6e9d74e2b235303830a1247dcbecf5fde0a3
PiperOrigin-RevId: 755257520
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

Merging this change closes #26100

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#26100 from jreiffers:cg 0f99b6f6a2e8fab85a90c7a451e94713034a90e5
PiperOrigin-RevId: 755258248
copybara-service bot pushed a commit that referenced this issue May 6, 2025
Imported from GitHub PR openxla/xla#26100

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start, just that the special field is unset. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.
Copybara import of the project:

--
0f99b6f6a2e8fab85a90c7a451e94713034a90e5 by Johannes Reifferscheid <[email protected]>:

Clean up special cases for AsyncStart in HloComputation.

These are no longer needed, since computations now know their callers. I kept the utility function to check if a computation is async, since it is used from many places.

I had to remove one check from the AsyncStart constructor. Previously, it didn't actually verify that the computation isn't already called by an async-start. I don't see a way to have this check and make the code in CommandBufferScheduling work.

After this, the only remaining special case is kFusion.

Merging this change closes #26100

PiperOrigin-RevId: 755381030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:gpu GPU related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author type:feature Feature requests
Projects
None yet
10 participants