-
Notifications
You must be signed in to change notification settings - Fork 323
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
Update Sockeye to MXNet/Gluon 2.x #953
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 84431df.
fhieber
changed the title
[DO NOT MERGE] Work in progress to update to MX2 APIs
Update Sockeye to MXNet/Guon 2.x
Jul 11, 2021
fhieber
changed the title
Update Sockeye to MXNet/Guon 2.x
Update Sockeye to MXNet/Gluon 2.x
Jul 11, 2021
…names, improve log parameters to show shared parameters
fhieber
force-pushed
the
mx2
branch
2 times, most recently
from
September 17, 2021 09:01
2c2a0ef
to
17d05f1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates Sockeye to the APIs introduced in MXNet 2 (i.e. the mxnet/master branch).
Major changes with MX2:
*Output
operators have been removed with MXNet v2. Therefore we are required to use our secondary loss implementation withoutSoftmaxOutput
.hybrid_forward
, but onlyforward
, which uses Parameter class members directly (i.e.self.weight.data()
), and themx.nd
namespace (no more 'F
'). One consequence of this is that we cannot use our pattern of implementing bothforward
andhybrid_forward
for HybridBlocks to have shape-inspecting logic/computation in HybridBlocks. We resolve this by introducing the same pattern using__call__
andforward
:)__hash__
, therefore we cannot use the lru_cache trick inOutputLayer
. I worked around this by writing a hacky minimal 'cache', hasing on the string representation of the array.Known/Open Issues:
Changes:
with self.name_scope()
everywhere.mx.np
-- the new Numpy Array interface(x, 1)
shapes for various auxiliary arrays in beam search (finished, inactive
etc.)Potential future work
Related links:
Note: This PR changes the Github action for pull requests to install a nightly build of MX2.
Pull Request Checklist
until you can check this box.
pytest
)pytest test/system
)./style-check.sh
)sockeye/__init__.py
. Major version bump if this is a backwards incompatible change.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.