-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support multi-task inference. #861
Merged
Merged
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
…-task learning (awslabs#828) *Issue #, if available:* Support multi-task learning. First PR for awslabs#789 *Description of changes:* Update GraphStorm input config parsing to support multi-task learning. Allow user to specify to specify multiple training tasks for a training job through yaml file. By providing the `multi_task_learning` configurations in the yaml file, users can define multiple training tasks. The following config defines two training tasks, one for node classification and one for edge classification. ``` --- version: 1.0 gsf: basic: ... ... multi_task_learning: - node_classification: target_ntype: "movie" label_field: "label" mask_fields: - "train_mask_field_nc" - "val_mask_field_nc" - "test_mask_field_nc" task_weight: 1.0 - edge_classification: target_etype: - "user,rating,movie" label_field: "rate" mask_fields: - "train_mask_field_ec" - "val_mask_field_ec" - "test_mask_field_ec" task_weight: 0.5 # weight of the task ``` Task specific hyperparameters in multi-task learning are same as thoses in single task learning, except that two new configs are required, i.e., mask_fields and task_weight. The mask_fields provides the training, validation and test masks for the task and the task_weight gives its loss weight. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Xiang Song <[email protected]>
…ng (awslabs#834) *Issue #, if available:* awslabs#789 *Description of changes:* Add GSgnnMultiTaskDataLoader to support multi-task learning. When initializing a GSgnnMultiTaskDataLoader, users need to provide two inputs: 1) a list of config.TaskInfo objects recording the information of each task and 2) a list of dataloaders corresponding to each training task. During training for each iteration, GSgnnMultiTaskDataLoader will iteratively call each task-dataloader to generate a mini-batch and finally return a list of mini-batches to the trainer. The length of the dataloader (number of batches for an epoch) is determined by the largest task in the GSgnnMultiTaskDataLoader. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Xiang Song <[email protected]>
zhjwy9343
reviewed
Jun 16, 2024
zhjwy9343
reviewed
Jun 17, 2024
zhjwy9343
reviewed
Jun 17, 2024
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.
Just finished all reviews except for test. Let's see the test results filrst.
zhjwy9343
approved these changes
Jun 17, 2024
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.
LGTM
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.
Issue #, if available:
#789
Description of changes:
This PR adds inference support for multi-task learning. Users can use
python3 -m graphstorm.run.gs_multi_task_learning --inference
to launch a inference task.This PR also changes remap_result.py to support remapping prediction results from multi-task learning inference. (The prediction results of each task are stored separately on different folders with the name of the corresponding task id.)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.