-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Relax][Training] Trainer API #115
Merged
SiriusNEO
merged 15 commits into
mlc-ai:relax
from
SiriusNEO:mlc-dev/2023-01-30-trainer
Feb 10, 2023
Merged
[Relax][Training] Trainer API #115
SiriusNEO
merged 15 commits into
mlc-ai:relax
from
SiriusNEO:mlc-dev/2023-01-30-trainer
Feb 10, 2023
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
SiriusNEO
force-pushed
the
mlc-dev/2023-01-30-trainer
branch
from
February 1, 2023 01:34
1c538c5
to
542f647
Compare
20 tasks
SiriusNEO
changed the title
[WIP][Relax][Training] Trainer API
[Relax][Training] Trainer API
Feb 1, 2023
SiriusNEO
force-pushed
the
mlc-dev/2023-01-30-trainer
branch
from
February 5, 2023 06:25
e24152e
to
59223bc
Compare
Ubospica
reviewed
Feb 6, 2023
Ubospica
reviewed
Feb 6, 2023
MasterJH5574
reviewed
Feb 6, 2023
SiriusNEO
force-pushed
the
mlc-dev/2023-01-30-trainer
branch
from
February 8, 2023 00:56
576e7cb
to
f0beb77
Compare
MasterJH5574
pushed a commit
that referenced
this pull request
Feb 8, 2023
* Add gpu ci. * Update autotir gpu test.
SiriusNEO
force-pushed
the
mlc-dev/2023-01-30-trainer
branch
from
February 9, 2023 08:50
fa1b184
to
2fa30cd
Compare
spectrometerHBH
pushed a commit
to spectrometerHBH/relax
that referenced
this pull request
Feb 9, 2023
* Add gpu ci. * Update autotir gpu test.
MasterJH5574
approved these changes
Feb 10, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one minor point. Besides, would you like to update the PR description a bit so that it is consistent with the new API?
SiriusNEO
force-pushed
the
mlc-dev/2023-01-30-trainer
branch
from
February 10, 2023 04:19
e612300
to
15fb62b
Compare
MasterJH5574
pushed a commit
that referenced
this pull request
Feb 12, 2023
This PR brings a wrapper for relax training. The following things are done internally in this trainer: - Maintain (store/update) the parameters of the module. - Merge backbone and specified loss function together. - Build/Compile/Run the module. - Build/Compile/Run the optimizer. (using the same vm_config as we run the module.) And it also provides two interfaces for loading params/exporting params. Example: ``` trainer = Trainer(MLP, [1, 2], "main") # [1, 2] means input[1] and input[2] are parameters in this module. trainer.set_loss(MSELoss(reduction="sum"), pred_sinfo, pred_sinfo) trainer.set_vm_config(target="llvm") trainer.set_optimizer(optim_type=SGD, lr=0.001).setup() trainer.setup() trainer.rand_init_params() trainer.forward(*fwd_inputs) trainer.backward(*bwd_inputs) ```
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 PR brings a wrapper for relax training. The following things are done internally in this trainer:
And it also provides two interfaces for loading params/exporting params.
Example: