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

Switch to Flux with zygote #19

Closed
wants to merge 1 commit into from
Closed

Switch to Flux with zygote #19

wants to merge 1 commit into from

Conversation

ayush-1506
Copy link
Member

@ayush-1506 ayush-1506 commented Mar 31, 2020

Involves just a few small changes (Since the overall API hasn't changed much). Tests pass locally. Since our gradients aren't tracker types, we don't need to get the .data attribute anymore.

@ayush-1506
Copy link
Member Author

@ablaom I'm not sure if it's a good time to switch to Zygote. If it isn't we'll probably let this PR be idle. Else, we can merge this.

@ayush-1506 ayush-1506 requested a review from ablaom March 31, 2020 01:27
@ablaom
Copy link
Collaborator

ablaom commented Mar 31, 2020

Many thanks for this!

@ayush-1506 I have asked for feedback on this question here (slack):

https://julialang.slack.com/archives/C7LFJTXV5/p1585591105130500

and copied you in.

So far, the reaction is mixed. Let's hold out at least until my code review is finished, thanks!

@ablaom
Copy link
Collaborator

ablaom commented Apr 1, 2020

I wonder if it is too much trouble to support both Flux streams. We could put some magic into the __init__ function to define a global constant USING_ZYGOTE::Bool and dispatch methods accordingly. Tests would also need to be refactored.

Thoughts?

@ayush-1506
Copy link
Member Author

@ablaom We could do that, but I'm not sure if tracker/zygote makes a lot of difference to the user. I can't think of a reason why someone using, say, NeuralNetworkClassifier would like to use Zygote instead of Tracker (or vice-versa), since they directly don't need to deal with the TrackedValues or gradients. For other more complicated applications, maybe it makes sense.

The main advantage of switching to Zygote is so that we keep using the latest Flux and don't get stuck with older versions as Flux moves forward. Let me know what you think.

@ablaom
Copy link
Collaborator

ablaom commented Apr 1, 2020

Well, the problem, as I understand it is that Zygote still has issues, according to one person on the slack discussion I mentioned.

@ayush-1506
Copy link
Member Author

I guess that's true. There's a lot of activity on the zygote issue tracker. I'm more oriented towards using Tracker at the moment (since it gets the job done in most cases) and switching to Zygote when we think it's a good time. If you think it's better to add an option, let me know.

@ablaom
Copy link
Collaborator

ablaom commented Jun 9, 2020

@ayush let's switch to zygote, ie bump [compat] Flux="^10.4" and do the necessary refactoring.

You happy to re-activate this?

@ablaom ablaom mentioned this pull request Jun 9, 2020
6 tasks
@ayush-1506
Copy link
Member Author

Opening a new PR for this

@ayush-1506 ayush-1506 closed this Jun 10, 2020
@DilumAluthge DilumAluthge deleted the zygote branch April 15, 2021 23:45
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.

None yet

2 participants